bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public String toString() { StringBuffer sb = new StringBuffer("CalSvcIPars{"); sb.append("authUser="); sb.append(getAuthUser()); sb.append(", rights="); sb.append(getRights()); sb.append(", user="); sb.append(getUser()); sb.append(", publicAdmin="); sb.append(getPublicAdmin()); sb.append(", caldav="); sb.append(getCaldav()); sb.append(", synchid="); sb.append(getSynchId()); sb.append(", debug="); sb.append(getDebug()); sb.append("}"); return sb.toString(); }
|
public String toString() { StringBuffer sb = new StringBuffer("CalSvcIPars{"); sb.append("authUser="); sb.append(getAuthUser()); sb.append(", rights="); sb.append(getRights()); sb.append(", user="); sb.append(getUser()); sb.append(", publicAdmin="); sb.append(getPublicAdmin()); sb.append(", caldav="); sb.append(getCaldav()); sb.append(", synchid="); sb.append(getSynchId()); sb.append(", debug="); sb.append(getDebug()); sb.append("}"); return sb.toString(); }
| 1,118,811
|
public int indexOf(URL url) { int size = list.size(); for (int i = 0; i < size; i++) { ItemWrapper iw = (ItemWrapper)list.get(i); if (iw.isVisible() && iw.getURL().equals(url)) { return i; } } return -1; }
|
public int indexOf(URL url) { int size = list.size(); for (int i = 0, j = 0; i < size; i++) { ItemWrapper iw = (ItemWrapper)list.get(i); if (iw.isVisible() && iw.getURL().equals(url)) { return i; } } return -1; }
| 1,118,812
|
public int indexOf(URL url) { int size = list.size(); for (int i = 0; i < size; i++) { ItemWrapper iw = (ItemWrapper)list.get(i); if (iw.isVisible() && iw.getURL().equals(url)) { return i; } } return -1; }
|
public int indexOf(URL url) { int size = list.size(); for (int i = 0; i < size; i++) { ItemWrapper iw = (ItemWrapper)list.get(i); if (iw.isVisible() && iw.getURL().equals(url)) { return i; } } return -1; }
| 1,118,813
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,814
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)){ copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,815
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,816
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(left, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,817
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, left - majorTickLength, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, left - majorTickLength, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,818
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(left - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,819
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, left, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, left, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,820
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,821
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - bottom + top - (height - bottom + top - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,822
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,823
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); try { copy.setFont(DisplayUtils.BORDER_FONT); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); String label; // top int numTicks; int pixelLoc; if (topScaleMap != null) { numTicks = topScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + topScaleMap.getPixelLocation(i); if(topScaleMap.isMajorTick(i)) copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); else copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); label = topScaleMap.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if(pixelLoc + labelWidth < width){ copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength- fm.getLeading()); } } } copy.drawString(topScaleMap.getAxisLabel(), width/2, fontHeight); } // left if (leftScaleMap != null) { numTicks = leftScaleMap.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); } // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - leftScaleMap.getPixelLocation(i) - bottom; if (leftScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(insets.left -majorTickLength - insets.right, pixelLoc, insets.left - insets.right, pixelLoc)); } else { copy.draw(new Line2D.Float(insets.left - insets.right - minorTickLength, pixelLoc, insets.left - insets.right, pixelLoc)); } label = leftScaleMap.getLabel(i); if (label != null && label.length() != 0) { if(i == 0) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else if(i == numTicks - 1) copy.drawString(label, insets.left - insets.right - 45, pixelLoc + 5); else copy.drawString(label, insets.left - insets.right - 45, pixelLoc); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(leftScaleMap.getAxisLabel(), copy); } double yTranslate = height - (height - leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(leftScaleMap.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } // bottom if (bottomScaleMap != null) { numTicks = bottomScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + bottomScaleMap.getPixelLocation(i); if (bottomScaleMap.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } label = bottomScaleMap.getLabel(i); int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); if (label != null && label.length() != 0 && pixelLoc + labelWidth < width) { copy.drawString(label, pixelLoc - labelWidth/2, height-fm.getLeading()); } } } // right if (rightScaleMap != null) { numTicks = rightScaleMap.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - rightScaleMap.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); String label = rightScaleMap.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,824
|
public void setBottomScaleMapper(ScaleMapper scaleMap) { this.bottomScaleMap = scaleMap; bottom = 20; }
|
public void setBottomScaleMapper(ScaleMapper scaleMap) { this.bottomScaleMap = scaleMap; if(scaleMap.getAxisLabel() != null && !scaleMap.getAxisLabel().equals("")){ bottom = 20 + getFontHeight(scaleMap.getAxisLabel()); }else{ bottom = 20; } }
| 1,118,825
|
public void setLeftScaleMapper(ScaleMapper scaleMap) { this.leftScaleMap = scaleMap; if(scaleMap.getAxisLabel() != null && !scaleMap.getAxisLabel().equals("")){ LineMetrics lm = DisplayUtils.BORDER_FONT.getLineMetrics(scaleMap.getAxisLabel(), new FontRenderContext(IDENTITY_AFFINE, false, false)); fontHeight = (int)lm.getAscent(); left = 50 + fontHeight; }else{ left = 50; } }
|
public void setLeftScaleMapper(ScaleMapper scaleMap) { this.leftScaleMap = scaleMap; if(scaleMap.getAxisLabel() != null && !scaleMap.getAxisLabel().equals("")){ LineMetrics lm = DisplayUtils.BORDER_FONT.getLineMetrics(scaleMap.getAxisLabel(), new FontRenderContext(IDENTITY_AFFINE, false, false)); fontHeight = (int)lm.getAscent(); left = 50 + fontHeight; }else{ left = 50; } }
| 1,118,826
|
public void setTopScaleMapper(ScaleMapper scaleMap) { this.topScaleMap = scaleMap; if(scaleMap.getAxisLabel() != null && !scaleMap.getAxisLabel().equals("")){ LineMetrics lm = DisplayUtils.BORDER_FONT.getLineMetrics(scaleMap.getAxisLabel(), new FontRenderContext(IDENTITY_AFFINE, false, false)); fontHeight = (int)lm.getAscent(); top = 20 + fontHeight; }else{ top = 20; } }
|
public void setTopScaleMapper(ScaleMapper scaleMap) { this.topScaleMap = scaleMap; if(scaleMap.getAxisLabel() != null && !scaleMap.getAxisLabel().equals("")){ LineMetrics lm = DisplayUtils.BORDER_FONT.getLineMetrics(scaleMap.getAxisLabel(), new FontRenderContext(IDENTITY_AFFINE, false, false)); fontHeight = (int)lm.getAscent(); top = 20 + fontHeight; }else{ top = 20; } }
| 1,118,827
|
public CalintfHelper(Calintf cal, AccessUtil access, BwUser user, int currentMode, boolean ignoreCreator, boolean debug) { this.cal = cal; this.access = access; this.user = user; this.currentMode = currentMode; this.ignoreCreator = ignoreCreator; this.debug = debug; }
|
public CalintfHelper(Calintf cal, AccessUtil access, int currentMode, boolean ignoreCreator, boolean debug) { this.cal = cal; this.access = access; this.user = user; this.currentMode = currentMode; this.ignoreCreator = ignoreCreator; this.debug = debug; }
| 1,118,828
|
public CalintfHelper(Calintf cal, AccessUtil access, BwUser user, int currentMode, boolean ignoreCreator, boolean debug) { this.cal = cal; this.access = access; this.user = user; this.currentMode = currentMode; this.ignoreCreator = ignoreCreator; this.debug = debug; }
|
public CalintfHelper(Calintf cal, AccessUtil access, BwUser user, int currentMode, boolean ignoreCreator, boolean debug) { this.cal = cal; this.access = access; this.currentMode = currentMode; this.ignoreCreator = ignoreCreator; this.debug = debug; }
| 1,118,829
|
public void saveSeismogramToDatabase(ChannelId channelId, LocalSeismogramImpl seis, String fileLocation, SeismogramFileTypes filetype) throws SQLException { // Get absolute file path out of the file path given File seismogramFile = new File(fileLocation); String absoluteFilePath = seismogramFile.getPath(); insert.setInt(1, chanTable.put(channelId)); insert.setInt(2, timeTable.put(seis.getBeginTime().getFissuresTime())); insert.setInt(3, timeTable.put(seis.getEndTime().getFissuresTime())); insert.setString(4, absoluteFilePath); insert.setInt(5, filetype.getIntValue()); insert.executeUpdate(); }
|
public void saveSeismogramToDatabase(ChannelId channelId, LocalSeismogramImpl seis, String fileLocation, SeismogramFileTypes filetype) throws SQLException, IOException { int channel_id = chanTable.put(channelId); int begin_time_id = timeTable.put(seis.getBeginTime().getFissuresTime()); int end_time_id = timeTable.put(seis.getEndTime().getFissuresTime()); // Get absolute file path out of the file path given File seismogramFile = new File(fileLocation); String absoluteFilePath = seismogramFile.getPath(); insert.setInt(1, chanTable.put(channelId)); insert.setInt(2, timeTable.put(seis.getBeginTime().getFissuresTime())); insert.setInt(3, timeTable.put(seis.getEndTime().getFissuresTime())); insert.setString(4, absoluteFilePath); insert.setInt(5, filetype.getIntValue()); insert.executeUpdate(); }
| 1,118,830
|
public void saveSeismogramToDatabase(ChannelId channelId, LocalSeismogramImpl seis, String fileLocation, SeismogramFileTypes filetype) throws SQLException { // Get absolute file path out of the file path given File seismogramFile = new File(fileLocation); String absoluteFilePath = seismogramFile.getPath(); insert.setInt(1, chanTable.put(channelId)); insert.setInt(2, timeTable.put(seis.getBeginTime().getFissuresTime())); insert.setInt(3, timeTable.put(seis.getEndTime().getFissuresTime())); insert.setString(4, absoluteFilePath); insert.setInt(5, filetype.getIntValue()); insert.executeUpdate(); }
|
public void saveSeismogramToDatabase(ChannelId channelId, LocalSeismogramImpl seis, String fileLocation, SeismogramFileTypes filetype) throws SQLException { // Get absolute file path out of the file path given File seismogramFile = new File(fileLocation); String absoluteFilePath = seismogramFile.getPath(); insert.setInt(1, chanTable.put(channelId)); insert.setInt(2, timeTable.put(seis.getBeginTime().getFissuresTime())); insert.setInt(3, timeTable.put(seis.getEndTime().getFissuresTime())); insert.setString(4, absoluteFilePath); insert.setInt(5, filetype.getIntValue()); insert.executeUpdate(); }
| 1,118,831
|
public RT130ToLocalSeismogram() { this.ncFile = null; this.stationLocations = null; }
|
public RT130ToLocalSeismogram() { this.ncFile = null; this.stationLocations = null; }
| 1,118,832
|
public void reset(){ Iterator e = ampData.keySet().iterator(); while(e.hasNext()){ ((AmpConfigData)e.next()).reset(); } fireAmpEvent(); }
|
public void reset(){ Iterator e = ampData.keySet().iterator(); while(e.hasNext()){ ((AmpConfigData)e.next()).reset(); } fireAmpEvent(); }
| 1,118,833
|
public synchronized void stop() { if (player != null) { player.stop(); } }
|
public synchronized void stop() { if (player != null) { player.close(); player = null; } }
| 1,118,834
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.assignAddingLocation(true); return "continue"; }
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ initFields(form); form.assignAddingLocation(true); return "continue"; }
| 1,118,838
|
private BwCalendar cloneAndCheckOne(BwCalendar subroot, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { CurrentAccess ca = access.checkAccess(subroot, desiredAccess, nullForNoAccess); if (!ca.accessAllowed) { return null; } BwCalendar cal = (BwCalendar)subroot.clone(); // XXX Temp fix - add id to the clone cal.setId(subroot.getId()); cal.setCurrentAccess(ca); Iterator it = subroot.iterateChildren(); while (it.hasNext()) { BwCalendar child = (BwCalendar)it.next(); child = cloneAndCheckOne(child, desiredAccess, nullForNoAccess); if (child != null) { cal.addChild(child); } } return cal; }
|
private BwCalendar cloneAndCheckOne(BwCalendar subroot, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { CurrentAccess ca = access.checkAccess(subroot, desiredAccess, nullForNoAccess); if (!ca.accessAllowed) { return null; } BwCalendar cal = (BwCalendar)subroot.shallowClone(); // XXX Temp fix - add id to the clone cal.setId(subroot.getId()); cal.setCurrentAccess(ca); Iterator it = subroot.iterateChildren(); while (it.hasNext()) { BwCalendar child = (BwCalendar)it.next(); child = cloneAndCheckOne(child, desiredAccess, nullForNoAccess); if (child != null) { cal.addChild(child); } } return cal; }
| 1,118,839
|
public MicroSecondTimeRange(MicroSecondDate time, MicroSecondDate anotherTime){ if(time.before(anotherTime){ this.beginTime = time; this.endTime = anotherTime; }else{
|
public MicroSecondTimeRange(MicroSecondDate time, MicroSecondDate anotherTime){ if(time.before(anotherTime)){ this.beginTime = time; this.endTime = anotherTime; }else{
| 1,118,840
|
public CalSvcTestWrapper(String user, int access, boolean publicEvents, boolean debug) throws Throwable { super(); //this.debug = debug; isPublic = publicEvents; this.user = user; CalSvcIPars pars = new CalSvcIPars(user, access, user, publicEvents, false, // caldav null, // synch debug); init(pars); }
|
public CalSvcTestWrapper(String user, int access, boolean publicEvents, boolean debug) throws Throwable { super(); //this.debug = debug; isPublic = publicEvents; this.user = user; CalSvcIPars pars = new CalSvcIPars(user, access, user, envPrefix, publicEvents, false, // caldav null, // synch debug); init(pars); }
| 1,118,842
|
public void copyTo(BwShareableContainedDbentity val) { super.copyTo(val); val.setCalendar((BwCalendar)getCalendar().clone()); }
|
public void copyTo(BwShareableContainedDbentity val) { super.copyTo(val); val.setCalendar((BwCalendar)getCalendar().shallowClone()); }
| 1,118,843
|
public static IslamicChronology getInstance(DateTimeZone zone) { return getInstance(zone, LEAP_YEAR_16_BASED); }
|
public static IslamicChronology getInstance(DateTimeZone zone) { return getInstance(zone, LEAP_YEAR_16_BASED); }
| 1,118,845
|
private String tryCal(HttpServletRequest request, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String url = getReqPar(request, "calUrl"); if (url == null) { return null; } BwCalendar cal = findCalendar(url, form); if (cal == null) { form.getErr().emit("org.bedework.client.error.unknowncalendar"); return "notFound"; } BwSubscription sub = BwSubscription.makeSubscription(cal); Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.assignCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeCalendar); form.refreshIsNeeded(); return "success"; }
|
private String tryCal(HttpServletRequest request, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String url = getReqPar(request, "calUrl"); if (url == null) { return null; } BwCalendar cal = findCalendar(url, form); if (cal == null) { form.getErr().emit("org.bedework.client.error.unknowncalendar"); return "notFound"; } BwSubscription sub = BwSubscription.makeSubscription(cal); Collection c = new ArrayList(); c.add(sub); svci.setCurrentSubscriptions(c); form.assignCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeCalendar); form.refreshIsNeeded(); return "success"; }
| 1,118,846
|
private String trySub(HttpServletRequest request, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String name = getReqPar(request, "subname"); if (name == null) { return null; } BwSubscription sub = svci.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.error.unknownsubscription"); return "notFound"; } Collection c = new Vector(); c.add(sub.clone()); svci.setCurrentSubscriptions(c); form.assignCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeSubscription); form.refreshIsNeeded(); return "success"; }
|
private String trySub(HttpServletRequest request, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String name = getReqPar(request, "subname"); if (name == null) { return null; } BwSubscription sub = svci.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.error.unknownsubscription"); return "notFound"; } Collection c = new ArrayList(); c.add(sub.clone()); svci.setCurrentSubscriptions(c); form.assignCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeSubscription); form.refreshIsNeeded(); return "success"; }
| 1,118,847
|
protected static int[][] compressYvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, config, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][]; int pixels = size.width; int numValuesperPixel = uncomp[0].length/size.width; comp[0] = new int[2*pixels]; comp[1] = new int[2*pixels]; int j=0, i, startIndex, endIndex; int xvalue; startIndex = 0; xvalue = 0; for(i = 0, j = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i-1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][i]; comp[0][j+1] = uncomp[0][i]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } return comp; }
|
protected static int[][] compressYvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, config, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][]; int pixels = size.width; int numValuesperPixel = uncomp[0].length/size.width; comp[0] = new int[2*pixels]; comp[1] = new int[2*pixels]; int j=0, i, startIndex, endIndex; int xvalue; startIndex = 0; xvalue = 0; for(i = 0, j = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i-1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][i]; comp[0][j+1] = uncomp[0][i]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } return comp; }
| 1,118,848
|
protected static int[][] compressYvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, config, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][]; int pixels = size.width; int numValuesperPixel = uncomp[0].length/size.width; comp[0] = new int[2*pixels]; comp[1] = new int[2*pixels]; int j=0, i, startIndex, endIndex; int xvalue; startIndex = 0; xvalue = 0; for(i = 0, j = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i-1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][i]; comp[0][j+1] = uncomp[0][i]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } return comp; }
|
protected static int[][] compressYvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, config, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][]; int pixels = size.width; int numValuesperPixel = uncomp[0].length/size.width; comp[0] = new int[2*pixels]; comp[1] = new int[2*pixels]; int j=0, i, startIndex, endIndex; int xvalue; startIndex = 0; xvalue = 0; for(i = 0, j = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i-1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][i]; comp[0][j+1] = uncomp[0][i]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } return comp; }
| 1,118,849
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase frm) throws Throwable { PEActionForm form = (PEActionForm)frm; /* CalEnv env = getEnv(frm); / * Set some options from the environment * / form.setAutoCreateSponsors(env.getAppBoolProperty("app.autocreatesponsors")); form.setAutoCreateLocations(env.getAppBoolProperty("app.autocreatelocations")); form.setAutoDeleteSponsors(env.getAppBoolProperty("app.autodeletesponsors")); form.setAutoDeleteLocations(env.getAppBoolProperty("app.autodeletelocations")); if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } / ** Show the owner we are administering * / form.setAdminUserId(form.getCalSvcI().getUser().getAccount()); if (debug) { logIt("-------- isSuperUser: " + form.getUserAuth().isSuperUser()); } if (!form.getAuthorisedUser()) { return "noAccess"; } String temp = checkGroup(request, form, true); if (temp != null) { if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } return temp; } / ** Ensure we have prefs and other values for the AuthUser * / setAuthUser(form); String reqpar = request.getParameter("cancelled"); if (reqpar != null) { / ** Set the objects to null so we get new ones. * / form.initFields(); form.setEvent(null); form.getMsg().emit("org.bedework.message.cancelled"); return "cancelled"; } */ return doAction(request, sess, form); }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase frm) throws Throwable { PEActionForm form = (PEActionForm)frm; /* CalEnv env = getEnv(frm); / * Set some options from the environment * / form.setAutoCreateSponsors(env.getAppBoolProperty("app.autocreatesponsors")); form.setAutoCreateLocations(env.getAppBoolProperty("app.autocreatelocations")); form.setAutoDeleteSponsors(env.getAppBoolProperty("app.autodeletesponsors")); form.setAutoDeleteLocations(env.getAppBoolProperty("app.autodeletelocations")); if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } / ** Show the owner we are administering * / form.setAdminUserId(form.getCalSvcI().getUser().getAccount()); if (debug) { logIt("-------- isSuperUser: " + form.getUserAuth().isSuperUser()); } if (!form.getAuthorisedUser()) { return "noAccess"; } String temp = checkGroup(request, form, true); if (temp != null) { if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } return temp; } / ** Ensure we have prefs and other values for the AuthUser * / setAuthUser(form); String reqpar = request.getParameter("cancelled"); if (reqpar != null) { / ** Set the objects to null so we get new ones. * / form.initFields(); form.setEvent(null); form.getMsg().emit("org.bedework.client.message.cancelled"); return "cancelled"; } */ return doAction(request, sess, form); }
| 1,118,850
|
public DataRecord getNextRecord() throws SeedFormatException, IOException { if (current == null) { throw new EOFException("Cannot read past end of file list"); } try { DataRecord d = current.getNextRecord(); numReadTotal++; return d; } catch (EOFException e) { // try next file logger.debug("Loading next mseed file: "+files[currentIndex].getName()); initNextFile(); DataRecord d = current.getNextRecord(); numReadTotal++; return d; } }
|
public DataRecord getNextRecord() throws SeedFormatException, IOException { if (current == null) { throw new EOFException("Cannot read past end of file list"); } try { DataRecord d = current.getNextRecord(); numReadTotal++; return d; } catch (EOFException e) { // try next file initNextFile(); DataRecord d = current.getNextRecord(); numReadTotal++; return d; } }
| 1,118,851
|
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.Stereotype2EditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } }
|
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(Stereotype2EditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } }
| 1,118,853
|
public Selection (MicroSecondTimeRange range, SeismogramDisplay parent, Color color){ // tc needs to be the same class as the parents time config incase it is a relative time config Class dispTimeConfigClass = parent.getTimeConfig().getClass(); if(parent.getTimeConfig() instanceof RTTimeRangeConfig){ dispTimeConfigClass = ((RTTimeRangeConfig)parent.getTimeConfig()).getInternalConfig().getClass(); } try { tc = (TimeConfig)dispTimeConfigClass.newInstance(); } catch (IllegalAccessException e) { GlobalExceptionHandler.handleStatic("Problem trying to create new TimeCongig for pick zone", e); } catch (InstantiationException e) { GlobalExceptionHandler.handleStatic("Problem trying to create new TimeCongig for pick zone", e); } seismos = parent.getSeismograms(); this.parent = parent; this.color = color; tc.addListener(this); tc.add(seismos); setBegin(range.getBeginTime()); setInterval(range.getInterval()); parent.repaint(); }
|
public Selection (MicroSecondTimeRange range, SeismogramDisplay parent, Color color){ // tc needs to be the same class as the parents time config incase it is a relative time config Class dispTimeConfigClass = parent.getTimeConfig().getClass(); if(parent.getTimeConfig() instanceof RTTimeRangeConfig){ dispTimeConfigClass = ((RTTimeRangeConfig)parent.getTimeConfig()).getInternalConfig().getClass(); } try { tc = (TimeConfig)dispTimeConfigClass.newInstance(); } catch (IllegalAccessException e) { GlobalExceptionHandler.handleStatic("Problem trying to create new TimeCongig for pick zone", e); } catch (InstantiationException e) { GlobalExceptionHandler.handleStatic("Problem trying to create new TimeCongig for pick zone", e); } seismos = parent.getSeismograms(); this.parent = parent; this.color = color; tc.addListener(this); tc.add(seismos); setBegin(range.getBeginTime()); setInterval(range.getInterval()); parent.repaint(); }
| 1,118,854
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { CalSvcI svci = form.getCalSvcI(); boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } form.assignAddingEvent(false); /** User requested an event from the list. Retrieve it, embed it in * the form so we can display the page */ int id = form.getEventId(); if (id <= 0) { return "notFound"; } EventInfo einf = svci.getEvent(id); if (debug) { if (einf == null) { log.debug("No event with id " + id); } else { log.debug("Retrieved event " + einf.getEvent().getId()); log.debug(" start=" + einf.getEvent().getDtstart()); } } /** ************************************ We should ensure the alert status is correct ********************************* */ form.setEventInfo(einf); if (einf == null) { form.getErr().emit("org.bedework.pubevents.error.nosuchevent", id); return "notFound"; } return "continue"; }
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { CalSvcI svci = form.getCalSvcI(); boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } form.assignAddingEvent(false); /** User requested an event from the list. Retrieve it, embed it in * the form so we can display the page */ int id = form.getEventId(); if (id <= 0) { return "notFound"; } EventInfo einf = svci.getEvent(id); if (debug) { if (einf == null) { log.debug("No event with id " + id); } else { log.debug("Retrieved event " + einf.getEvent().getId()); log.debug(" start=" + einf.getEvent().getDtstart()); } } /** ************************************ We should ensure the alert status is correct ********************************* */ form.setEventInfo(einf); if (einf == null) { form.getErr().emit("org.bedework.client.error.nosuchevent", id); return "notFound"; } return "continue"; }
| 1,118,856
|
public boolean equals(Object o){ if(o == this){ return true; } else if (getEventAccess() != null && o instanceof CacheEvent && ((CacheEvent)o).getEventAccess() != null) { return getEventAccess().equals(((CacheEvent)o).getEventAccess()); }else if(o instanceof EventAccessOperations){ EventAccessOperations oEvent = (EventAccessOperations)o; if(get_attributes().equals(oEvent.get_attributes())){ Origin thisOrigin = getOrigin(); if(thisOrigin == null && thisOrigin == extractOrigin(oEvent)){ return true; }else if(thisOrigin.equals(extractOrigin(oEvent))){ return true; } } } return false; }
|
public boolean equals(Object o){ if(o == this){ return true; } else if (getEventAccess() != null && o instanceof CacheEvent && ((CacheEvent)o).getEventAccess() != null) { return getEventAccess().equals(((CacheEvent)o).getEventAccess()); }else if(o instanceof EventAccessOperations){ EventAccessOperations oEvent = (EventAccessOperations)o; if(get_attributes().equals(oEvent.get_attributes())){ Origin thisOrigin = getOrigin(); if(thisOrigin == null && thisOrigin == extractOrigin(oEvent)){ return true; }else if(thisOrigin.equals(extractOrigin(oEvent))){ return true; } } } return false; }
| 1,118,857
|
public Collection getFreeBusy(InputStreamReader in) throws Throwable { return trans.fromIcal(null, in); }
|
public Collection getFreeBusy(Reader in) throws Throwable { return trans.fromIcal(null, in); }
| 1,118,858
|
public void decode(char[] val) throws AccessException { TreeSet ts = new TreeSet(); setEncoded(val); if (empty()) { defaultAccess(); } else { while (hasMore()) { Ace ace = new Ace(); ace.decode(this, true); ts.add(ace); } aces = ts; } }
|
public void decode(char[] val) throws AccessException { TreeSet ts = new TreeSet(); setEncoded(val); if (empty()) { defaultAccess(); } else { while (hasMore()) { Ace ace = new Ace(); ace.decode(this, true); ts.add(ace); } aces = ts; } }
| 1,118,859
|
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { if (form.getGuest()) { // Just ignore this return "doNothing"; } String reqpar = request.getParameter("updateLocation"); if (reqpar != null) { return updateLocation(request, form); } int locationId = form.getLocationId(); if (locationId <= 0) { // Do nothing return "doNothing"; } BwLocation loc = form.getCalSvcI().getLocation(locationId); if (loc == null) { return "doNothing"; } if (loc.getPublick()) { form.getErr().emit("org.bedework.error.noaccess", "for that action"); return "doNothing"; } form.setEditLocation(loc); return "edit"; }
|
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { if (form.getGuest()) { // Just ignore this return "doNothing"; } String reqpar = request.getParameter("updateLocation"); if (reqpar != null) { return updateLocation(request, form); } int locationId = form.getLocationId(); if (locationId <= 0) { // Do nothing return "doNothing"; } BwLocation loc = form.getCalSvcI().getLocation(locationId); if (loc == null) { return "doNothing"; } if (loc.getPublick()) { form.getErr().emit("org.bedework.client.error.noaccess", "for that action"); return "doNothing"; } form.setEditLocation(loc); return "edit"; }
| 1,118,860
|
private boolean setAmpRange(DataSetSeismogram seismo){ AmpConfigData data = (AmpConfigData)ampData.get(seismo); LocalSeismogramImpl seis = (LocalSeismogramImpl)seismo.getSeismogram(); int[] seisIndex = DisplayUtils.getSeisPoints(seis, data.getTime()); if(seisIndex[0] == seisIndex[1]) { //no data points in window, set range to 0 data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seis.getNumPoints()){ seisIndex[1] = seis.getNumPoints() -1; } double[] minMaxMean = ((Statistics)DisplayUtils.statCache.get(seismo)).minMaxMean(seisIndex[0], seisIndex[1]); double meanDiff = (Math.abs(minMaxMean[2] - minMaxMean[0]) > Math.abs(minMaxMean[2] - minMaxMean[1]) ? Math.abs(minMaxMean[2] - minMaxMean[0]) : Math.abs(minMaxMean[2] - minMaxMean[1])); data.setCalcIndex(seisIndex); return data.setCleanRange(new UnitRangeImpl(minMaxMean[2] - meanDiff, minMaxMean[2] + meanDiff, UnitImpl.COUNT)); }
|
private boolean setAmpRange(DataSetSeismogram seismo){ AmpConfigData data = (AmpConfigData)ampData.get(seismo); LocalSeismogramImpl seis = (LocalSeismogramImpl)seismo.getSeismogram(); int[] seisIndex = DisplayUtils.getSeisPoints(seis, data.getTime()); if(seisIndex[1] < 0 || seisIndex[0] >= seis.getNumPoints()) { //no data points in window, set range to 0 data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seis.getNumPoints()){ seisIndex[1] = seis.getNumPoints() -1; } double[] minMaxMean = ((Statistics)DisplayUtils.statCache.get(seismo)).minMaxMean(seisIndex[0], seisIndex[1]); double meanDiff = (Math.abs(minMaxMean[2] - minMaxMean[0]) > Math.abs(minMaxMean[2] - minMaxMean[1]) ? Math.abs(minMaxMean[2] - minMaxMean[0]) : Math.abs(minMaxMean[2] - minMaxMean[1])); data.setCalcIndex(seisIndex); return data.setCleanRange(new UnitRangeImpl(minMaxMean[2] - meanDiff, minMaxMean[2] + meanDiff, UnitImpl.COUNT)); }
| 1,118,861
|
private boolean setAmpRange(DataSetSeismogram seismo){ AmpConfigData data = (AmpConfigData)ampData.get(seismo); LocalSeismogramImpl seis = (LocalSeismogramImpl)seismo.getSeismogram(); int[] seisIndex = DisplayUtils.getSeisPoints(seis, data.getTime()); if(seisIndex[0] == seisIndex[1]) { //no data points in window, set range to 0 data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seis.getNumPoints()){ seisIndex[1] = seis.getNumPoints() -1; } double[] minMaxMean = ((Statistics)DisplayUtils.statCache.get(seismo)).minMaxMean(seisIndex[0], seisIndex[1]); double meanDiff = (Math.abs(minMaxMean[2] - minMaxMean[0]) > Math.abs(minMaxMean[2] - minMaxMean[1]) ? Math.abs(minMaxMean[2] - minMaxMean[0]) : Math.abs(minMaxMean[2] - minMaxMean[1])); data.setCalcIndex(seisIndex); return data.setCleanRange(new UnitRangeImpl(minMaxMean[2] - meanDiff, minMaxMean[2] + meanDiff, UnitImpl.COUNT)); }
|
private boolean setAmpRange(DataSetSeismogram seismo){ AmpConfigData data = (AmpConfigData)ampData.get(seismo); LocalSeismogramImpl seis = (LocalSeismogramImpl)seismo.getSeismogram(); int[] seisIndex = DisplayUtils.getSeisPoints(seis, data.getTime()); if(seisIndex[0] == seisIndex[1]) { //no data points in window, set range to 0 data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seis.getNumPoints()){ seisIndex[1] = seis.getNumPoints() -1; } double[] minMaxMean = ((Statistics)DisplayUtils.statCache.get(seismo)).minMaxMean(seisIndex[0], seisIndex[1]); double meanDiff = (Math.abs(minMaxMean[2] - minMaxMean[0]) > Math.abs(minMaxMean[2] - minMaxMean[1]) ? Math.abs(minMaxMean[2] - minMaxMean[0]) : Math.abs(minMaxMean[2] - minMaxMean[1])); data.setCalcIndex(seisIndex); return data.setCleanRange(new UnitRangeImpl(minMaxMean[2] - meanDiff, minMaxMean[2] + meanDiff, UnitImpl.COUNT)); }
| 1,118,862
|
private boolean setAmpRange(DataSetSeismogram seismo){ AmpConfigData data = (AmpConfigData)ampData.get(seismo); LocalSeismogramImpl seis = (LocalSeismogramImpl)seismo.getSeismogram(); int[] seisIndex = DisplayUtils.getSeisPoints(seis, data.getTime()); if(seisIndex[0] == seisIndex[1]) { //no data points in window, set range to 0 data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seis.getNumPoints()){ seisIndex[1] = seis.getNumPoints() -1; } double[] minMaxMean = ((Statistics)DisplayUtils.statCache.get(seismo)).minMaxMean(seisIndex[0], seisIndex[1]); double meanDiff = (Math.abs(minMaxMean[2] - minMaxMean[0]) > Math.abs(minMaxMean[2] - minMaxMean[1]) ? Math.abs(minMaxMean[2] - minMaxMean[0]) : Math.abs(minMaxMean[2] - minMaxMean[1])); data.setCalcIndex(seisIndex); return data.setCleanRange(new UnitRangeImpl(minMaxMean[2] - meanDiff, minMaxMean[2] + meanDiff, UnitImpl.COUNT)); }
|
private boolean setAmpRange(DataSetSeismogram seismo){ AmpConfigData data = (AmpConfigData)ampData.get(seismo); LocalSeismogramImpl seis = (LocalSeismogramImpl)seismo.getSeismogram(); int[] seisIndex = DisplayUtils.getSeisPoints(seis, data.getTime()); if(seisIndex[0] == seisIndex[1]) { //no data points in window, set range to 0 data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seis.getNumPoints()){ seisIndex[1] = seis.getNumPoints() -1; } double[] minMaxMean = ((Statistics)DisplayUtils.statCache.get(seismo)).minMaxMean(seisIndex[0], seisIndex[1]); double meanDiff = (Math.abs(minMaxMean[2] - minMaxMean[0]) > Math.abs(minMaxMean[2] - minMaxMean[1]) ? Math.abs(minMaxMean[2] - minMaxMean[0]) : Math.abs(minMaxMean[2] - minMaxMean[1])); data.setCalcIndex(seisIndex); double min = minMaxMean[2] - meanDiff; double max = minMaxMean[2] + meanDiff; System.out.println(seismo + " amp range: " + min + ", " + max + " Points: " + seisIndex[0] + ", " + seisIndex[1]); return data.setCleanRange(new UnitRangeImpl(min, max, UnitImpl.COUNT)); }
| 1,118,863
|
public ATObject base_setValue(ATObject newValue) throws NATException { ATObject result = base_getFieldValue(); frame_.meta_assignField(name_, newValue); return result; }
|
public ATObject base_setValue(ATObject newValue) throws NATException { ATObject result = base_getValue(); frame_.meta_assignField(name_, newValue); return result; }
| 1,118,864
|
public ActionForward resetSubProjPkgOptions( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaActionForm dynaForm = (DynaActionForm) form; String projectId = ((String) dynaForm.get(UMLBrowserFormConstants.PROJECT_IDSEQ)).trim(); if (projectId == null || projectId.length() == 0) { setSessionObject(request, UMLBrowserFormConstants.SUBPROJECT_OPTIONS, getSessionObject(request, UMLBrowserFormConstants.ALL_SUBPROJECTS ),true); setSessionObject(request, UMLBrowserFormConstants.PACKAGE_OPTIONS, getSessionObject(request, UMLBrowserFormConstants.ALL_PACKAGES ),true); } else { Project project = setPackageOptionsForProjectId(request, projectId); if (project != null ){ setSessionObject(request, UMLBrowserFormConstants.SUBPROJECT_OPTIONS, project.getSubProjectCollection(), true); } } String showClass=(String) getSessionObject(request, UMLBrowserFormConstants.CLASS_VIEW); if (showClass == null || showClass.equalsIgnoreCase("true")) return mapping.findForward("umlSearch"); return mapping.findForward("showAttributes"); }
|
public ActionForward resetSubProjPkgOptions( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaActionForm dynaForm = (DynaActionForm) form; String projectId = ((String) dynaForm.get(UMLBrowserFormConstants.PROJECT_IDSEQ)).trim(); if (projectId == null || projectId.length() == 0) { setSessionObject(request, UMLBrowserFormConstants.SUBPROJECT_OPTIONS, getSessionObject(request, UMLBrowserFormConstants.ALL_SUBPROJECTS ),true); setSessionObject(request, UMLBrowserFormConstants.PACKAGE_OPTIONS, getSessionObject(request, UMLBrowserFormConstants.ALL_PACKAGES ),true); } else { Project project = setPackageOptionsForProjectId(request, projectId); if (project != null ){ setSessionObject(request, UMLBrowserFormConstants.SUBPROJECT_OPTIONS, project.getSubProjectCollection(), true); } } Object classView = getSessionObject(request, UMLBrowserFormConstants.CLASS_VIEW); String showClass = null; if (classView != null) showClass=classView.toString(); if (showClass == null || showClass.equalsIgnoreCase("true")) return mapping.findForward("umlSearch"); return mapping.findForward("showAttributes"); }
| 1,118,865
|
public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } synchronized(omgraphics){ Iterator it = omgraphics.iterator(); List stationsUnderMouse = new ArrayList(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() == 1){ synchronized(chooser){ chooser.toggleStationSelected((Station)stationsUnderMouse.get(0)); } } else{ final JPopupMenu popup = new JPopupMenu(); it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { synchronized(chooser){ chooser.toggleStationSelected(current); } popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } return true; } } return false; }
|
public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } synchronized(omgraphics){ Iterator it = omgraphics.iterator(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() == 1){ synchronized(chooser){ chooser.toggleStationSelected((Station)stationsUnderMouse.get(0)); } } else{ final JPopupMenu popup = new JPopupMenu(); it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { synchronized(chooser){ chooser.toggleStationSelected(current); } popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } return true; } } return false; }
| 1,118,866
|
public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } synchronized(omgraphics){ Iterator it = omgraphics.iterator(); List stationsUnderMouse = new ArrayList(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() == 1){ synchronized(chooser){ chooser.toggleStationSelected((Station)stationsUnderMouse.get(0)); } } else{ final JPopupMenu popup = new JPopupMenu(); it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { synchronized(chooser){ chooser.toggleStationSelected(current); } popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } return true; } } return false; }
|
public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } synchronized(omgraphics){ Iterator it = omgraphics.iterator(); List stationsUnderMouse = new ArrayList(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() == 1){ synchronized(chooser){ chooser.toggleStationSelected((Station)stationsUnderMouse.get(0)); } } else{ final JPopupMenu popup = new JPopupMenu(); it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { synchronized(chooser){ chooser.toggleStationSelected(current); } popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } return true; } } return false; }
| 1,118,867
|
public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } synchronized(omgraphics){ Iterator it = omgraphics.iterator(); List stationsUnderMouse = new ArrayList(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() == 1){ synchronized(chooser){ chooser.toggleStationSelected((Station)stationsUnderMouse.get(0)); } } else{ final JPopupMenu popup = new JPopupMenu(); it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { synchronized(chooser){ chooser.toggleStationSelected(current); } popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } return true; } } return false; }
|
public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } synchronized(omgraphics){ Iterator it = omgraphics.iterator(); List stationsUnderMouse = new ArrayList(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() == 1){ synchronized(chooser){ chooser.toggleStationSelected((Station)stationsUnderMouse.get(0)); } } else{ final JPopupMenu popup = new JPopupMenu(); it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { synchronized(chooser){ chooser.toggleStationSelected(current); } popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } return true; } } return false; }
| 1,118,868
|
public void actionPerformed(ActionEvent e) { synchronized(chooser){ chooser.toggleStationSelected(current); } popup.setVisible(false); }
|
public void actionPerformed(ActionEvent e) { synchronized(chooser){ chooser.toggleStationSelected(current); } popup.setVisible(false); }
| 1,118,870
|
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { if (form.getGuest()) { // Just ignore this return "doNothing"; } BwEvent ev = form.getNewEvent(); if (ev == null) { return "doNothing"; } CalSvcI svci = form.fetchSvci(); if (ev.getCalendar() == null) { // Set the default calendar ev.setCalendar(svci.getPreferredCalendar()); } if (!form.getEventDates().updateEvent(ev, svci.getTimezones()) || !BwWebUtil.validateEvent(svci, ev, false, // descriptionRequired form.getErr())) { return "doNothing"; } /** We might also need to add a location - for private events we don't * require a location */ BwLocation loc = null; if (form.getLocationId() != CalFacadeDefs.defaultLocationId) { loc = svci.getLocation(form.getLocationId()); } if (loc == null) { loc = form.getNewLocation(); } if (loc.getAddress() != null) { /* Location assigned */ BwLocation l = svci.ensureLocationExists(loc); boolean added = true; if (l != null) { loc = l; added = false; } ev.setLocation(loc); if (added) { form.getMsg().emit("org.bedework.client.message.locations.added", 1); } } else { ev.setLocation(null); } svci.addEvent(ev.getCalendar(), ev, null); form.resetNewEvent(); form.resetNewLocation(); form.getEventDates().setNewEvent(form.getNewEvent(), svci.getTimezones()); form.getMsg().emit("org.bedework.message.added.events", 1); form.refreshIsNeeded(); return "success"; }
|
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { if (form.getGuest()) { // Just ignore this return "doNothing"; } BwEvent ev = form.getNewEvent(); if (ev == null) { return "doNothing"; } CalSvcI svci = form.fetchSvci(); if (ev.getCalendar() == null) { // Set the default calendar ev.setCalendar(svci.getPreferredCalendar()); } if (!form.getEventDates().updateEvent(ev, svci.getTimezones()) || !BwWebUtil.validateEvent(svci, ev, false, // descriptionRequired form.getErr())) { return "doNothing"; } /** We might also need to add a location - for private events we don't * require a location */ BwLocation loc = null; if (form.getLocationId() != CalFacadeDefs.defaultLocationId) { loc = svci.getLocation(form.getLocationId()); } if (loc == null) { loc = form.getNewLocation(); } if (loc.getAddress() != null) { /* Location assigned */ BwLocation l = svci.ensureLocationExists(loc); boolean added = true; if (l != null) { loc = l; added = false; } ev.setLocation(loc); if (added) { form.getMsg().emit("org.bedework.client.message.locations.added", 1); } } else { ev.setLocation(null); } svci.addEvent(ev.getCalendar(), ev, null); form.resetNewEvent(); form.resetNewLocation(); form.getEventDates().setNewEvent(form.getNewEvent(), svci.getTimezones()); form.getMsg().emit("org.bedework.client.message.added.events", 1); form.refreshIsNeeded(); return "success"; }
| 1,118,871
|
public ATNil meta_assignField(ATSymbol name, ATObject value) throws NATException { String jSelector = null; try{ jSelector = Reflection.upMetaFieldMutationSelector(name); JavaInterfaceAdaptor.invokeJavaMethod( principal_.getClass(), principal_, jSelector, new ATObject[] { value.asMirror().base_getBase() }); } catch (XTypeMismatch e) { // Principal does not have a corresponding meta_level method // OR the passed value is not a mirror object // try for a base_level method of the mirror itself. return super.meta_assignField(name, value); } return NATNil._INSTANCE_; }
|
public ATNil meta_assignField(ATSymbol name, ATObject value) throws NATException { String jSelector = null; try{ jSelector = Reflection.upMetaFieldMutationSelector(name); JavaInterfaceAdaptor.invokeJavaMethod( principal_.getClass(), principal_, jSelector, new ATObject[] { value.asMirror().base_getBase() }); } catch (XSelectorNotFound e) { // Principal does not have a corresponding meta_level method // OR the passed value is not a mirror object // try for a base_level method of the mirror itself. return super.meta_assignField(name, value); } return NATNil._INSTANCE_; }
| 1,118,872
|
public ATObject meta_invoke(ATObject receiver, ATSymbol atSelector, ATTable arguments) throws NATException { String jSelector = Reflection.upMetaLevelSelector(atSelector); try { return NATMirrorFactory._INSTANCE_.base_createMirror( Reflection.downObject( Reflection.upInvocation( principal_, // implementor principal_, // self jSelector, arguments))); } catch (XTypeMismatch e) { // Principal does not have a corresponding meta_level method // try for a base_level method of the mirror itself. return super.meta_invoke(receiver, atSelector, arguments); } }
|
public ATObject meta_invoke(ATObject receiver, ATSymbol atSelector, ATTable arguments) throws NATException { String jSelector = Reflection.upMetaLevelSelector(atSelector); try { return NATMirrorFactory._INSTANCE_.base_createMirror( Reflection.downObject( Reflection.upInvocation( principal_, // implementor principal_, // self jSelector, arguments))); } catch (XSelectorNotFound e) { // Principal does not have a corresponding meta_level method // try for a base_level method of the mirror itself. return super.meta_invoke(receiver, atSelector, arguments); } }
| 1,118,873
|
public ATObject meta_select(ATObject receiver, ATSymbol atSelector) throws NATException { String jSelector = null; try { jSelector = Reflection.upMetaFieldAccessSelector(atSelector); return NATMirrorFactory._INSTANCE_.base_createMirror( Reflection.downObject( Reflection.upFieldSelection( principal_, principal_, jSelector))); } catch (XTypeMismatch e) { try { jSelector = Reflection.upMetaLevelSelector(atSelector); return NATMirrorFactory._INSTANCE_.base_createMirror( Reflection.downObject( Reflection.upMethodSelection( principal_, principal_, jSelector))); } catch (XSelectorNotFound e2) { // Principal does not have a corresponding meta_level field nor // method try for a base_level field or method of the mirror itself. return super.meta_select(receiver, atSelector); } } }
|
public ATObject meta_select(ATObject receiver, ATSymbol atSelector) throws NATException { String jSelector = null; try { jSelector = Reflection.upMetaFieldAccessSelector(atSelector); return NATMirrorFactory._INSTANCE_.base_createMirror( Reflection.downObject( Reflection.upFieldSelection( principal_, principal_, jSelector))); } catch (XSelectorNotFound e) { try { jSelector = Reflection.upMetaLevelSelector(atSelector); return NATMirrorFactory._INSTANCE_.base_createMirror( Reflection.downObject( Reflection.upMethodSelection( principal_, principal_, jSelector))); } catch (XSelectorNotFound e2) { // Principal does not have a corresponding meta_level field nor // method try for a base_level field or method of the mirror itself. return super.meta_select(receiver, atSelector); } } }
| 1,118,874
|
public boolean validate(MessageEmit err) { goodValue = true; if (!getShow()) { return true; } String val = getValue(); if (val != null) { // set as string val = val.toLowerCase(); if (val.equals("false") || val.equals("no")) { booleanVal = false; } else if (val.equals("true") || val.equals("yes")) { booleanVal = true; } else { err.emit("org.bedework.config.badvalue", getName(), getValue()); } } setValue(String.valueOf(booleanVal)); return goodValue; }
|
public boolean validate(MessageEmit err) { goodValue = true; if (!getShow()) { return true; } String val = getValue(); if (val != null) { // set as string val = val.toLowerCase(); if (val.equals("false") || val.equals("no")) { booleanVal = false; } else if (val.equals("true") || val.equals("yes")) { booleanVal = true; } else { err.emit("org.bedework.config.error.badvalue", getName(), getValue()); } } setValue(String.valueOf(booleanVal)); return goodValue; }
| 1,118,875
|
public void testQuotation() throws NATException { evalAndCompareTo("`(3)", atThree_); evalAndCompareTo("`(x)", atX_); evalAndCompareTo("`(def x := 3)", "def x := 3"); evalAndCompareTo("`(def x := `(3))", "def x := `(3)"); evalAndCompareTo("`(def x := #(3))", "def x := 3"); evalAndCompareTo("`(def foo(a) { #([1,2,3]) })", "def foo(a) { [1, 2, 3] }"); evalAndCompareTo("`(def foo(#@(`([a,b,c]))) { #@([1,2,3]) })", "def foo(a, b, c) { 1; 2; 3 }"); evalAndCompareTo("`(def foo: x bar: #@(`([y,z])) { 1 })", "def foo:bar:(x, y, z) { 1 }"); }
|
public void testQuotation() throws NATException { evalAndCompareTo("`(3)", atThree_); evalAndCompareTo("`(x)", atX_); evalAndCompareTo("`(def x := 3)", "def x := 3"); evalAndCompareTo("`(def x := `(3))", "def x := `(3)"); evalAndCompareTo("`(def x := #(3))", "def x := 3"); evalAndCompareTo("`(def foo(a) { #([1,2,3]) })", "def foo(a) { [1, 2, 3] }"); evalAndCompareTo("`(def foo(#@(`([a,b,c]))) { #@([1,2,3]) })", "def foo(a, b, c) { 1; 2; 3 }"); evalAndCompareTo("`(def foo: x bar: #@(`([y,z])) { 1 })", "def foo:bar:(x, y, z) { 1 }"); }
| 1,118,876
|
public void createParticleDisplay(BasicSeismogramDisplay creator, boolean advancedOption){ if(particleDisplay == null){ logger.debug("creating particle display"); particleWindow = new JFrame(particleWindowName); particleDisplay = new ParticleMotionDisplay((DataSetSeismogram)creator.getSeismograms().getFirst(), (TimeConfigRegistrar)creator.getTimeConfig(), creator.getAmpRegistrar(), creator.getAmpRegistrar(), advancedOption); JPanel displayPanel = new JPanel(); JButton zoomIn = new JButton("zoomIn"); JButton zoomOut = new JButton("zoomOut"); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); buttonPanel.add(zoomIn); buttonPanel.add(zoomOut); displayPanel.setLayout(new BorderLayout()); displayPanel.add(particleDisplay, java.awt.BorderLayout.CENTER); displayPanel.add(buttonPanel, java.awt.BorderLayout.SOUTH); java.awt.Dimension size = new java.awt.Dimension(400, 400); displayPanel.setSize(size); particleWindow.getContentPane().add(displayPanel); particleWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { particleWindow.dispose(); particleDisplay = null; } }); particleWindow.setSize(size); zoomIn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { particleDisplay.setZoomIn(true); // particleDisplay.setZoomOut(false); } }); zoomOut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { particleDisplay.setZoomOut(true); // particleDisplay.setZoomIn(false); } }); Toolkit tk = Toolkit.getDefaultToolkit(); if(particleWindow.getSize().width*particleDisplays < tk.getScreenSize().width){ particleWindow.setLocation(particleWindow.getSize().width * particleDisplays, tk.getScreenSize().height - particleWindow.getSize().width); }else{ particleWindow.setLocation(tk.getScreenSize().width - particleWindow.getSize().width, tk.getScreenSize().height - particleWindow.getSize().height); } particleDisplays++; particleWindow.setVisible(true); }else { particleDisplay.addParticleMotionDisplay((DataSetSeismogram)creator.getSeismograms().getFirst(), (TimeConfigRegistrar)creator.getTimeConfig(), creator.getAmpRegistrar(), creator.getAmpRegistrar()); } // end of else }
|
public void createParticleDisplay(BasicSeismogramDisplay creator, boolean advancedOption){ if(particleDisplay == null){ logger.debug("creating particle display"); particleWindow = new JFrame(particleWindowName); particleDisplay = new ParticleMotionDisplay((DataSetSeismogram)creator.getSeismograms().getFirst(), new TimeConfigRegistrar((TimeConfigRegistrar)creator.getTimeConfig()), creator.getAmpRegistrar(), creator.getAmpRegistrar(), advancedOption); JPanel displayPanel = new JPanel(); JButton zoomIn = new JButton("zoomIn"); JButton zoomOut = new JButton("zoomOut"); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); buttonPanel.add(zoomIn); buttonPanel.add(zoomOut); displayPanel.setLayout(new BorderLayout()); displayPanel.add(particleDisplay, java.awt.BorderLayout.CENTER); displayPanel.add(buttonPanel, java.awt.BorderLayout.SOUTH); java.awt.Dimension size = new java.awt.Dimension(400, 400); displayPanel.setSize(size); particleWindow.getContentPane().add(displayPanel); particleWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { particleWindow.dispose(); particleDisplay = null; } }); particleWindow.setSize(size); zoomIn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { particleDisplay.setZoomIn(true); // particleDisplay.setZoomOut(false); } }); zoomOut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { particleDisplay.setZoomOut(true); // particleDisplay.setZoomIn(false); } }); Toolkit tk = Toolkit.getDefaultToolkit(); if(particleWindow.getSize().width*particleDisplays < tk.getScreenSize().width){ particleWindow.setLocation(particleWindow.getSize().width * particleDisplays, tk.getScreenSize().height - particleWindow.getSize().width); }else{ particleWindow.setLocation(tk.getScreenSize().width - particleWindow.getSize().width, tk.getScreenSize().height - particleWindow.getSize().height); } particleDisplays++; particleWindow.setVisible(true); }else { particleDisplay.addParticleMotionDisplay((DataSetSeismogram)creator.getSeismograms().getFirst(), new TimeConfigRegistrar((TimeConfigRegistrar)creator.getTimeConfig()), creator.getAmpRegistrar(), creator.getAmpRegistrar()); } // end of else }
| 1,118,877
|
public void windowClosing(WindowEvent e) { particleWindow.dispose(); particleDisplay = null; }
|
public void windowClosing(WindowEvent e) { particleWindow.dispose(); particleDisplay = null; }
| 1,118,878
|
public void windowClosing(WindowEvent e) { threeSelectionDisplay.removeAll(); }
|
public void windowClosing(WindowEvent e) { selectionDisplay.removeAll(); }
| 1,118,879
|
public Synchml(String account, String deviceId, URIgen uriGen, boolean debug) throws CalFacadeException { svci = new CalSvc(); this.deviceId = deviceId; this.debug = debug; CalSvcIPars pars = new CalSvcIPars(account, UserAuth.noPrivileges, account, null, // XXX Requires an env prefix false, // public false, // caldav deviceId, // synchId debug); svci.init(pars); /** If we were limiting our view to a particular filter we would set that now. */ svci.open(); try { trans = new IcalTranslator(svci.getIcalCallback(), debug); synchInfo = svci.getSynchInfo(); if (synchInfo == null) { svci.beginTransaction(); synchInfo = new BwSynchInfo(); synchInfo.setUser(svci.getUser()); synchInfo.setDeviceId(deviceId); svci.addSynchInfo(synchInfo); svci.endTransaction(); } } finally { svci.close(); } }
|
public Synchml(String account, String deviceId, URIgen uriGen, boolean debug) throws CalFacadeException { svci = new CalSvc(); this.deviceId = deviceId; this.debug = debug; CalSvcIPars pars = new CalSvcIPars(account, account, null, // XXX Requires an env prefix false, // public false, // caldav deviceId, // synchId debug); svci.init(pars); /** If we were limiting our view to a particular filter we would set that now. */ svci.open(); try { trans = new IcalTranslator(svci.getIcalCallback(), debug); synchInfo = svci.getSynchInfo(); if (synchInfo == null) { svci.beginTransaction(); synchInfo = new BwSynchInfo(); synchInfo.setUser(svci.getUser()); synchInfo.setDeviceId(deviceId); svci.addSynchInfo(synchInfo); svci.endTransaction(); } } finally { svci.close(); } }
| 1,118,881
|
public void close() { try { close(svci); } catch (Throwable t) { } }
|
public void close() { try { trans.close(); } catch (Throwable t) { } }
| 1,118,882
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = infoset.getAll().iterator(); CalDavClient cd = new CalDavClient(debug); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
| 1,118,883
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { FBUserInfo ui = (FBUserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
| 1,118,884
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
| 1,118,885
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
| 1,118,886
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
| 1,118,887
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
| 1,118,888
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = resp.cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
| 1,118,889
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.getFreeBusy(new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
| 1,118,890
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.account)); resp.fbs.add(fb); } } } return responses; }
|
private Collection getFreeBusy(Date start, Date end) throws Throwable { ArrayList responses = new ArrayList(); Iterator it = uiList.iterator(); while (it.hasNext()) { UserInfo ui = (UserInfo)it.next(); Req r = makeFreeBusyRequest(start, end, ui); CaldavClientIo cio = getCio(ui.host, ui.port); Response resp = new Response(); resp.ui = ui; responses.add(resp); if (r.getAuth()) { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getUser(), r.getPw(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } else { resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), r.getHeaders(), 0, r.getContentType(), r.getContentLength(), r.getContentBytes()); } if (resp.responseCode != HttpServletResponse.SC_OK) { error("Got response " + resp.responseCode + " for account " + ui.account + ", host " + ui.host + " and url " + ui.url); continue; } CaldavResp cdresp = cio.getResponse(); /* We expect a VCALENDAR object containg VFREEBUSY components */ InputStream in = cdresp.getContentStream(); Collection fbs = trans.fromIcal(null, new InputStreamReader(in)); Iterator fbit = fbs.iterator(); while (fbit.hasNext()) { Object o = fbit.next(); if (o instanceof BwFreeBusy) { BwFreeBusy fb = (BwFreeBusy)o; fb.setWho(new BwUser(ui.getAccount())); resp.fbs.add(fb); } } } return responses; }
| 1,118,891
|
private void init() throws Throwable { /* addUser(new UserInfo("testuser01", "bedework", "douglm", "localhost", 8080, false, "/ucaldav/user/douglm")); addUser(new UserInfo("testuser01", "bedework", "johnsa", "localhost", 8080, false, "/ucaldav/user/johnsa")); */ /* addUser(new UserInfo("testuser02", "bedework", "testuser02", "www.bedework.org", 80, false, "/ucaldav/user/testuser02")); */ addUser(new UserInfo("douglm", "bedework", "douglm", "localhost", 8080, false, "/ucaldav/user/douglm"));/* addUser(new UserInfo("testuser02", "bedework", "testuser02", "www.bedework.org", 80, false, "/ucaldav/user/testuser02")); addUser(new UserInfo("testuser08", "bedework", "testuser08", "www.bedework.org", 80, false, "/ucaldav/user/testuser08"));*/ getSvci(); // }
|
private void init() throws Throwable { /* addUser(new UserInfo("testuser01", "bedework", "douglm", "localhost", 8080, false, "/ucaldav/user/douglm")); addUser(new UserInfo("testuser01", "bedework", "johnsa", "localhost", 8080, false, "/ucaldav/user/johnsa")); */ /* addUser(new UserInfo("testuser02", "bedework", "testuser02", "www.bedework.org", 80, false, "/ucaldav/user/testuser02")); */ addUser(new UserInfo("douglm", "bedework", "douglm", "localhost", 8080, false, "/ucaldav/user/douglm"));/* addUser(new UserInfo("testuser02", "bedework", "testuser02", "www.bedework.org", 80, false, "/ucaldav/user/testuser02")); addUser(new UserInfo("testuser08", "bedework", "testuser08", "www.bedework.org", 80, false, "/ucaldav/user/testuser08"));*/ getSvci(); // }
| 1,118,892
|
public static void main(String[] args) { FreeBusyAggregator fba = new FreeBusyAggregator(); try { fba.init(); Calendar cal = Calendar.getInstance(); cal.add(Calendar.WEEK_OF_YEAR, 1); Collection responses = fba.getFreeBusy(new Date(), cal.getTime()); fba.close(); Iterator it = responses.iterator(); while (it.hasNext()) { Response resp = (Response)it.next(); if (resp.responseCode != HttpServletResponse.SC_OK) { out("Response code for " + resp.ui.account + " = " + resp.responseCode); } else { } } } catch (Throwable t) { t.printStackTrace(); fba.error(t.getMessage()); } }
|
public static void main(String[] args) { FreeBusyAggregator fba = new FreeBusyAggregator(); try { fba.init(); Calendar cal = Calendar.getInstance(); cal.add(Calendar.WEEK_OF_YEAR, 1); Collection responses = fba.getFreeBusy(new Date(), cal.getTime()); fba.close(); Iterator it = responses.iterator(); while (it.hasNext()) { CalDavClient.Response resp = (CalDavClient.Response)it.next(); if (resp.responseCode != HttpServletResponse.SC_OK) { out("Response code for " + resp.ui.account + " = " + resp.responseCode); } else { } } } catch (Throwable t) { t.printStackTrace(); fba.error(t.getMessage()); } }
| 1,118,893
|
public static void main(String[] args) { FreeBusyAggregator fba = new FreeBusyAggregator(); try { fba.init(); Calendar cal = Calendar.getInstance(); cal.add(Calendar.WEEK_OF_YEAR, 1); Collection responses = fba.getFreeBusy(new Date(), cal.getTime()); fba.close(); Iterator it = responses.iterator(); while (it.hasNext()) { Response resp = (Response)it.next(); if (resp.responseCode != HttpServletResponse.SC_OK) { out("Response code for " + resp.ui.account + " = " + resp.responseCode); } else { } } } catch (Throwable t) { t.printStackTrace(); fba.error(t.getMessage()); } }
|
public static void main(String[] args) { FreeBusyAggregator fba = new FreeBusyAggregator(); try { fba.init(); Calendar cal = Calendar.getInstance(); cal.add(Calendar.WEEK_OF_YEAR, 1); Collection responses = fba.getFreeBusy(new Date(), cal.getTime()); fba.close(); Iterator it = responses.iterator(); while (it.hasNext()) { Response resp = (Response)it.next(); if (resp.responseCode != HttpServletResponse.SC_OK) { out("Response code for " + resp.ui.getAccount() + " = " + resp.responseCode); } else { } } } catch (Throwable t) { t.printStackTrace(); fba.error(t.getMessage()); } }
| 1,118,894
|
private Req makeFreeBusyRequest(Date start, Date end, UserInfo ui) throws Throwable { Req req; if (ui.authUser == null) { req = new Req(); } else { req = new Req(ui.authUser, ui.authPw); } req.setUrl(ui.url); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060601T131358Z\""); req.addContentLine(" end=\"20060631T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
|
private Req makeFreeBusyRequest(Date start, Date end, FBUserInfo ui) throws Throwable { Req req; if (ui.authUser == null) { req = new Req(); } else { req = new Req(ui.authUser, ui.authPw); } req.setUrl(ui.url); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060601T131358Z\""); req.addContentLine(" end=\"20060631T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
| 1,118,895
|
private Req makeFreeBusyRequest(Date start, Date end, UserInfo ui) throws Throwable { Req req; if (ui.authUser == null) { req = new Req(); } else { req = new Req(ui.authUser, ui.authPw); } req.setUrl(ui.url); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060601T131358Z\""); req.addContentLine(" end=\"20060631T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
|
private Req makeFreeBusyRequest(Date start, Date end, UserInfo ui) throws Throwable { Req req; if (ui.getAuthUser() == null) { req = new Req(); } else { req = new Req(ui.authUser, ui.authPw); } req.setUrl(ui.url); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060601T131358Z\""); req.addContentLine(" end=\"20060631T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
| 1,118,896
|
private Req makeFreeBusyRequest(Date start, Date end, UserInfo ui) throws Throwable { Req req; if (ui.authUser == null) { req = new Req(); } else { req = new Req(ui.authUser, ui.authPw); } req.setUrl(ui.url); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060601T131358Z\""); req.addContentLine(" end=\"20060631T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
|
private Req makeFreeBusyRequest(Date start, Date end, UserInfo ui) throws Throwable { Req req; if (ui.authUser == null) { req = new Req(); } else { req = new Req(ui.getAuthUser(), ui.getAuthPw()); } req.setUrl(ui.url); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060601T131358Z\""); req.addContentLine(" end=\"20060631T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
| 1,118,897
|
private Req makeFreeBusyRequest(Date start, Date end, UserInfo ui) throws Throwable { Req req; if (ui.authUser == null) { req = new Req(); } else { req = new Req(ui.authUser, ui.authPw); } req.setUrl(ui.url); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060601T131358Z\""); req.addContentLine(" end=\"20060631T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
|
private Req makeFreeBusyRequest(Date start, Date end, UserInfo ui) throws Throwable { Req req; if (ui.authUser == null) { req = new Req(); } else { req = new Req(ui.authUser, ui.authPw); } req.setUrl(ui.getUrl()); req.setContentType("text/xml"); req.setMethod("REPORT"); req.addHeader("Depth", "0"); req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); req.addContentLine("<C:free-busy-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\">");// req.addContentLine(" <C:time-range start=\"" +// CalFacadeUtil.isoDateTimeUTC(start) + "\"");// req.addContentLine(" end=\"" +// CalFacadeUtil.isoDateTimeUTC(end) + "\"/>"); req.addContentLine(" <C:time-range start=\"20060601T131358Z\""); req.addContentLine(" end=\"20060631T131358Z\"/>"); req.addContentLine("</C:free-busy-query>"); return req; }
| 1,118,898
|
public static LocalSeismogramImpl apply(LocalSeismogramImpl seis, Instrumentation inst) throws FissuresException { if(!isValid(inst)) { throw new IllegalArgumentException("Invalid instrumentation for " + ChannelIdUtil.toString(seis.channel_id)); } /* * Sensitivity is COUNTs per Groung Motion, so should divide in order to * convert COUNT seismogram into Ground Motion. */ Sensitivity sensitivity = inst.the_response.the_sensitivity; LocalSeismogramImpl outSeis; // don't use int or short, promote to float if(seis.can_convert_to_float()) { float[] fSeries = seis.get_as_floats(); float[] out = new float[fSeries.length]; for(int i = 0; i < fSeries.length; i++) { out[i] = fSeries[i] / sensitivity.sensitivity_factor; } outSeis = new LocalSeismogramImpl(seis, out); } else { double[] dSeries = seis.get_as_doubles(); double[] out = new double[dSeries.length]; for(int i = 0; i < dSeries.length; i++) { out[i] = dSeries[i] / sensitivity.sensitivity_factor; } outSeis = new LocalSeismogramImpl(seis, out); } // end of else outSeis.y_unit = inst.the_response.stages[0].input_units; logger.debug("NOAMP seis units are " + outSeis.y_unit); return outSeis; }
|
public static LocalSeismogramImpl apply(LocalSeismogramImpl seis, Instrumentation inst) throws FissuresException { if(!isValid(inst)) { throw new IllegalArgumentException("Invalid instrumentation for " + ChannelIdUtil.toString(seis.channel_id)); } /* * Sensitivity is COUNTs per Groung Motion, so should divide in order to * convert COUNT seismogram into Ground Motion. */ Sensitivity sensitivity = inst.the_response.the_sensitivity; LocalSeismogramImpl outSeis; // don't use int or short, promote to float if(seis.can_convert_to_float()) { float[] fSeries = seis.get_as_floats(); float[] out = new float[fSeries.length]; for(int i = 0; i < fSeries.length; i++) { out[i] = fSeries[i] / sensitivity.sensitivity_factor; } outSeis = new LocalSeismogramImpl(seis, out); } else { double[] dSeries = seis.get_as_doubles(); double[] out = new double[dSeries.length]; for(int i = 0; i < dSeries.length; i++) { out[i] = dSeries[i] / sensitivity.sensitivity_factor; } outSeis = new LocalSeismogramImpl(seis, out); } // end of else outSeis.y_unit = inst.the_response.stages[0].input_units; return outSeis; }
| 1,118,899
|
public ProfileConfiguration() { super(new GridLayout(1, 1)); setBorder(new TitledBorder("Profile")); JPanel connectionPanel = new JPanel(new GridLayout(8, 1)); addServerAndPort(connectionPanel); addSSL(connectionPanel); addPassword(connectionPanel); addNickname(connectionPanel); addUsername(connectionPanel); addRealname(connectionPanel); addPartMsg(connectionPanel); addQuitMsg(connectionPanel); JPanel appearancePanel = new JPanel(new GridLayout(8, 1)); addOwnColorChooser(appearancePanel); addOtherColorChooser(appearancePanel); addNeutralColorChooser(appearancePanel); addEnableColors(appearancePanel); addPaletteColorChooser(appearancePanel); addConsoleFontSelector(appearancePanel); addChannelFontSelector(appearancePanel); addQueryFontSelector(appearancePanel); JPanel miscPanel = new JPanel(new GridLayout(8, 1)); addReconnect(miscPanel); addRejoinOnKick(miscPanel); addBeepOnMention(miscPanel); addBeepOnQuery(miscPanel); addEnableLogging(miscPanel); addLoggingDir(miscPanel); addBrowser(miscPanel); addAcceptCerts(miscPanel); JPanel performPanel = new JPanel(new GridLayout(1, 1)); addPerform(performPanel); JTabbedPane tabs = new JTabbedPane(); JPanel tmp; tmp = new JPanel(new BorderLayout()); tmp.add(connectionPanel, BorderLayout.WEST); tabs.add("Connection", tmp); tmp = new JPanel(new BorderLayout()); tmp.add(appearancePanel, BorderLayout.WEST); tabs.add("Appearance", tmp); tmp = new JPanel(new BorderLayout()); tmp.add(miscPanel, BorderLayout.WEST); tabs.add("Miscellauneous", tmp); tabs.add("Perform", performPanel); JPanel p = new JPanel(); p.add(tabs); JPanel buttons = new JPanel(); final JButton saveButton = new JButton("Save"); saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (profile != null) { profile.setServer(server.getText()); try { int p = Integer.parseInt(port.getText()); profile.setPort(p); } catch (Exception exc) { ExceptionDialog.show(exc); } profile.setSSL(ssl.isSelected()); profile.setPassword(password.getText()); profile.setNickname(nickname.getText()); profile.setUsername(username.getText()); profile.setRealname(realname.getText()); profile.setPartMessage(partMsg.getText()); profile.setQuitMessage(quitMsg.getText()); profile.setOwnColor(ownColor.getBackground()); profile.setOtherColor(otherColor.getBackground()); profile.setNeutralColor(neutralColor.getBackground()); profile.setEnableColors(enableColors.isSelected()); Color[] palette = new Color[DefaultValues.PALETTE_SIZE]; for (int i = 0; i < DefaultValues.PALETTE_SIZE; i++) { palette[i] = colorPalette[i].getBackground(); } profile.setColorPalette(palette); profile.setConsoleFont(consoleFont.getSelectedFont()); profile.setChannelFont(channelFont.getSelectedFont()); profile.setQueryFont(queryFont.getSelectedFont()); profile.setReconnect(reconnect.isSelected()); profile.setRejoinOnKick(rejoinOnKick.isSelected()); profile.setBeepOnMention(beepOnMention.isSelected()); profile.setBeepOnQuery(beepOnQuery.isSelected()); profile.setEnableLogging(enableLogging.isSelected()); profile.setLoggingDir(loggingDir.toString()); profile.setAcceptCerts(acceptCerts.isSelected()); profile.setBrowser(browser.getText()); profile.setPerform(perform.getText()); } } }); buttons.add(saveButton); JPanel main = new JPanel(new BorderLayout()); main.add(p, BorderLayout.WEST); main.add(buttons, BorderLayout.SOUTH); JScrollPane scrollPane = new JScrollPane(main); scrollPane.setBorder(null); add(scrollPane); }
|
public ProfileConfiguration() { super(new GridLayout(1, 1)); setBorder(new TitledBorder("Profile")); JPanel connectionPanel = new JPanel(new GridLayout(8, 1)); addServerAndPort(connectionPanel); addSSL(connectionPanel); addPassword(connectionPanel); addNickname(connectionPanel); addUsername(connectionPanel); addRealname(connectionPanel); addPartMsg(connectionPanel); addQuitMsg(connectionPanel); JPanel appearancePanel = new JPanel(new GridLayout(8, 1)); addOwnColorChooser(appearancePanel); addOtherColorChooser(appearancePanel); addNeutralColorChooser(appearancePanel); addEnableColors(appearancePanel); addPaletteColorChooser(appearancePanel); addConsoleFontSelector(appearancePanel); addChannelFontSelector(appearancePanel); addQueryFontSelector(appearancePanel); JPanel miscPanel = new JPanel(new GridLayout(8, 1)); addReconnect(miscPanel); addRejoinOnKick(miscPanel); addBeepOnMention(miscPanel); addBeepOnQuery(miscPanel); addEnableLogging(miscPanel); addLoggingDir(miscPanel); addBrowser(miscPanel); addAcceptCerts(miscPanel); JPanel performPanel = new JPanel(new GridLayout(1, 1)); addPerform(performPanel); JTabbedPane tabs = new JTabbedPane(); JPanel tmp; tmp = new JPanel(new BorderLayout()); tmp.add(connectionPanel, BorderLayout.WEST); tabs.add("Connection", tmp); tmp = new JPanel(new BorderLayout()); tmp.add(appearancePanel, BorderLayout.WEST); tabs.add("Appearance", tmp); tmp = new JPanel(new BorderLayout()); tmp.add(miscPanel, BorderLayout.WEST); tabs.add("Miscellauneous", tmp); tabs.add("Perform", performPanel); JPanel p = new JPanel(); p.add(tabs); JPanel buttons = new JPanel(); final JButton saveButton = new JButton("Save"); saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (profile != null) { profile.setServer(server.getText()); try { int p = Integer.parseInt(port.getText()); profile.setPort(p); } catch (Exception exc) { ExceptionDialog.show(exc); } profile.setSSL(ssl.isSelected()); profile.setPassword(password.getText()); profile.setNickname(nickname.getText()); profile.setUsername(username.getText()); profile.setRealname(realname.getText()); profile.setPartMessage(partMsg.getText()); profile.setQuitMessage(quitMsg.getText()); profile.setOwnColor(ownColor.getBackground()); profile.setOtherColor(otherColor.getBackground()); profile.setNeutralColor(neutralColor.getBackground()); profile.setEnableColors(enableColors.isSelected()); Color[] palette = new Color[DefaultValues.PALETTE_SIZE]; for (int i = 0; i < DefaultValues.PALETTE_SIZE; i++) { palette[i] = colorPalette[i].getBackground(); } profile.setColorPalette(palette); profile.setConsoleFont(consoleFont.getSelectedFont()); profile.setChannelFont(channelFont.getSelectedFont()); profile.setQueryFont(queryFont.getSelectedFont()); profile.setReconnect(reconnect.isSelected()); profile.setRejoinOnKick(rejoinOnKick.isSelected()); profile.setBeepOnMention(beepOnMention.isSelected()); profile.setBeepOnQuery(beepOnQuery.isSelected()); profile.setEnableLogging(enableLogging.isSelected()); profile.setLoggingDir(loggingDir.getText().toString()); profile.setAcceptCerts(acceptCerts.isSelected()); profile.setBrowser(browser.getText()); profile.setPerform(perform.getText()); } } }); buttons.add(saveButton); JPanel main = new JPanel(new BorderLayout()); main.add(p, BorderLayout.WEST); main.add(buttons, BorderLayout.SOUTH); JScrollPane scrollPane = new JScrollPane(main); scrollPane.setBorder(null); add(scrollPane); }
| 1,118,900
|
public void actionPerformed(ActionEvent e) { if (profile != null) { profile.setServer(server.getText()); try { int p = Integer.parseInt(port.getText()); profile.setPort(p); } catch (Exception exc) { ExceptionDialog.show(exc); } profile.setSSL(ssl.isSelected()); profile.setPassword(password.getText()); profile.setNickname(nickname.getText()); profile.setUsername(username.getText()); profile.setRealname(realname.getText()); profile.setPartMessage(partMsg.getText()); profile.setQuitMessage(quitMsg.getText()); profile.setOwnColor(ownColor.getBackground()); profile.setOtherColor(otherColor.getBackground()); profile.setNeutralColor(neutralColor.getBackground()); profile.setEnableColors(enableColors.isSelected()); Color[] palette = new Color[DefaultValues.PALETTE_SIZE]; for (int i = 0; i < DefaultValues.PALETTE_SIZE; i++) { palette[i] = colorPalette[i].getBackground(); } profile.setColorPalette(palette); profile.setConsoleFont(consoleFont.getSelectedFont()); profile.setChannelFont(channelFont.getSelectedFont()); profile.setQueryFont(queryFont.getSelectedFont()); profile.setReconnect(reconnect.isSelected()); profile.setRejoinOnKick(rejoinOnKick.isSelected()); profile.setBeepOnMention(beepOnMention.isSelected()); profile.setBeepOnQuery(beepOnQuery.isSelected()); profile.setEnableLogging(enableLogging.isSelected()); profile.setLoggingDir(loggingDir.toString()); profile.setAcceptCerts(acceptCerts.isSelected()); profile.setBrowser(browser.getText()); profile.setPerform(perform.getText()); } }
|
public void actionPerformed(ActionEvent e) { if (profile != null) { profile.setServer(server.getText()); try { int p = Integer.parseInt(port.getText()); profile.setPort(p); } catch (Exception exc) { ExceptionDialog.show(exc); } profile.setSSL(ssl.isSelected()); profile.setPassword(password.getText()); profile.setNickname(nickname.getText()); profile.setUsername(username.getText()); profile.setRealname(realname.getText()); profile.setPartMessage(partMsg.getText()); profile.setQuitMessage(quitMsg.getText()); profile.setOwnColor(ownColor.getBackground()); profile.setOtherColor(otherColor.getBackground()); profile.setNeutralColor(neutralColor.getBackground()); profile.setEnableColors(enableColors.isSelected()); Color[] palette = new Color[DefaultValues.PALETTE_SIZE]; for (int i = 0; i < DefaultValues.PALETTE_SIZE; i++) { palette[i] = colorPalette[i].getBackground(); } profile.setColorPalette(palette); profile.setConsoleFont(consoleFont.getSelectedFont()); profile.setChannelFont(channelFont.getSelectedFont()); profile.setQueryFont(queryFont.getSelectedFont()); profile.setReconnect(reconnect.isSelected()); profile.setRejoinOnKick(rejoinOnKick.isSelected()); profile.setBeepOnMention(beepOnMention.isSelected()); profile.setBeepOnQuery(beepOnQuery.isSelected()); profile.setEnableLogging(enableLogging.isSelected()); profile.setLoggingDir(loggingDir.getText().toString()); profile.setAcceptCerts(acceptCerts.isSelected()); profile.setBrowser(browser.getText()); profile.setPerform(perform.getText()); } }
| 1,118,901
|
public Object merge(Object one, Object two) { LocalSeismogramImpl seis = (LocalSeismogramImpl)one; LocalSeismogramImpl seis2 = (LocalSeismogramImpl)two; MicroSecondTimeRange fullRange = new MicroSecondTimeRange(toMSTR(seis), toMSTR(seis2)); logger.debug("Merging " + toMSTR(seis) + " and " + toMSTR(seis2) + " into " + fullRange); if(fullRange.equals(toMSTR(seis))) { return seis; } LocalSeismogramImpl earlier = seis; LocalSeismogramImpl later = seis2; if(seis2.getBeginTime().before(seis.getBeginTime())) { earlier = seis2; later = seis; } try { if(seis.is_encoded()) { EncodedData[] earlierED = earlier.get_as_encoded(); EncodedData[] laterED = later.get_as_encoded(); EncodedData[] outED = new EncodedData[earlierED.length + laterED.length]; System.arraycopy(earlierED, 0, outED, 0, earlierED.length); System.arraycopy(laterED, 0, outED, earlierED.length - 1, laterED.length); TimeSeriesDataSel td = new TimeSeriesDataSel(); td.encoded_values(outED); return new LocalSeismogramImpl(earlier, td); } int numPoints = seis.getNumPoints() + seis2.getNumPoints(); if(seis.can_convert_to_short()) { short[] outS = new short[numPoints]; System.arraycopy(earlier.get_as_shorts(), 0, outS, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_shorts(), 0, outS, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outS); } else if(seis.can_convert_to_long()) { int[] outI = new int[numPoints]; System.arraycopy(earlier.get_as_longs(), 0, outI, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_longs(), 0, outI, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outI); } else if(seis.can_convert_to_float()) { float[] outF = new float[numPoints]; System.arraycopy(earlier.get_as_floats(), 0, outF, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_floats(), 0, outF, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outF); } else { double[] outD = new double[numPoints]; System.arraycopy(earlier.get_as_doubles(), 0, outD, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_doubles(), 0, outD, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outD); } } catch(FissuresException e) { throw new RuntimeException(e); } }
|
public Object merge(Object one, Object two) { LocalSeismogramImpl seis = (LocalSeismogramImpl)one; LocalSeismogramImpl seis2 = (LocalSeismogramImpl)two; MicroSecondTimeRange fullRange = new MicroSecondTimeRange(toMSTR(seis), toMSTR(seis2)); logger.debug("Merging " + toMSTR(seis) + " and " + toMSTR(seis2) + " into " + fullRange); if(fullRange.equals(toMSTR(seis))) { return seis; } LocalSeismogramImpl earlier = seis; LocalSeismogramImpl later = seis2; if(seis2.getBeginTime().before(seis.getBeginTime())) { earlier = seis2; later = seis; } try { if(seis.is_encoded()) { EncodedData[] earlierED = earlier.get_as_encoded(); EncodedData[] laterED = later.get_as_encoded(); EncodedData[] outED = new EncodedData[earlierED.length + laterED.length]; System.arraycopy(earlierED, 0, outED, 0, earlierED.length); System.arraycopy(laterED, 0, outED, earlierED.length, laterED.length); TimeSeriesDataSel td = new TimeSeriesDataSel(); td.encoded_values(outED); return new LocalSeismogramImpl(earlier, td); } int numPoints = seis.getNumPoints() + seis2.getNumPoints(); if(seis.can_convert_to_short()) { short[] outS = new short[numPoints]; System.arraycopy(earlier.get_as_shorts(), 0, outS, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_shorts(), 0, outS, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outS); } else if(seis.can_convert_to_long()) { int[] outI = new int[numPoints]; System.arraycopy(earlier.get_as_longs(), 0, outI, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_longs(), 0, outI, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outI); } else if(seis.can_convert_to_float()) { float[] outF = new float[numPoints]; System.arraycopy(earlier.get_as_floats(), 0, outF, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_floats(), 0, outF, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outF); } else { double[] outD = new double[numPoints]; System.arraycopy(earlier.get_as_doubles(), 0, outD, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_doubles(), 0, outD, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outD); } } catch(FissuresException e) { throw new RuntimeException(e); } }
| 1,118,902
|
public Object merge(Object one, Object two) { LocalSeismogramImpl seis = (LocalSeismogramImpl)one; LocalSeismogramImpl seis2 = (LocalSeismogramImpl)two; MicroSecondTimeRange fullRange = new MicroSecondTimeRange(toMSTR(seis), toMSTR(seis2)); logger.debug("Merging " + toMSTR(seis) + " and " + toMSTR(seis2) + " into " + fullRange); if(fullRange.equals(toMSTR(seis))) { return seis; } LocalSeismogramImpl earlier = seis; LocalSeismogramImpl later = seis2; if(seis2.getBeginTime().before(seis.getBeginTime())) { earlier = seis2; later = seis; } try { if(seis.is_encoded()) { EncodedData[] earlierED = earlier.get_as_encoded(); EncodedData[] laterED = later.get_as_encoded(); EncodedData[] outED = new EncodedData[earlierED.length + laterED.length]; System.arraycopy(earlierED, 0, outED, 0, earlierED.length); System.arraycopy(laterED, 0, outED, earlierED.length - 1, laterED.length); TimeSeriesDataSel td = new TimeSeriesDataSel(); td.encoded_values(outED); return new LocalSeismogramImpl(earlier, td); } int numPoints = seis.getNumPoints() + seis2.getNumPoints(); if(seis.can_convert_to_short()) { short[] outS = new short[numPoints]; System.arraycopy(earlier.get_as_shorts(), 0, outS, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_shorts(), 0, outS, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outS); } else if(seis.can_convert_to_long()) { int[] outI = new int[numPoints]; System.arraycopy(earlier.get_as_longs(), 0, outI, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_longs(), 0, outI, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outI); } else if(seis.can_convert_to_float()) { float[] outF = new float[numPoints]; System.arraycopy(earlier.get_as_floats(), 0, outF, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_floats(), 0, outF, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outF); } else { double[] outD = new double[numPoints]; System.arraycopy(earlier.get_as_doubles(), 0, outD, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_doubles(), 0, outD, earlier.getNumPoints() - 1, later.getNumPoints()); return new LocalSeismogramImpl(earlier, outD); } } catch(FissuresException e) { throw new RuntimeException(e); } }
|
public Object merge(Object one, Object two) { LocalSeismogramImpl seis = (LocalSeismogramImpl)one; LocalSeismogramImpl seis2 = (LocalSeismogramImpl)two; MicroSecondTimeRange fullRange = new MicroSecondTimeRange(toMSTR(seis), toMSTR(seis2)); logger.debug("Merging " + toMSTR(seis) + " and " + toMSTR(seis2) + " into " + fullRange); if(fullRange.equals(toMSTR(seis))) { return seis; } LocalSeismogramImpl earlier = seis; LocalSeismogramImpl later = seis2; if(seis2.getBeginTime().before(seis.getBeginTime())) { earlier = seis2; later = seis; } try { if(seis.is_encoded()) { EncodedData[] earlierED = earlier.get_as_encoded(); EncodedData[] laterED = later.get_as_encoded(); EncodedData[] outED = new EncodedData[earlierED.length + laterED.length]; System.arraycopy(earlierED, 0, outED, 0, earlierED.length); System.arraycopy(laterED, 0, outED, earlierED.length - 1, laterED.length); TimeSeriesDataSel td = new TimeSeriesDataSel(); td.encoded_values(outED); return new LocalSeismogramImpl(earlier, td); } int numPoints = seis.getNumPoints() + seis2.getNumPoints(); if(seis.can_convert_to_short()) { short[] outS = new short[numPoints]; System.arraycopy(earlier.get_as_shorts(), 0, outS, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_shorts(), 0, outS, earlier.getNumPoints(), later.getNumPoints()); return new LocalSeismogramImpl(earlier, outS); } else if(seis.can_convert_to_long()) { int[] outI = new int[numPoints]; System.arraycopy(earlier.get_as_longs(), 0, outI, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_longs(), 0, outI, earlier.getNumPoints(), later.getNumPoints()); return new LocalSeismogramImpl(earlier, outI); } else if(seis.can_convert_to_float()) { float[] outF = new float[numPoints]; System.arraycopy(earlier.get_as_floats(), 0, outF, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_floats(), 0, outF, earlier.getNumPoints(), later.getNumPoints()); return new LocalSeismogramImpl(earlier, outF); } else { double[] outD = new double[numPoints]; System.arraycopy(earlier.get_as_doubles(), 0, outD, 0, earlier.getNumPoints()); System.arraycopy(later.get_as_doubles(), 0, outD, earlier.getNumPoints(), later.getNumPoints()); return new LocalSeismogramImpl(earlier, outD); } } catch(FissuresException e) { throw new RuntimeException(e); } }
| 1,118,903
|
public void addSelection(Selection newSelection){ if(!getSelections().contains(newSelection)){ getSelections().add(newSelection); selectionCount++; repaint(); } }
|
public void addSelection(Selection newSelection){ if(!getSelections().contains(newSelection)){ getSelections().add(newSelection); selectionCount++; repaint(); } }
| 1,118,904
|
public void clear3CSelections(){ get3CSelections().clear(); selection3CCount = 0; repaint(); }
|
public void clear3CSelections(){ get3CSelections().clear(); selection3CCount = 0; repaint(); }
| 1,118,905
|
public void clearRegSelections(){ getSelections().clear(); selectionCount = 0; repaint(); }
|
public void clearRegSelections(){ getSelections().clear(); selectionCount = 0; repaint(); }
| 1,118,906
|
public void clearSelections(){ parent.removeSelectionDisplay(); parent.remove3CSelectionDisplay(); repaint(); }
|
public void clearSelections(){ parent.removeSelectionDisplay(); parent.remove3CSelectionDisplay(); repaint(); }
| 1,118,907
|
public java.util.List getSelections(){ return plotters.subList(plotters.size() - selectionCount - selection3CCount, plotters.size() - selection3CCount); }
|
public java.util.List getSelections(){ return plotters.subList(plotters.size() - selectionCount - selection3CCount, plotters.size()); }
| 1,118,908
|
public void removeSelection(Selection oldSelection){ if(getSelections().remove(oldSelection)){ selectionCount--; repaint(); } }
|
public void removeSelection(Selection oldSelection){ if(getSelections().remove(oldSelection)){ selectionCount--; repaint(); } }
| 1,118,909
|
public void update(ConfigEvent event){ update++; currentTimeEvent = event.getTimeEvent(); currentAmpEvent = event.getAmpEvent(); repaint(); }
|
public void update(ConfigEvent event){ currentTimeEvent = event.getTimeEvent(); currentAmpEvent = event.getAmpEvent(); repaint(); }
| 1,118,910
|
public void updateAmp(AmpEvent event){ update++; currentAmpEvent = event; repaint(); }
|
public void updateAmp(AmpEvent event){ currentAmpEvent = event; repaint(); }
| 1,118,911
|
public void updateTime(TimeEvent event){ update++; currentTimeEvent = event; repaint(); }
|
public void updateTime(TimeEvent event){ currentTimeEvent = event; repaint(); }
| 1,118,912
|
public Map mergeAttributes(final Map dest, final Map source) { if (dest == null) throw new IllegalArgumentException("toModify cannot be null"); if (source == null) throw new IllegalArgumentException("toConsider cannot be null"); final Map sourceCopy = new HashMap(source); //Iterate through the dest Map for (final Iterator destKeyItr = dest.keySet().iterator(); destKeyItr.hasNext();) { final Object destKey = destKeyItr.next(); //If there is a corresponding entry in source if (sourceCopy.containsKey(destKey)) { //Get the values final Object sourceValue = sourceCopy.remove(destKey); final Object destValue = dest.get(destKey); //If they are both Lists merge them if (destValue instanceof List && sourceValue instanceof List) { final List destList = (List)destValue; final List sourceList = (List)sourceValue; destList.addAll(sourceList); dest.put(destKey, destList); } //If dest value is a List add the source value to it else if (destValue instanceof List) { final List destList = (List)destValue; destList.add(sourceValue); dest.put(destKey, destList); } //If the source value is a List add the dest value to it else if (sourceValue instanceof List) { final List sourceList = (List)sourceValue; sourceList.add(0, destValue); dest.put(destKey, sourceList); } //Neither are a List, create a new List else { final List newList = new ArrayList(2); newList.add(destValue); newList.add(sourceValue); dest.put(destKey, newList); } } } //Add the remaining items from source to dest dest.putAll(sourceCopy); return dest; }
|
public Map mergeAttributes(final Map dest, final Map source) { if (dest == null) throw new IllegalArgumentException("toModify cannot be null"); if (source == null) throw new IllegalArgumentException("toConsider cannot be null"); final Map sourceCopy = new HashMap(source); //Iterate through the dest Map for (final Iterator destKeyItr = dest.keySet().iterator(); destKeyItr.hasNext();) { final Object destKey = destKeyItr.next(); //If there is a corresponding entry in source if (sourceCopy.containsKey(destKey)) { //Get the values final Object sourceValue = sourceCopy.remove(destKey); final Object destValue = dest.get(destKey); //If they are both Lists merge them if (destValue instanceof List && sourceValue instanceof List) { final List destList = (List)destValue; final List sourceList = (List)sourceValue; destList.addAll(sourceList); dest.put(destKey, destList); } //If dest value is a List add the source value to it else if (destValue instanceof List) { final List destList = (List)destValue; destList.add(sourceValue); dest.put(destKey, destList); } //If the source value is a List add the dest value to it else if (sourceValue instanceof List) { final List sourceList = (List)sourceValue; sourceList.add(0, destValue); dest.put(destKey, sourceList); } //Neither are a List, create a new List else { final List newList = new ArrayList(2); newList.add(destValue); newList.add(sourceValue); dest.put(destKey, newList); } } } //Add the remaining items from source to dest dest.putAll(sourceCopy); return dest; }
| 1,118,914
|
public Map mergeAttributes(final Map dest, final Map source) { if (dest == null) throw new IllegalArgumentException("toModify cannot be null"); if (source == null) throw new IllegalArgumentException("toConsider cannot be null"); final Map sourceCopy = new HashMap(source); //Iterate through the dest Map for (final Iterator destKeyItr = dest.keySet().iterator(); destKeyItr.hasNext();) { final Object destKey = destKeyItr.next(); //If there is a corresponding entry in source if (sourceCopy.containsKey(destKey)) { //Get the values final Object sourceValue = sourceCopy.remove(destKey); final Object destValue = dest.get(destKey); //If they are both Lists merge them if (destValue instanceof List && sourceValue instanceof List) { final List destList = (List)destValue; final List sourceList = (List)sourceValue; destList.addAll(sourceList); dest.put(destKey, destList); } //If dest value is a List add the source value to it else if (destValue instanceof List) { final List destList = (List)destValue; destList.add(sourceValue); dest.put(destKey, destList); } //If the source value is a List add the dest value to it else if (sourceValue instanceof List) { final List sourceList = (List)sourceValue; sourceList.add(0, destValue); dest.put(destKey, sourceList); } //Neither are a List, create a new List else { final List newList = new ArrayList(2); newList.add(destValue); newList.add(sourceValue); dest.put(destKey, newList); } } } //Add the remaining items from source to dest dest.putAll(sourceCopy); return dest; }
|
public Map mergeAttributes(final Map dest, final Map source) { if (dest == null) throw new IllegalArgumentException("toModify cannot be null"); if (source == null) throw new IllegalArgumentException("toConsider cannot be null"); final Map sourceCopy = new HashMap(source); //Iterate through the dest Map for (final Iterator destKeyItr = dest.keySet().iterator(); destKeyItr.hasNext();) { final Object destKey = destKeyItr.next(); //If there is a corresponding entry in source if (sourceCopy.containsKey(destKey)) { //Get the values final Object sourceValue = sourceCopy.remove(destKey); final Object destValue = destEntry.getValue(); //If they are both Lists merge them if (destValue instanceof List && sourceValue instanceof List) { final List destList = (List)destValue; final List sourceList = (List)sourceValue; destList.addAll(sourceList); dest.put(destKey, destList); } //If dest value is a List add the source value to it else if (destValue instanceof List) { final List destList = (List)destValue; destList.add(sourceValue); dest.put(destKey, destList); } //If the source value is a List add the dest value to it else if (sourceValue instanceof List) { final List sourceList = (List)sourceValue; sourceList.add(0, destValue); dest.put(destKey, sourceList); } //Neither are a List, create a new List else { final List newList = new ArrayList(2); newList.add(destValue); newList.add(sourceValue); dest.put(destKey, newList); } } } //Add the remaining items from source to dest dest.putAll(sourceCopy); return dest; }
| 1,118,915
|
public Set getPossibleUserAttributeNames() { if (this.backingMap == null) { return null; } return Collections.unmodifiableSet(this.backingMap.keySet()); }
|
public Set getPossibleUserAttributeNames() { if (this.backingMap == null) { return Collections.EMPTY_SET; } return Collections.unmodifiableSet(this.backingMap.keySet()); }
| 1,118,916
|
public void run() { Station station; while ( ! quitThread) { logger.debug("in station checker"); station = null; try { station = getToCheck(); logger.debug("Checking Station available data for "+ StationIdUtil.toString(station.get_id())); Channel[] chans = null; NetworkAccess net = channelChooser.getNetworkAccess(station.get_id().network_id); if ( net != null) { chans = net.retrieve_for_station(station.get_id()); } RequestFilter[] request = createFakeRequest(chans); if (dc.available_data(request).length != 0) { stationsUpNow.put(station, Boolean.TRUE); } else { stationsUpNow.put(station, Boolean.FALSE); } if (jlist != null) { jlist.repaint(); } } catch (InterruptedException e) { } catch (Exception e) { logger.warn("Trouble checkng on the available data for "+ StationIdUtil.toString(station.get_id()), e); } } }
|
public void run() { Station station; while ( ! quitThread) { station = null; try { station = getToCheck(); logger.debug("Checking Station available data for "+ StationIdUtil.toString(station.get_id())); Channel[] chans = null; NetworkAccess net = channelChooser.getNetworkAccess(station.get_id().network_id); if ( net != null) { chans = net.retrieve_for_station(station.get_id()); } RequestFilter[] request = createFakeRequest(chans); if (dc.available_data(request).length != 0) { stationsUpNow.put(station, Boolean.TRUE); } else { stationsUpNow.put(station, Boolean.FALSE); } if (jlist != null) { jlist.repaint(); } } catch (InterruptedException e) { } catch (Exception e) { logger.warn("Trouble checkng on the available data for "+ StationIdUtil.toString(station.get_id()), e); } } }
| 1,118,918
|
public void run() { Station station; while ( ! quitThread) { logger.debug("in station checker"); station = null; try { station = getToCheck(); logger.debug("Checking Station available data for "+ StationIdUtil.toString(station.get_id())); Channel[] chans = null; NetworkAccess net = channelChooser.getNetworkAccess(station.get_id().network_id); if ( net != null) { chans = net.retrieve_for_station(station.get_id()); } RequestFilter[] request = createFakeRequest(chans); if (dc.available_data(request).length != 0) { stationsUpNow.put(station, Boolean.TRUE); } else { stationsUpNow.put(station, Boolean.FALSE); } if (jlist != null) { jlist.repaint(); } } catch (InterruptedException e) { } catch (Exception e) { logger.warn("Trouble checkng on the available data for "+ StationIdUtil.toString(station.get_id()), e); } } }
|
public void run() { Station station; while ( ! quitThread) { logger.debug("in station checker"); station = null; try { station = getToCheck(); logger.debug("Checking Station available data for "+ StationIdUtil.toString(station.get_id())); Channel[] chans = null; NetworkAccess net = channelChooser.getNetworkAccess(station.get_id().network_id); if ( net != null) { chans = net.retrieve_for_station(station.get_id()); } RequestFilter[] request = createFakeRequest(chans); if (dc.available_data(request).length != 0) { stationsUpNow.put(station, Boolean.TRUE); } else { stationsUpNow.put(station, Boolean.FALSE); } if (jlist != null) { jlist.repaint(); } } catch (InterruptedException e) { } catch (Exception e) { logger.warn("Trouble checkng on the available data for "+ StationIdUtil.toString(station.get_id()), e); } } }
| 1,118,919
|
public void run() { Station station; while ( ! quitThread) { logger.debug("in station checker"); station = null; try { station = getToCheck(); logger.debug("Checking Station available data for "+ StationIdUtil.toString(station.get_id())); Channel[] chans = null; NetworkAccess net = channelChooser.getNetworkAccess(station.get_id().network_id); if ( net != null) { chans = net.retrieve_for_station(station.get_id()); } RequestFilter[] request = createFakeRequest(chans); if (dc.available_data(request).length != 0) { stationsUpNow.put(station, Boolean.TRUE); } else { stationsUpNow.put(station, Boolean.FALSE); } if (jlist != null) { jlist.repaint(); } } catch (InterruptedException e) { } catch (Exception e) { logger.warn("Trouble checkng on the available data for "+ StationIdUtil.toString(station.get_id()), e); } } }
|
public void run() { Station station; while ( ! quitThread) { logger.debug("in station checker"); station = null; try { station = getToCheck(); logger.debug("Checking Station available data for "+ StationIdUtil.toString(station.get_id())); Channel[] chans = null; NetworkAccess net = channelChooser.getNetworkAccess(station.get_id().network_id); if ( net != null) { chans = net.retrieve_for_station(station.get_id()); } RequestFilter[] request = createFakeRequest(chans); if (dc.available_data(request).length != 0) { finishedCheck(station, true); } else { stationsUpNow.put(station, Boolean.FALSE); } if (jlist != null) { jlist.repaint(); } } catch (InterruptedException e) { } catch (Exception e) { logger.warn("Trouble checkng on the available data for "+ StationIdUtil.toString(station.get_id()), e); } } }
| 1,118,920
|
public void run() { Station station; while ( ! quitThread) { logger.debug("in station checker"); station = null; try { station = getToCheck(); logger.debug("Checking Station available data for "+ StationIdUtil.toString(station.get_id())); Channel[] chans = null; NetworkAccess net = channelChooser.getNetworkAccess(station.get_id().network_id); if ( net != null) { chans = net.retrieve_for_station(station.get_id()); } RequestFilter[] request = createFakeRequest(chans); if (dc.available_data(request).length != 0) { stationsUpNow.put(station, Boolean.TRUE); } else { stationsUpNow.put(station, Boolean.FALSE); } if (jlist != null) { jlist.repaint(); } } catch (InterruptedException e) { } catch (Exception e) { logger.warn("Trouble checkng on the available data for "+ StationIdUtil.toString(station.get_id()), e); } } }
|
public void run() { Station station; while ( ! quitThread) { logger.debug("in station checker"); station = null; try { station = getToCheck(); logger.debug("Checking Station available data for "+ StationIdUtil.toString(station.get_id())); Channel[] chans = null; NetworkAccess net = channelChooser.getNetworkAccess(station.get_id().network_id); if ( net != null) { chans = net.retrieve_for_station(station.get_id()); } RequestFilter[] request = createFakeRequest(chans); if (dc.available_data(request).length != 0) { stationsUpNow.put(station, Boolean.TRUE); } else { stationsUpNow.put(station, Boolean.FALSE); } if (jlist != null) { jlist.repaint(); } } catch (InterruptedException e) { } catch (Exception e) { logger.warn("Trouble checkng on the available data for "+ StationIdUtil.toString(station.get_id()), e); } } }
| 1,118,921
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.