bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { Engine.log.exception(e); Engine.log.error("evaluate got IO exception on write to StringWriter"); return ""; } }
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, context.getEncoding()); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { Engine.log.exception(e); Engine.log.error("evaluate got IO exception on write to StringWriter"); return ""; } }
3,234,290
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { Engine.log.exception(e); Engine.log.error("evaluate got IO exception on write to StringWriter"); return ""; } }
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString(context.getEncoding()); } catch (IOException e) { Engine.log.exception(e); Engine.log.error("evaluate got IO exception on write to StringWriter"); return ""; } }
3,234,291
ClipBoardModel(HiViewer parentModel) { if (parentModel == null) throw new NullPointerException("No parent model."); this.parentModel = parentModel; annotatedObjectID = -1; annotatedObjectIndex = -1; annotationStatus = INITIAL; }
ClipBoardModel(HiViewer parentModel) { if (parentModel == null) throw new NullPointerException("No parent model."); this.parentModel = parentModel; annotatedObjectID = -1; annotatedObjectIndex = -1; annotationStatus = INITIAL; }
3,234,292
void setAnnotations(Map map) { if (map == null) throw new NullPointerException("No annotations"); HashMap sortedAnnotations = new HashMap(); Set set; Integer index; Iterator i = map.keySet().iterator(); Iterator j; AnnotationData annotation; Integer ownerID; List userAnnos; while (i.hasNext()) { index = (Integer) i.next(); set = (Set) map.get(index); j = set.iterator(); while (j.hasNext()) { annotation = (AnnotationData) j.next();; ownerID = new Integer(annotation.getOwner().getId()); userAnnos = (List) sortedAnnotations.get(ownerID); if (userAnnos == null) { userAnnos = new ArrayList(); sortedAnnotations.put(ownerID, userAnnos); } userAnnos.add(annotation); } } i = sortedAnnotations.keySet().iterator(); while (i.hasNext()) { ownerID = (Integer) i.next(); sortedAnnotations.put(ownerID, CollectionSorter.sortAnnotationDataByDate( (List) sortedAnnotations.get(ownerID))); } this.annotations = sortedAnnotations; state = ClipBoard.ANNOTATIONS_READY; }
void setAnnotations(Map map) { if (map == null) throw new NullPointerException("No annotations"); HashMap sortedAnnotations = new HashMap(); Set set; Integer index; Iterator i = map.keySet().iterator(); Iterator j; AnnotationData annotation; Integer ownerID; List userAnnos; while (i.hasNext()) { index = (Integer) i.next(); set = (Set) map.get(index); j = set.iterator(); while (j.hasNext()) { annotation = (AnnotationData) j.next();; ownerID = new Integer(annotation.getOwner().getId()); userAnnos = (List) sortedAnnotations.get(ownerID); if (userAnnos == null) { userAnnos = new ArrayList(); sortedAnnotations.put(ownerID, userAnnos); } userAnnos.add(annotation); } } i = sortedAnnotations.keySet().iterator(); while (i.hasNext()) { ownerID = (Integer) i.next(); sortedAnnotations.put(ownerID, CollectionSorter.sortAnnotationDataByDate( (List) sortedAnnotations.get(ownerID))); } this.annotations = sortedAnnotations; state = ClipBoard.ANNOTATIONS_READY; }
3,234,293
public void onDataObjectSave(DataObject data, int operation) { int state = model.getState(); if (operation == REMOVE_OBJECT && state != SAVE) throw new IllegalStateException("This method cannot be " + "invoked in the SAVE state"); switch (state) { case DISCARDED: throw new IllegalStateException("This method cannot be " + "invoked in the DISCARDED state"); } if (data == null) throw new IllegalArgumentException("No data object. "); switch (operation) { case Editor.CREATE_OBJECT: case Editor.UPDATE_OBJECT: case REMOVE_OBJECT: break; default: throw new IllegalArgumentException("Save operation not " + "supported."); } int editor = model.getEditorType(); removeEditor(); //remove the currently selected editor. Browser browser = model.getSelectedBrowser(); browser.refreshEdition(data, operation); if (operation == Editor.UPDATE_OBJECT) { Map browsers = model.getBrowsers(); Iterator i = browsers.keySet().iterator(); while (i.hasNext()) { browser = (Browser) browsers.get(i.next()); if (!(browser.equals(model.getSelectedBrowser()))) browser.refreshEdition(data, operation); } } if (editor == TreeViewer.CREATE_EDITOR) { PropertiesCmd cmd = new PropertiesCmd(this); cmd.execute(); } if (operation == REMOVE_OBJECT) { model.setState(READY); fireStateChange(); } }
publicvoidonDataObjectSave(DataObjectdata,intoperation){intstate=model.getState();if(operation==REMOVE_OBJECT&&state!=SAVE)thrownewIllegalStateException("Thismethodcannotbe"+"invokedintheSAVEstate");switch(state){caseDISCARDED:thrownewIllegalStateException("Thismethodcannotbe"+"invokedintheDISCARDEDstate");}if(data==null)thrownewIllegalArgumentException("Nodataobject.");switch(operation){caseEditor.CREATE_OBJECT:caseEditor.UPDATE_OBJECT:caseREMOVE_OBJECT:break;default:thrownewIllegalArgumentException("Saveoperationnot"+"supported.");}inteditor=model.getEditorType();removeEditor();//removethecurrentlyselectededitor.Browserbrowser=model.getSelectedBrowser();browser.refreshEdition(data,operation);if(operation==Editor.UPDATE_OBJECT){Mapbrowsers=model.getBrowsers();Iteratori=browsers.keySet().iterator();while(i.hasNext()){browser=(Browser)browsers.get(i.next());if(!(browser.equals(model.getSelectedBrowser())))browser.refreshEdition(data,operation);}}if(editor==TreeViewer.CREATE_EDITOR){PropertiesCmdcmd=newPropertiesCmd(this);cmd.execute();}if(operation==REMOVE_OBJECT){model.setState(READY);fireStateChange();}}
3,234,295
public void removeObject(DataObject object) { int state = model.getState(); if (state != NEW && state != READY) throw new IllegalStateException("This method should only be " + "invoked in the NEW or READY state."); model.fireDataObjectDeletion(object); fireStateChange(); }
public void removeObject(DataObject object) { int state = model.getState(); if (state != NEW && state != READY) throw new IllegalStateException("This method should only be " + "invoked in the NEW or READY state."); model.fireDataObjectDeletion(object); fireStateChange(); }
3,234,296
public void showClassifier(ImageData object, int mode) { if (model.getState() != READY) throw new IllegalStateException("This method should only be " + "invoked in the READY state."); if (object == null) throw new IllegalArgumentException("Object cannot be null."); removeEditor(); model.setEditorType(CLASSIFIER_EDITOR); Classifier classifier = ClassifierFactory.getClassifier(this, mode, object); classifier.addPropertyChangeListener(controller); classifier.activate(); view.addComponent(classifier.getUI()); }
public void showClassifier(ImageData object, int mode) { if (model.getState() != READY) throw new IllegalStateException("This method should only be " + "invoked in the READY state."); if (object == null) throw new IllegalArgumentException("Object cannot be null."); removeEditor(); model.setEditorType(CLASSIFIER_EDITOR); Classifier classifier = ClassifierFactory.getClassifier(this, mode, object); classifier.addPropertyChangeListener(controller); classifier.activate(); view.addComponent(classifier.getUI()); }
3,234,297
public void showFinder(boolean b) { switch (model.getState()) { case DISCARDED: case SAVE: throw new IllegalStateException( "This method cannot be invoked in the DISCARDED or SAVE " + "state."); } if (model.getSelectedBrowser() == null) return; Finder finder = model.getFinder(); if (b == finder.isDisplay()) return; Boolean oldValue = finder.isDisplay() ? Boolean.TRUE : Boolean.FALSE, newValue = b ? Boolean.TRUE : Boolean.FALSE; view.showFinder(b); firePropertyChange(FINDER_VISIBLE_PROPERTY, oldValue, newValue); }
public void showFinder(boolean b) { switch (model.getState()) { case DISCARDED: case SAVE: throw new IllegalStateException( "This method cannot be invoked in the DISCARDED or SAVE " + "state."); } if (model.getSelectedBrowser() == null) return; Finder finder = model.getFinder(); if (b == finder.isDisplay()) return; Boolean oldValue = finder.isDisplay() ? Boolean.TRUE : Boolean.FALSE, newValue = b ? Boolean.TRUE : Boolean.FALSE; view.showFinder(b); firePropertyChange(FINDER_VISIBLE_PROPERTY, oldValue, newValue); }
3,234,298
public static RubyArray list(Ruby ruby, RubyObject recv) { ArrayList list = new ArrayList(); Iterator iter = ruby.objectSpace.iterator(ruby.getClasses().getThreadClass()); while (iter.hasNext()) { list.add(iter.next()); } return new RubyArray(ruby, list); }
public static RubyArray list(Ruby ruby, RubyObject recv) { ArrayList list = new ArrayList(); Iterator iter = ruby.objectSpace.iterator(ruby.getClasses().getThreadClass()); while (iter.hasNext()) { list.add(iter.next()); } return RubyArray.newArray(ruby, list); }
3,234,299
XZPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy); }
XZPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy); }
3,234,300
XZPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy); }
XZPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(pDef, pixels, data); }
3,234,301
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); if (s.contains(p)) { currentROI = roi; currentShape = s; Rectangle r = s.getBounds(); xControl = r.x; yControl = r.y; view.setIndexSelected(roi.getIndex()); if (clickCount == 2) { dragging = false; control.annotateROI(roi); } } } }
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); if (s.contains(p)) { currentROI = roi; currentShape = s; Rectangle r = s.getBounds(); xControl = r.x; yControl = r.y; view.setIndexSelected(roi.getIndex()); if (clickCount == 2) { dragging = false; control.annotateROI(roi); } } } }
3,234,302
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); if (s.contains(p)) { currentROI = roi; currentShape = s; Rectangle r = s.getBounds(); xControl = r.x; yControl = r.y; view.setIndexSelected(roi.getIndex()); if (clickCount == 2) { dragging = false; control.annotateROI(roi); } } } }
private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR); else setCursor(DEFAULT_CURSOR); while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); if (s.contains(p)) { currentROI = roi; currentShape = s; Rectangle r = s.getBounds(); xControl = r.x; yControl = r.y; view.setIndexSelected(roi.getIndex()); if (clickCount == 2) { dragging = false; control.annotateROI(roi); } } } }
3,234,303
public void mouseReleased(MouseEvent e) { dragging = false; moving = false; setCursor(DEFAULT_CURSOR); switch (state) { case ROIAgt.CONSTRUCTING: if (!pressed) saveROI(); break; case ROIAgt.MOVING: case ROIAgt.RESIZING: if (currentShape != null) saveShape(); } pressed = false; }
state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; publicstate = ROIAgt.CONSTRUCTING; voidstate = ROIAgt.CONSTRUCTING; mouseReleased(MouseEventstate = ROIAgt.CONSTRUCTING; e)state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; {state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; draggingstate = ROIAgt.CONSTRUCTING; =state = ROIAgt.CONSTRUCTING; false;state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; movingstate = ROIAgt.CONSTRUCTING; =state = ROIAgt.CONSTRUCTING; false;state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; setCursor(DEFAULT_CURSOR);state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; switchstate = ROIAgt.CONSTRUCTING; (state)state = ROIAgt.CONSTRUCTING; {state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; casestate = ROIAgt.CONSTRUCTING; ROIAgt.CONSTRUCTING:state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; ifstate = ROIAgt.CONSTRUCTING; (!pressed)state = ROIAgt.CONSTRUCTING; saveROI();state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; break;state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; casestate = ROIAgt.CONSTRUCTING; ROIAgt.MOVING:state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; casestate = ROIAgt.CONSTRUCTING; ROIAgt.RESIZING:state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; ifstate = ROIAgt.CONSTRUCTING; (currentShapestate = ROIAgt.CONSTRUCTING; !=state = ROIAgt.CONSTRUCTING; null)state = ROIAgt.CONSTRUCTING; saveShape();state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; }state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; pressedstate = ROIAgt.CONSTRUCTING; =state = ROIAgt.CONSTRUCTING; false;state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; state = ROIAgt.CONSTRUCTING; }
3,234,305
private void move(Point p) { int diffX = p.x-anchor.x, diffY = p.y-anchor.y; Rectangle r = currentShape.getBounds(); int x = xControl+diffX, y = yControl+diffY, w = r.width, h = r.height; if (areaValid(x, y, w, h)) { ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), x , y, w, h); moving = true; view.moveAndDraw(currentShape); } }
private void move(Point p) { int diffX = p.x-anchor.x, diffY = p.y-anchor.y; Rectangle r = currentShape.getBounds(); int x = xControl+diffX, y = yControl+diffY, w = r.width, h = r.height; if (areaValid(x, y, w, h)) { ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), x , y, w, h); moving = true; view.moveAndDraw(currentShape); } }
3,234,306
private void resize(Point p) { Rectangle r = currentShape.getBounds(); int width = Math.abs(r.x-p.x), height = Math.abs(r.y-p.y); ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), r.x, r.y, width, height); moving = true; view.draw(currentShape); }
private void resize(Point p) { Rectangle r = currentShape.getBounds(); int width = Math.abs(r.x-p.x), height = Math.abs(r.y-p.y); ROIFactory.setShapeBounds(currentShape, currentROI.getShapeType(), r.x, r.y, width, height); moving = true; view.draw(currentShape); }
3,234,307
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); Rectangle imgRect = new Rectangle(0, 0, img.getWidth(), img.getHeight()); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); int width = Math.min(x+viewRect.width, img.getWidth()); int height = Math.min(y+viewRect.height, img.getHeight()); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); Rectangle imgRect = new Rectangle(0, 0, img.getWidth(), img.getHeight()); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); int width = Math.min(x+viewRect.width, img.getWidth()); int height = Math.min(y+viewRect.height, img.getHeight()); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
3,234,308
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); Rectangle imgRect = new Rectangle(0, 0, img.getWidth(), img.getHeight()); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); int width = Math.min(x+viewRect.width, img.getWidth()); int height = Math.min(y+viewRect.height, img.getHeight()); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); Rectangle imgRect = new Rectangle(0, 0, img.getWidth(), img.getHeight()); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); int width = Math.min(x+viewRect.width, img.getWidth()); int height = Math.min(y+viewRect.height, img.getHeight()); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
3,234,309
public static RubyObject each_object( Ruby ruby, RubyObject recv, RubyObject[] args) { if (args.length == 1) { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { if (obj.m_kind_of((RubyModule)args[0]).isTrue()) { ruby.yield(obj); } } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } else { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { ruby.yield(obj); } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } }
public static RubyObject each_object( Ruby ruby, RubyObject recv, RubyObject[] args) { if (args.length == 1) { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { if (obj.m_kind_of((RubyModule)args[0]).isTrue()) { ruby.yield(obj); } } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } else { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { ruby.yield(obj); } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } }
3,234,311
public static RubyObject each_object( Ruby ruby, RubyObject recv, RubyObject[] args) { if (args.length == 1) { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { if (obj.m_kind_of((RubyModule)args[0]).isTrue()) { ruby.yield(obj); } } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } else { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { ruby.yield(obj); } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } }
public static RubyObject each_object( Ruby ruby, RubyObject recv, RubyObject[] args) { if (args.length == 1) { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { if (obj.m_kind_of((RubyModule)args[0]).isTrue()) { ruby.yield(obj); } } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } else { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { ruby.yield(obj); } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } }
3,234,312
public static RubyObject each_object( Ruby ruby, RubyObject recv, RubyObject[] args) { if (args.length == 1) { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { if (obj.m_kind_of((RubyModule)args[0]).isTrue()) { ruby.yield(obj); } } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } else { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { ruby.yield(obj); } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } }
public static RubyObject each_object( Ruby ruby, RubyObject recv, RubyObject[] args) { if (args.length == 1) { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { if (obj.m_kind_of((RubyModule)args[0]).isTrue()) { ruby.yield(obj); } } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } else { Iterator iter = new LinkedList(ruby.objectSpace).iterator(); while (iter.hasNext()) { SoftReference ref = (SoftReference) iter.next(); RubyObject obj = (RubyObject) ref.get(); if (obj != null) { if (obj instanceof RubyModule && (((RubyModule) obj).isIncluded() || ((RubyModule) obj).isSingleton())) { continue; } else { ruby.yield(obj); } } else { ruby.objectSpace.remove(ref); } } return ruby.getNil(); } }
3,234,313
public static RubyObject convertJavaToRuby(Ruby ruby, Object object) { if (object == null) { return ruby.getNil(); } Class javaClass = object.getClass(); if (javaClass.isPrimitive()) { String cName = javaClass.getName(); if (cName == "boolean") { return RubyBoolean.newBoolean(ruby, ((Boolean) object).booleanValue()); } else if (cName == "float" || cName == "double") { return RubyFloat.newFloat(ruby, ((Number) object).doubleValue()); } else if (cName == "char") { return RubyFixnum.newFixnum(ruby, ((Character) object).charValue()); } else { // else it's one of the integral types return RubyFixnum.newFixnum(ruby, ((Number) object).longValue()); } } else if (javaClass == Boolean.class) { return RubyBoolean.newBoolean(ruby, ((Boolean) object).booleanValue()); } else if (javaClass == Float.class || javaClass == Double.class) { return RubyFloat.newFloat(ruby, ((Number) object).doubleValue()); } else if (javaClass == Character.class) { return RubyFixnum.newFixnum(ruby, ((Character) object).charValue()); } else if (Number.class.isAssignableFrom(javaClass)) { return RubyFixnum.newFixnum(ruby, ((Number) object).longValue()); } else if (javaClass == String.class) { return RubyString.newString(ruby, object.toString()); } else if (javaClass.isArray()) { Class arrayClass = javaClass.getComponentType(); int len = Array.getLength(object); RubyObject[] items = new RubyObject[len]; for (int i = 0; i < len; i++) { items[i] = convertJavaToRuby(ruby, Array.get(object, i)); } return RubyArray.create(ruby, null, items); } else if (List.class.isAssignableFrom(javaClass)) { int len = ((List) object).size(); RubyObject[] items = new RubyObject[len]; for (int i = 0; i < len; i++) { items[i] = convertJavaToRuby(ruby, ((List) object).get(i)); } return RubyArray.create(ruby, null, items); } else if (Map.class.isAssignableFrom(javaClass)) { int len = ((Map) object).size(); RubyObject[] items = new RubyObject[len * 2]; Iterator iter = ((Map) object).entrySet().iterator(); for (int i = 0; i < len; i++) { Map.Entry entry = (Map.Entry) iter.next(); items[2 * i] = convertJavaToRuby(ruby, entry.getKey()); items[2 * i + 1] = convertJavaToRuby(ruby, entry.getValue()); } return RubyHash.create(ruby, null, items); } else { return new RubyJavaObject(ruby, (RubyClass)ruby.getJavaSupport().loadClass(javaClass, null), object); } }
public static RubyObject convertJavaToRuby(Ruby ruby, Object object) { if (object == null) { return ruby.getNil(); } Class javaClass = object.getClass(); if (javaClass.isPrimitive()) { String cName = javaClass.getName(); if (cName == "boolean") { return RubyBoolean.newBoolean(ruby, ((Boolean) object).booleanValue()); } else if (cName == "float" || cName == "double") { return RubyFloat.newFloat(ruby, ((Number) object).doubleValue()); } else if (cName == "char") { return RubyFixnum.newFixnum(ruby, ((Character) object).charValue()); } else { // else it's one of the integral types return RubyFixnum.newFixnum(ruby, ((Number) object).longValue()); } } else if (javaClass == Boolean.class) { return RubyBoolean.newBoolean(ruby, ((Boolean) object).booleanValue()); } else if (javaClass == Float.class || javaClass == Double.class) { return RubyFloat.newFloat(ruby, ((Number) object).doubleValue()); } else if (javaClass == Character.class) { return RubyFixnum.newFixnum(ruby, ((Character) object).charValue()); } else if (Number.class.isAssignableFrom(javaClass)) { return RubyFixnum.newFixnum(ruby, ((Number) object).longValue()); } else if (javaClass == String.class) { return RubyString.newString(ruby, object.toString()); } else if (javaClass.isArray()) { Class arrayClass = javaClass.getComponentType(); int len = Array.getLength(object); RubyObject[] items = new RubyObject[len]; for (int i = 0; i < len; i++) { items[i] = convertJavaToRuby(ruby, Array.get(object, i)); } return RubyArray.newArray(ruby, items); } else if (List.class.isAssignableFrom(javaClass)) { int len = ((List) object).size(); RubyObject[] items = new RubyObject[len]; for (int i = 0; i < len; i++) { items[i] = convertJavaToRuby(ruby, ((List) object).get(i)); } return RubyArray.newArray(ruby, items); } else if (Map.class.isAssignableFrom(javaClass)) { int len = ((Map) object).size(); RubyObject[] items = new RubyObject[len * 2]; Iterator iter = ((Map) object).entrySet().iterator(); for (int i = 0; i < len; i++) { Map.Entry entry = (Map.Entry) iter.next(); items[2 * i] = convertJavaToRuby(ruby, entry.getKey()); items[2 * i + 1] = convertJavaToRuby(ruby, entry.getValue()); } return RubyHash.create(ruby, null, items); } else { return new RubyJavaObject(ruby, (RubyClass)ruby.getJavaSupport().loadClass(javaClass, null), object); } }
3,234,314
public static RubyObject convertJavaToRuby(Ruby ruby, Object object) { if (object == null) { return ruby.getNil(); } Class javaClass = object.getClass(); if (javaClass.isPrimitive()) { String cName = javaClass.getName(); if (cName == "boolean") { return RubyBoolean.newBoolean(ruby, ((Boolean) object).booleanValue()); } else if (cName == "float" || cName == "double") { return RubyFloat.newFloat(ruby, ((Number) object).doubleValue()); } else if (cName == "char") { return RubyFixnum.newFixnum(ruby, ((Character) object).charValue()); } else { // else it's one of the integral types return RubyFixnum.newFixnum(ruby, ((Number) object).longValue()); } } else if (javaClass == Boolean.class) { return RubyBoolean.newBoolean(ruby, ((Boolean) object).booleanValue()); } else if (javaClass == Float.class || javaClass == Double.class) { return RubyFloat.newFloat(ruby, ((Number) object).doubleValue()); } else if (javaClass == Character.class) { return RubyFixnum.newFixnum(ruby, ((Character) object).charValue()); } else if (Number.class.isAssignableFrom(javaClass)) { return RubyFixnum.newFixnum(ruby, ((Number) object).longValue()); } else if (javaClass == String.class) { return RubyString.newString(ruby, object.toString()); } else if (javaClass.isArray()) { Class arrayClass = javaClass.getComponentType(); int len = Array.getLength(object); RubyObject[] items = new RubyObject[len]; for (int i = 0; i < len; i++) { items[i] = convertJavaToRuby(ruby, Array.get(object, i)); } return RubyArray.create(ruby, null, items); } else if (List.class.isAssignableFrom(javaClass)) { int len = ((List) object).size(); RubyObject[] items = new RubyObject[len]; for (int i = 0; i < len; i++) { items[i] = convertJavaToRuby(ruby, ((List) object).get(i)); } return RubyArray.create(ruby, null, items); } else if (Map.class.isAssignableFrom(javaClass)) { int len = ((Map) object).size(); RubyObject[] items = new RubyObject[len * 2]; Iterator iter = ((Map) object).entrySet().iterator(); for (int i = 0; i < len; i++) { Map.Entry entry = (Map.Entry) iter.next(); items[2 * i] = convertJavaToRuby(ruby, entry.getKey()); items[2 * i + 1] = convertJavaToRuby(ruby, entry.getValue()); } return RubyHash.create(ruby, null, items); } else { return new RubyJavaObject(ruby, (RubyClass)ruby.getJavaSupport().loadClass(javaClass, null), object); } }
public static RubyObject convertJavaToRuby(Ruby ruby, Object object) { if (object == null) { return ruby.getNil(); } Class javaClass = object.getClass(); if (javaClass.isPrimitive()) { String cName = javaClass.getName(); if (cName == "boolean") { return RubyBoolean.newBoolean(ruby, ((Boolean) object).booleanValue()); } else if (cName == "float" || cName == "double") { return RubyFloat.newFloat(ruby, ((Number) object).doubleValue()); } else if (cName == "char") { return RubyFixnum.newFixnum(ruby, ((Character) object).charValue()); } else { // else it's one of the integral types return RubyFixnum.newFixnum(ruby, ((Number) object).longValue()); } } else if (javaClass == Boolean.class) { return RubyBoolean.newBoolean(ruby, ((Boolean) object).booleanValue()); } else if (javaClass == Float.class || javaClass == Double.class) { return RubyFloat.newFloat(ruby, ((Number) object).doubleValue()); } else if (javaClass == Character.class) { return RubyFixnum.newFixnum(ruby, ((Character) object).charValue()); } else if (Number.class.isAssignableFrom(javaClass)) { return RubyFixnum.newFixnum(ruby, ((Number) object).longValue()); } else if (javaClass == String.class) { return RubyString.newString(ruby, object.toString()); } else if (javaClass.isArray()) { Class arrayClass = javaClass.getComponentType(); int len = Array.getLength(object); RubyObject[] items = new RubyObject[len]; for (int i = 0; i < len; i++) { items[i] = convertJavaToRuby(ruby, Array.get(object, i)); } return RubyArray.newArray(ruby, items); } else if (List.class.isAssignableFrom(javaClass)) { int len = ((List) object).size(); RubyObject[] items = new RubyObject[len]; for (int i = 0; i < len; i++) { items[i] = convertJavaToRuby(ruby, ((List) object).get(i)); } return RubyArray.newArray(ruby, items); } else if (Map.class.isAssignableFrom(javaClass)) { int len = ((Map) object).size(); RubyObject[] items = new RubyObject[len * 2]; Iterator iter = ((Map) object).entrySet().iterator(); for (int i = 0; i < len; i++) { Map.Entry entry = (Map.Entry) iter.next(); items[2 * i] = convertJavaToRuby(ruby, entry.getKey()); items[2 * i + 1] = convertJavaToRuby(ruby, entry.getValue()); } return RubyHash.create(ruby, null, items); } else { return new RubyJavaObject(ruby, (RubyClass)ruby.getJavaSupport().loadClass(javaClass, null), object); } }
3,234,315
public String toString(){ return "SemanticTypeOutput"+(semanticTypeOutputId==null ? ":Hash"+this.hashCode() : ":"+semanticTypeOutputId); }
public String toString(){ return "SemanticTypeOutput"+(semanticTypeOutputId==null ? ":Hash_"+this.hashCode() : ":Id_"+semanticTypeOutputId); }
3,234,316
protected void propagateHiddenValues(IObject from, IObject to) { secSys.copyToken(from,to); if ( from.getDetails().filteredSize() > 0 ) { to.getDetails().addFiltered(from.getDetails().filteredSet()); } }
protected void propagateHiddenValues(IObject from, IObject to) { secSys.copyToken(from,to); if ( from.getDetails().filteredSize() > 0 ) { to.getDetails().addFiltered(from.getDetails().filteredSet()); } }
3,234,317
public void generate(JFormatter f) { f.p(value.getName().replace('$', '.')); f.p(".class"); }
public void generate(JFormatter f) { f.p(value.getName().replace('$', '.')); f.p(".class"); }
3,234,321
final public boolean setProperty(final Object[] names, final Object value) throws PropertyException, ContextException { if (names.length == 0) { return false; } else if (_bean == null) { return setLocal(names, value) || setTool(names, value); } else { return PropertyOperator.setProperty(this,_bean,names,value); } }
final public boolean setProperty(final Object[] names, final Object value) throws PropertyException, ContextException { if (names.length == 0) { return false; } else if (_bean == null) { return setLocal(names, value) || setTool(names, value); } else { return PropertyOperator.setProperty(this,_bean,names,value) || setTool(names, value); } }
3,234,322
public void propertyChange(PropertyChangeEvent pce) { String propName = pce.getPropertyName(); if (Browser.POPUP_POINT_PROPERTY.equals(propName)) { Browser browser = model.getBrowser(); if (browser == null) return; ImageDisplay d = browser.getLastSelectedDisplay(); Point p = browser.getPopupPoint(); if (d != null && p != null) view.showPopup(d, p); } else if (Browser.THUMB_SELECTED_PROPERTY.equals(propName)) { ImageNode d = (ImageNode) pce.getNewValue(); if (d != null) ThumbWinManager.display(d, model); } else if (Browser.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; Browser browser = model.getBrowser(); if (browser == null) return; ImageDisplay d = browser.getLastSelectedDisplay(); treeView.accept(new SelectedNodeVisitor(treeView, d)); } else if (TreeView.TREE_POPUP_POINT_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Point p = treeView.getPopupPoint(); if (p != null) view.showPopup(((JComponent) pce.getNewValue()), p); } else if (TreeView.CLOSE_PROPERTY.equals(propName)) { model.showTreeView(false); } else if (TreeView.TREE_SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Browser browser = model.getBrowser(); ImageDisplay img = (ImageDisplay) pce.getNewValue(); if (img != null) { if (!(img.equals(browser.getLastSelectedDisplay()))) browser.setSelectedDisplay(img); } else browser.setSelectedDisplay(img); } else if (HiViewer.SCROLL_TO_NODE_PROPERTY.equals(propName)) { scrollToNode((ImageDisplay) pce.getNewValue()); } else if (Browser.ANNOTATED_NODE_PROPERTY.equals(propName)) { ImageDisplay n = (ImageDisplay) pce.getNewValue(); model.getClipBoard().setSelectedPane(ClipBoard.ANNOTATION_PANE, n); model.getBrowser().setSelectedDisplay(n); } else if (Browser.CLASSIFIED_NODE_PROPERTY.equals(propName)) { ImageDisplay n = (ImageDisplay) pce.getNewValue(); model.getClipBoard().setSelectedPane(ClipBoard.CLASSIFICATION_PANE, n); model.getBrowser().setSelectedDisplay(n); } else if (Browser.ROLL_OVER_PROPERTY.equals(propName)) { if (model.isRollOver()) { ImageDisplay n = (ImageDisplay) pce.getNewValue(); if (n instanceof ImageNode) ThumbWinManager.rollOverDisplay((ImageNode) n, model.getBrowser()); else ThumbWinManager.rollOverDisplay(null, model.getBrowser()); } } else if (TreeView.REMOVE_ROLL_OVER_PROPERTY.equals(propName) || ClipBoard.REMOVE_ROLL_OVER_PROPERTY.equals(propName)) { if (model.isRollOver()) { ThumbWinManager.rollOverDisplay(null, model.getBrowser()); } } else if (propName.equals(DataHandler.ANNOTATED_PROPERTY)) { if (view.getDataHandler() == null) return; model.onDataObjectSave((List) pce.getNewValue()); view.discardDataHandler(); } else if (propName.equals(DataHandler.CLASSIFIED_PROPERTY)) { if (view.getDataHandler() == null) return; model.onDataObjectSave((List) pce.getNewValue()); view.discardDataHandler(); } }
public void propertyChange(PropertyChangeEvent pce) { String propName = pce.getPropertyName(); if (Browser.POPUP_POINT_PROPERTY.equals(propName)) { Browser browser = model.getBrowser(); if (browser == null) return; ImageDisplay d = browser.getLastSelectedDisplay(); Point p = browser.getPopupPoint(); if (d != null && p != null) view.showPopup(d, p); } else if (Browser.THUMB_SELECTED_PROPERTY.equals(propName)) { ImageNode d = (ImageNode) pce.getNewValue(); if (d != null) ThumbWinManager.display(d, model); } else if (Browser.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; Browser browser = model.getBrowser(); if (browser == null) return; ImageDisplay d = browser.getLastSelectedDisplay(); treeView.accept(new SelectedNodeVisitor(treeView, d)); } else if (TreeView.TREE_POPUP_POINT_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Point p = treeView.getPopupPoint(); if (p != null) view.showPopup(((JComponent) pce.getNewValue()), p); } else if (TreeView.CLOSE_PROPERTY.equals(propName)) { model.showTreeView(false); } else if (TreeView.TREE_SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Browser browser = model.getBrowser(); ImageDisplay img = (ImageDisplay) pce.getNewValue(); if (img != null) { if (!(img.equals(browser.getLastSelectedDisplay()))) browser.setSelectedDisplay(img); } else browser.setSelectedDisplay(img); } else if (HiViewer.SCROLL_TO_NODE_PROPERTY.equals(propName)) { scrollToNode((ImageDisplay) pce.getNewValue()); } else if (Browser.ANNOTATED_NODE_PROPERTY.equals(propName)) { ImageDisplay n = (ImageDisplay) pce.getNewValue(); model.getClipBoard().setSelectedPane(ClipBoard.ANNOTATION_PANE, n); model.getBrowser().setSelectedDisplay(n); } else if (Browser.CLASSIFIED_NODE_PROPERTY.equals(propName)) { ImageDisplay n = (ImageDisplay) pce.getNewValue(); model.getClipBoard().setSelectedPane(ClipBoard.CLASSIFICATION_PANE, n); model.getBrowser().setSelectedDisplay(n); } else if (Browser.ROLL_OVER_PROPERTY.equals(propName)) { if (model.isRollOver()) { ImageDisplay n = (ImageDisplay) pce.getNewValue(); if (n instanceof ImageNode) ThumbWinManager.rollOverDisplay((ImageNode) n, model.getBrowser()); else ThumbWinManager.rollOverDisplay(null, model.getBrowser()); } } else if (TreeView.REMOVE_ROLL_OVER_PROPERTY.equals(propName) || ClipBoard.REMOVE_ROLL_OVER_PROPERTY.equals(propName)) { if (model.isRollOver()) { ThumbWinManager.rollOverDisplay(null, model.getBrowser()); } } else if (propName.equals(DataHandler.ANNOTATED_PROPERTY)) { if (view.getDataHandler() == null) return; if (pce.getNewValue() != null) { Set set = (Set) pce.getNewValue(); List l = new ArrayList(set.size()); Iterator i = set.iterator(); while (i.hasNext()) l.add( i.next()); model.onDataObjectSave(l); } view.discardDataHandler(); } else if (propName.equals(DataHandler.CLASSIFIED_PROPERTY)) { if (view.getDataHandler() == null) return; if (pce.getNewValue() != null) { Set set = (Set) pce.getNewValue(); List l = new ArrayList(set.size()); Iterator i = set.iterator(); while (i.hasNext()) l.add( i.next()); model.onDataObjectSave(l); } view.discardDataHandler(); } }
3,234,323
public IRubyObject convertToType(String targetType, String convertMethod, boolean raise) { // No need to convert something already of the correct type. // XXXEnebo - Could this pass actual class reference instead of String? if (targetType.equals(getMetaClass().getName())) { return this; } if (!respondsTo(convertMethod)) { if (raise) { throw getRuntime().newTypeError( "cannot convert " + getMetaClass().getName() + " into " + targetType); // FIXME nil, true and false instead of NilClass, TrueClass, FalseClass; } return getRuntime().getNil(); } return callMethod(getRuntime().getCurrentContext(), convertMethod); }
public IRubyObject convertToType(String targetType, String convertMethod, boolean raise) { // No need to convert something already of the correct type. // XXXEnebo - Could this pass actual class reference instead of String? if (targetType.equals(getMetaClass().getName())) { return this; } if (!respondsTo(convertMethod)) { if (raise) { throw getRuntime().newTypeError( "can't convert " + trueFalseNil(getMetaClass().getName()) + " into " + trueFalseNil(targetType)); // FIXME nil, true and false instead of NilClass, TrueClass, FalseClass; } return getRuntime().getNil(); } return callMethod(getRuntime().getCurrentContext(), convertMethod); }
3,234,324
public RubyClass newSubClass(String name, RubyModule parent) { return new HashMetaClass(name, this, parent); }
public RubyClass newSubClass(String name, RubyModule parent) { return new HashMetaClass(name, this, parent); }
3,234,325
public RubyArray instance_variables() { ArrayList names = new ArrayList(); for(Iterator iter = getInstanceVariablesSnapshot().keySet().iterator();iter.hasNext();) { names.add(getRuntime().newString((String)iter.next())); } return getRuntime().newArray(names); }
public RubyArray instance_variables() { ArrayList names = new ArrayList(); for(Iterator iter = getInstanceVariablesSnapshot().keySet().iterator();iter.hasNext();) { String name = (String) iter.next(); if (!Character.isUpperCase(name.charAt(0))) { names.add(getRuntime().newString(name)); } } return getRuntime().newArray(names); }
3,234,326
public void addClassData(ClassData classData) { LOGGER.debug("ProjectData.addClassData: " + classData.getName()); String packageName = classData.getPackageName(); PackageData packageData = (PackageData)children.get(packageName); if (packageData == null) { packageData = new PackageData(packageName); // Each key is a package name, stored as an String object. // Each value is information about the package, stored as a PackageData object. this.children.put(packageName, packageData); } packageData.addClassData(classData); }
public void addClassData(ClassData classData) { LOGGER.debug("ProjectData.addClassData: " + classData.getName()); String packageName = classData.getPackageName(); PackageData packageData = (PackageData)children.get(packageName); if (packageData == null) { packageData = new PackageData(packageName); // Each key is a package name, stored as an String object. // Each value is information about the package, stored as a PackageData object. this.children.put(packageName, packageData); } packageData.addClassData(classData); }
3,234,327
public ClassData getClassData(String name) { for (Iterator it = children.values().iterator(); it.hasNext(); ) { PackageData packageData = (PackageData) it.next(); ClassData classData = packageData.getClassData(name); if (classData != null) { return classData; } } return null; }
public ClassData getClassData(String name) { for (Iterator it = children.values().iterator(); it.hasNext(); ) { PackageData packageData = (PackageData) it.next(); ClassData classData = packageData.getClassData(name); if (classData != null) { return classData; } } return null; }
3,234,329
public ArgsNode(ISourcePosition position, int argsCount, ListNode optArgs, int restArg, BlockArgNode blockArgNode) { super(position); this.argsCount = argsCount; this.optArgs = optArgs; this.restArg = restArg; this.blockArgNode = blockArgNode; }
public ArgsNode(ISourcePosition position, ListNode arguments, ListNode optionalArguments, int restArguments, BlockArgNode blockArgNode) { super(position); this.argsCount = argsCount; this.optArgs = optArgs; this.restArg = restArg; this.blockArgNode = blockArgNode; }
3,234,331
public ArgsNode(ISourcePosition position, int argsCount, ListNode optArgs, int restArg, BlockArgNode blockArgNode) { super(position); this.argsCount = argsCount; this.optArgs = optArgs; this.restArg = restArg; this.blockArgNode = blockArgNode; }
public ArgsNode(ISourcePosition position, int argsCount, ListNode optArgs, int restArg, BlockArgNode blockArgNode) { super(position); this.argsCount = argsCount; this.optArgs = optArgs; this.restArg = restArg; this.blockArgNode = blockArgNode; }
3,234,332
public List childNodes() { return Node.createList(optArgs, blockArgNode); }
public List childNodes() { return Node.createList(arguments, optArgs, blockArgNode); }
3,234,333
private void setBrowserSize() { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); browserW = 7*(screenSize.width/10); }
private void setBrowserSize() { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); browserW = 8*(screenSize.width/10); System.out.println("browser: "+browserW); }
3,234,334
private void visitContainerNode(ImageSet node) { //Then figure out the number of columns, which is the same as the //number of rows. int n = node.getChildrenDisplay().size(); if (n == 0) { //node with no child node.getInternalDesktop().setPreferredSize( node.getTitleBar().getMinimumSize()); node.setVisible(true); return; } //Finally do layout. ImageDisplay[] children = LayoutUtils.sortChildrenByPrefWidth(node, false); Dimension d; int maxY = 0; int x = 0, y = 0; for (int i = 0; i < children.length; i++) { d = children[i].getPreferredSize(); children[i].setBounds(x, y, d.width, d.height); children[i].setVisible(true); children[i].setCollapsed(false); if (x+d.width <= browserW) { x += d.width; maxY = Math.max(maxY, d.height); } else { x = 0; y += maxY; maxY = 0; } } Rectangle bounds = node.getContentsBounds(); d = bounds.getSize(); node.getInternalDesktop().setPreferredSize(d); node.setCollapsed(false); node.setVisible(true); }
private void visitContainerNode(ImageSet node) { //Then figure out the number of columns, which is the same as the //number of rows. int n = node.getChildrenDisplay().size(); if (n == 0) { //node with no child node.getInternalDesktop().setPreferredSize( node.getTitleBar().getMinimumSize()); node.setVisible(true); return; } //Finally do layout. ImageDisplay[] children = LayoutUtils.sortChildrenByPrefWidth(node, false); Dimension d; int maxY = 0; int x = 0, y = 0; for (int i = 0; i < children.length; i++) { d = children[i].getPreferredSize(); children[i].setBounds(x, y, d.width, d.height); children[i].setVisible(true); children[i].setCollapsed(false); if (x+d.width <= browserW) { x += d.width; maxY = Math.max(maxY, d.height); } else { x = 0; if (maxY == 0) y += d.height; else y += maxY; maxY = 0; } } Rectangle bounds = node.getContentsBounds(); d = bounds.getSize(); node.getInternalDesktop().setPreferredSize(d); node.setCollapsed(false); node.setVisible(true); }
3,234,335
public void initialize() { soundPreference = new SoundPreference(); SparkManager.getPreferenceManager().addPreference(soundPreference); SparkManager.getChatManager().addChatRoomListener(this); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getType() == Presence.Type.unavailable) { SoundPreferences preferences = soundPreference.getPreferences(); if (preferences != null && preferences.isPlayOfflineSound()) { String offline = preferences.getOfflineSound(); File offlineFile = new File(offline); SparkManager.getSoundManager().playClip(offlineFile); } } } }, new PacketTypeFilter(Presence.class)); Thread thread = new Thread(new Runnable() { public void run() { soundPreference.loadFromFile(); } }); thread.start(); }
public void initialize() { soundPreference = new SoundPreference(); SparkManager.getPreferenceManager().addPreference(soundPreference); SparkManager.getChatManager().addChatRoomListener(this); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getType() == Presence.Type.unavailable) { SoundPreferences preferences = soundPreference.getPreferences(); if (preferences != null && preferences.isPlayOfflineSound()) { String offline = preferences.getOfflineSound(); File offlineFile = new File(offline); SparkManager.getSoundManager().playClip(offlineFile); } } } }, new PacketTypeFilter(Presence.class)); Thread thread = new Thread(new Runnable() { public void run() { soundPreference.loadFromFile(); } }); thread.start(); }
3,234,336
public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getType() == Presence.Type.unavailable) { SoundPreferences preferences = soundPreference.getPreferences(); if (preferences != null && preferences.isPlayOfflineSound()) { String offline = preferences.getOfflineSound(); File offlineFile = new File(offline); SparkManager.getSoundManager().playClip(offlineFile); } } }
public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getType() == Presence.Type.unavailable) { SoundPreferences preferences = soundPreference.getPreferences(); if (preferences != null && preferences.isPlayOfflineSound()) { String offline = preferences.getOfflineSound(); File offlineFile = new File(offline); SparkManager.getSoundManager().playClip(offlineFile); } } }
3,234,337
void setViews(Set nodes, boolean reload) { DefaultTreeModel dtm = (DefaultTreeModel) treeDisplay.getModel(); TreeImageDisplay root = (TreeImageDisplay) dtm.getRoot(); root.removeAllChildren(); root.setChildrenLoaded(Boolean.TRUE); dtm.reload(); if (nodes.size() != 0) { Iterator i = nodes.iterator(); while (i.hasNext()) root.addChildDisplay((TreeImageDisplay) i.next()) ; buildTreeNode(root, sorter.sort(nodes), (DefaultTreeModel) treeDisplay.getModel()); if (!reload) reload = reloadRoot; reloadRoot = true; } else buildEmptyNode(root); if (reload) dtm.reload(root); if (!model.isMainTree()) loadGoIntoTree(); }
void setViews(Set nodes, boolean reload) { DefaultTreeModel dtm = (DefaultTreeModel) treeDisplay.getModel(); TreeImageDisplay root = (TreeImageDisplay) dtm.getRoot(); root.removeAllChildren(); root.setChildrenLoaded(Boolean.TRUE); dtm.reload(); if (nodes.size() != 0) { Iterator i = nodes.iterator(); while (i.hasNext()) root.addChildDisplay((TreeImageDisplay) i.next()) ; buildTreeNode(root, sorter.sort(nodes), (DefaultTreeModel) treeDisplay.getModel()); if (!reload) reload = reloadRoot; } else buildEmptyNode(root); if (reload) dtm.reload(root); if (!model.isMainTree()) loadGoIntoTree(); }
3,234,341
public RubyFixnum arity() { if (method instanceof EvaluateMethod) { if (((EvaluateMethod)method).getNode() instanceof AttrSetNode) { return RubyFixnum.one(getRuby()); } else if (((EvaluateMethod)method).getNode() instanceof InstVarNode) { return RubyFixnum.zero(getRuby()); }/* } else if (method instanceof RubyMethod) { // FIXME INode body = bodyNode.getNextNode(); if (body instanceof BlockNode) { body = body.getHeadNode(); } if (body == null) { return RubyFixnum.zero(getRuby()); } int n = body.getCount(); if (body.getOptNode() != null || body.getRest() != -1) { n = -n-1; } return RubyFixnum.newFixnum(getRuby(), n); */ } return RubyFixnum.newFixnum(getRuby(), -1); }
public RubyFixnum arity() { if (method instanceof EvaluateMethod) { if (((EvaluateMethod) method).getNode() instanceof AttrSetNode) { return RubyFixnum.one(getRuby()); } else if (((EvaluateMethod)method).getNode() instanceof InstVarNode) { return RubyFixnum.zero(getRuby()); }/* } else if (method instanceof RubyMethod) { // FIXME INode body = bodyNode.getNextNode(); if (body instanceof BlockNode) { body = body.getHeadNode(); } if (body == null) { return RubyFixnum.zero(getRuby()); } int n = body.getCount(); if (body.getOptNode() != null || body.getRest() != -1) { n = -n-1; } return RubyFixnum.newFixnum(getRuby(), n); */ } return RubyFixnum.newFixnum(getRuby(), -1); }
3,234,343
public RubyFixnum arity() { if (method instanceof EvaluateMethod) { if (((EvaluateMethod)method).getNode() instanceof AttrSetNode) { return RubyFixnum.one(getRuby()); } else if (((EvaluateMethod)method).getNode() instanceof InstVarNode) { return RubyFixnum.zero(getRuby()); }/* } else if (method instanceof RubyMethod) { // FIXME INode body = bodyNode.getNextNode(); if (body instanceof BlockNode) { body = body.getHeadNode(); } if (body == null) { return RubyFixnum.zero(getRuby()); } int n = body.getCount(); if (body.getOptNode() != null || body.getRest() != -1) { n = -n-1; } return RubyFixnum.newFixnum(getRuby(), n); */ } return RubyFixnum.newFixnum(getRuby(), -1); }
public RubyFixnum arity() { if (method instanceof EvaluateMethod) { if (((EvaluateMethod)method).getNode() instanceof AttrSetNode) { return RubyFixnum.one(getRuby()); } else if (((EvaluateMethod) method).getNode() instanceof InstVarNode) { return RubyFixnum.zero(getRuby()); }/* } else if (method instanceof RubyMethod) { // FIXME INode body = bodyNode.getNextNode(); if (body instanceof BlockNode) { body = body.getHeadNode(); } if (body == null) { return RubyFixnum.zero(getRuby()); } int n = body.getCount(); if (body.getOptNode() != null || body.getRest() != -1) { n = -n-1; } return RubyFixnum.newFixnum(getRuby(), n); */ } return RubyFixnum.newFixnum(getRuby(), -1); }
3,234,344
public RubyFixnum arity() { if (method instanceof EvaluateMethod) { if (((EvaluateMethod)method).getNode() instanceof AttrSetNode) { return RubyFixnum.one(getRuby()); } else if (((EvaluateMethod)method).getNode() instanceof InstVarNode) { return RubyFixnum.zero(getRuby()); }/* } else if (method instanceof RubyMethod) { // FIXME INode body = bodyNode.getNextNode(); if (body instanceof BlockNode) { body = body.getHeadNode(); } if (body == null) { return RubyFixnum.zero(getRuby()); } int n = body.getCount(); if (body.getOptNode() != null || body.getRest() != -1) { n = -n-1; } return RubyFixnum.newFixnum(getRuby(), n); */ } return RubyFixnum.newFixnum(getRuby(), -1); }
public RubyFixnum arity() { if (method instanceof EvaluateMethod) { if (((EvaluateMethod)method).getNode() instanceof AttrSetNode) { return RubyFixnum.one(getRuby()); } else if (((EvaluateMethod)method).getNode() instanceof InstVarNode) { return RubyFixnum.zero(getRuby()); }/* } else if (method instanceof RubyMethod) { // FIXME INode body = bodyNode.getNextNode(); if (body instanceof BlockNode) { body = body.getHeadNode(); } if (body == null) { return RubyFixnum.zero(getRuby()); } int n = body.getCount(); if (body.getOptNode() != null || body.getRest() != -1) { n = -n-1; } return RubyFixnum.newFixnum(getRuby(), n); */ } return RubyFixnum.newFixnum(getRuby(), -1); }
3,234,345
public RubyObject call(RubyObject[] args) { getRuby().getIterStack().push( getRuby().isBlockGiven() ? Iter.ITER_PRE : Iter.ITER_NOT); RubyObject result = getReceiverClass().call0( getReceiver(), getMethodId(), new RubyPointer(args), getMethod(), false); getRuby().getIterStack().pop(); return result; }
public RubyObject call(RubyObject[] args) { getRuby().getIterStack().push( getRuby().isBlockGiven() ? Iter.ITER_PRE : Iter.ITER_NOT); RubyObject result = getReceiverClass().call0( getReceiver(), getMethodId(), new RubyPointer(args), getMethod(), false); getRuby().getIterStack().pop(); return result; }
3,234,347
public static RubyClass createMethodClass(Ruby ruby) { Callback arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); Callback call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); return methodClass; }
public static RubyClass createMethodClass(Ruby ruby) { Callback arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); Callback call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); return methodClass; }
3,234,348
public static RubyClass createMethodClass(Ruby ruby) { Callback arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); Callback call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); return methodClass; }
public static RubyClass createMethodClass(Ruby ruby) { Callback arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); Callback call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); return methodClass; }
3,234,349
public CollectionCountQueryDefinition(QueryParameter...parameters) { super(parameters); }
public CollectionCountQueryDefinition(QueryParameter...parameters) { super( defs, parameters ); }
3,234,350
public void addUser() { try { String selectedUser = view.getSelectedUser(); if (selectedUser == null) { view.showErrorMessage("Please select a user to add."); return; } if (!model.findUserByName(selectedUser)) { return; } String groupSelected = view.getSelectedGroup(); if (groupSelected == null) { view .showErrorMessage("Please select the group you wish add to user."); return; } if (!model.findGroupByName(groupSelected)) { return; } model.addGroupToUser(model.getCurrentGroupID()); view.setGroupDetails(model.getCurrentGroup()); // view.refresh(); view.refreshMembershipList(); } catch (Exception e) { handleException(e, "add user to a group"); } }
public void addUser() { try { String selectedUser = view.getSelectedUser(); if (selectedUser == null) { view.showErrorMessage("Please select a user to add."); return; } if (!model.findUserByName(selectedUser)) { return; } String groupSelected = view.getSelectedGroup(); if (groupSelected == null) { view .showErrorMessage("Please select the group you " + "wish add to user."); return; } if (!model.findGroupByName(groupSelected)) { return; } model.addGroupToUser(model.getCurrentGroupID()); view.setGroupDetails(model.getCurrentGroup()); // view.refresh(); view.refreshMembershipList(); } catch (Exception e) { handleException(e, "add user to a group"); } }
3,234,351
public void removeUser() { try { String selectedUser = view.getSelectedMember(); if (selectedUser == null) { view.showErrorMessage("Please select a user to remove."); return; } if (!model.findUserByName(selectedUser)) { return; } String groupSelected = view.getSelectedGroup(); if (groupSelected == null) { view .showErrorMessage("Please select a group to remove from user."); return; } if (!model.findGroupByName(groupSelected)) { return; } model.removeGroupFromUser(model.getCurrentGroupID()); view.setGroupDetails(model.getCurrentGroup()); view.refreshMembershipList(); } catch (Exception e) { handleException(e, "save current group"); } }
public void removeUser() { try { String selectedUser = view.getSelectedMember(); if (selectedUser == null) { view.showErrorMessage("Please select a user to remove."); return; } if (!model.findUserByName(selectedUser)) { return; } String groupSelected = view.getSelectedGroup(); if (groupSelected == null) { view .showErrorMessage("Please select a group to remove " + "from user."); return; } if (!model.findGroupByName(groupSelected)) { return; } model.removeGroupFromUser(model.getCurrentGroupID()); view.setGroupDetails(model.getCurrentGroup()); view.refreshMembershipList(); } catch (Exception e) { handleException(e, "save current group"); } }
3,234,352
public static RubyClass createFixnum(Ruby ruby) { // HACK +++ // todo: change Numeric to Integer RubyClass fixnumClass = ruby.defineClass("Fixnum", (RubyClass)ruby.getRubyClass("Numeric")); // HACK --- fixnumClass.defineMethod("to_i", getMethodToI()); fixnumClass.defineMethod("to_s", getMethodToS()); fixnumClass.defineMethod("+", getMethodPlus()); fixnumClass.defineMethod("-", getMethodMinus()); fixnumClass.defineMethod("*", getMethodMul()); fixnumClass.defineMethod("/", getMethodDiv()); fixnumClass.defineMethod("%", getMethodMod()); fixnumClass.defineMethod("**", getMethodPow()); fixnumClass.defineMethod("==", getMethodEqual()); fixnumClass.defineMethod("<=>", getMethodCmp()); fixnumClass.defineMethod(">", getMethodGt()); fixnumClass.defineMethod(">=", getMethodGe()); fixnumClass.defineMethod("<", getMethodLt()); fixnumClass.defineMethod("<=", getMethodLe()); return fixnumClass; }
public static RubyClass createFixnum(Ruby ruby) { // HACK +++ // todo: change Numeric to Integer RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getIntegerClass()); // HACK --- fixnumClass.defineMethod("to_i", getMethodToI()); fixnumClass.defineMethod("to_s", getMethodToS()); fixnumClass.defineMethod("+", getMethodPlus()); fixnumClass.defineMethod("-", getMethodMinus()); fixnumClass.defineMethod("*", getMethodMul()); fixnumClass.defineMethod("/", getMethodDiv()); fixnumClass.defineMethod("%", getMethodMod()); fixnumClass.defineMethod("**", getMethodPow()); fixnumClass.defineMethod("==", getMethodEqual()); fixnumClass.defineMethod("<=>", getMethodCmp()); fixnumClass.defineMethod(">", getMethodGt()); fixnumClass.defineMethod(">=", getMethodGe()); fixnumClass.defineMethod("<", getMethodLt()); fixnumClass.defineMethod("<=", getMethodLe()); return fixnumClass; }
3,234,354
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); final Iterator bookmarkLinks = bookmarkedLinks.iterator(); while (bookmarkLinks.hasNext()) { final BookmarkedURL link = (BookmarkedURL)bookmarkLinks.next(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
3,234,355
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
3,234,356
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
3,234,357
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
3,234,358
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); final Iterator bookmarkLinks = bookmarkedLinks.iterator(); while (bookmarkLinks.hasNext()) { final BookmarkedURL link = (BookmarkedURL)bookmarkLinks.next(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
3,234,359
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
3,234,360
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
3,234,361
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
3,234,362
private void drawBorder(Graphics2D g) { Color borderColour; borderColour = gradientStartRGB.brighter(); // Set the colour of the top, left bevels to be a lighter colour // than the gradient at that same corner. g.setPaint(borderColour); // Draw the bevel, it is drawn as four line from: topleft to // topright, and topleft to bottom left. g.drawLine(0, 0, 0, (int) buttonRect.getHeight()); g.drawLine(0, 0, (int) buttonRect.getWidth(), 0); g.drawLine(1, 1, 1, (int) buttonRect.getHeight()-1); g.drawLine(1, 1, (int) buttonRect.getWidth()-1, 1); borderColour = gradientEndRGB.darker(); // Set the colour of the top, left bevels to be a lighter colour // than the gradient at that same corner. g.setPaint(borderColour); // Draw the bevel, it is drawn as four line from: bottomleft to // bottom right, and bottomright to top left. g.drawLine((int) buttonRect.getWidth()-1, 0, (int) buttonRect.getWidth()-1, (int) buttonRect.getHeight()-1); g.drawLine(0, (int) buttonRect.getHeight()-1, (int) buttonRect.getWidth()-1, (int) buttonRect.getHeight()-1); g.drawLine((int) buttonRect.getWidth()-2, 2, (int) buttonRect.getWidth()-2, (int) buttonRect.getHeight()-2); g.drawLine(1, (int) buttonRect.getHeight()-2, (int) buttonRect.getWidth()-1, (int) buttonRect.getHeight()-2); }
privatevoiddrawBorder(Graphics2Dg){ColorborderColour;borderColour=gradientStartRGB.brighter();//Setthecolourofthetop,leftbevelstobealightercolour//thanthegradientatthatsamecorner.g.setPaint(borderColour);//Drawthebevel,itisdrawnasfourlinefrom:topleftto//topright,andtoplefttobottomleft.g.drawLine(0,0,0,(int)buttonRect.getHeight());g.drawLine(0,0,(int)buttonRect.getWidth(),0);g.drawLine(1,1,1,(int)buttonRect.getHeight()-1);g.drawLine(1,1,(int)buttonRect.getWidth()-1,1);borderColour=gradientEndRGB.darker();//Setthecolourofthetop,leftbevelstobealightercolour//thanthegradientatthatsamecorner.g.setPaint(borderColour);//Drawthebevel,itisdrawnasfourlinefrom:bottomleftto//bottomright,andbottomrighttotopleft.g.drawLine((int)buttonRect.getWidth()-1,0,(int)buttonRect.getWidth()-1,(int)buttonRect.getHeight()-1);g.drawLine(0,(int)buttonRect.getHeight()-1,(int)buttonRect.getWidth()-1,(int)buttonRect.getHeight()-1);g.drawLine((int)buttonRect.getWidth()-2,2,(int)buttonRect.getWidth()-2,(int)buttonRect.getHeight()-2);g.drawLine(1,(int)buttonRect.getHeight()-2,(int)buttonRect.getWidth()-1,(int)buttonRect.getHeight()-2);}
3,234,363
private void paintSquareButton(Graphics2D g) { // Calculate the colours to use to the extreme ends of the gradient. setGradientColours(); // If the button is selected draw selected button face. // Check to see if it's greyed out, if not draw border else // draw mask and draw the grey mask selected border. if (button.isSelected()) { drawSelectedButtonFace(g); if (!greyedOut) drawSelectedBorder(g); else { drawGreyMask(g); drawGreySelectedBorder(g); } } else { // If the button is not selected draw unselected button face. // Check to see if it's greyed out, if not draw border else // draw mask and draw the grey mask unselected border. drawButtonFace(g); if (!greyedOut) drawBorder(g); else { drawGreyMask(g); drawGreyBorder(g); } } // Draw text in centre of button. drawText(g); }
private void paintSquareButton(Graphics2D g) { // Calculate the colours to use to the extreme ends of the gradient. setGradientColours(); // If the button is selected draw selected button face. // Check to see if it's greyed out, if not draw border else // draw mask and draw the grey mask selected border. if (button.isSelected()) { drawSelectedButtonFace(g); if (!greyedOut) drawSelectedBorder(g); else { drawGreyMask(g); drawGreySelectedBorder(g); } } else { // If the button is not selected draw unselected button face. // Check to see if it's greyed out, if not draw border else // draw mask and draw the grey mask unselected border. drawButtonFace(g); if (!greyedOut) drawBorder(g); else { drawGreyMask(g); drawGreyBorder(g); } } // Draw text in centre of button. drawText(g); }
3,234,364
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if(topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.3f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 0.7f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.7f); gradientEndRGB = gradientEndHSV.toColorA(); }
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if(topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.3f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 0.7f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.7f); gradientEndRGB = gradientEndHSV.toColorA(); }
3,234,365
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if(topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.3f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 0.7f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.7f); gradientEndRGB = gradientEndHSV.toColorA(); }
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if (topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.3f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 0.7f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.7f); gradientEndRGB = gradientEndHSV.toColorA(); }
3,234,366
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if(topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.3f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 0.7f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.7f); gradientEndRGB = gradientEndHSV.toColorA(); }
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if(topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.3f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 1.0f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.7f); gradientEndRGB = gradientEndHSV.toColorA(); }
3,234,367
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if(topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.3f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 0.7f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.7f); gradientEndRGB = gradientEndHSV.toColorA(); }
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if(topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.3f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 0.7f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 1.0f); gradientEndRGB = gradientEndHSV.toColorA(); }
3,234,368
public Node logop(/*node_type*/ int type, Node left, Node right) { value_expr(left); // return nf.newDefaultNode(type, cond1(left, 1), cond1(right, 1), null); throw new RuntimeException("[BUG] ParserHelper#logop: Nodetype=" + type); }
public Node logop(int type, Node left, Node right) { value_expr(left); // return nf.newDefaultNode(type, cond1(left, 1), cond1(right, 1), null); throw new RuntimeException("[BUG] ParserHelper#logop: Nodetype=" + type); }
3,234,369
public Node logop(/*node_type*/ int type, Node left, Node right) { value_expr(left); // return nf.newDefaultNode(type, cond1(left, 1), cond1(right, 1), null); throw new RuntimeException("[BUG] ParserHelper#logop: Nodetype=" + type); }
public Node logop(/*node_type*/ int type, Node left, Node right) { value_expr(left); // return nf.newDefaultNode(type, cond1(left, 1), cond1(right, 1), null); }
3,234,370
FindRegExAnnotationVisitor(HiViewer viewer, String regEx) { super(viewer, regEx); colors = Colors.getInstance(); }
FindRegExAnnotationVisitor(HiViewer viewer, Pattern pattern) { super(viewer, regEx); colors = Colors.getInstance(); }
3,234,373
FindRegExAnnotationVisitor(HiViewer viewer, String regEx) { super(viewer, regEx); colors = Colors.getInstance(); }
FindRegExAnnotationVisitor(HiViewer viewer, String regEx) { super(viewer, pattern); colors = Colors.getInstance(); }
3,234,374
public ReflectionCallback( Class type, String methodName, Class[] argumentTypes, boolean isRestArgs, boolean isStaticMethod, Arity arity) { super(type, methodName, argumentTypes, isRestArgs, isStaticMethod, arity); if (isStaticMethod) { Class[] types = new Class[argumentTypes.length + 1]; System.arraycopy(argumentTypes, 0, types, 1, argumentTypes.length); types[0] = IRubyObject.class; argumentTypes = types; } try { this.method = type.getMethod(methodName, argumentTypes); } catch (NoSuchMethodException e) { throw new RuntimeException( "NoSuchMethodException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } catch (SecurityException e) { throw new RuntimeException( "SecurityException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } }
public ReflectionCallback( Class type, String methodName, Class[] argumentTypes, boolean isRestArgs, boolean isStaticMethod, Arity arity) { super(type, methodName, argumentTypes, isRestArgs, isStaticMethod, arity); if (isStaticMethod) { Class[] types = new Class[argumentTypes.length + 1]; System.arraycopy(argumentTypes, 0, types, 1, argumentTypes.length); types[0] = IRubyObject.class; argumentTypes = types; } try { this.method = type.getMethod(methodName, argumentTypes); } catch (NoSuchMethodException e) { throw new RuntimeException( "NoSuchMethodException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } catch (SecurityException e) { throw new RuntimeException( "SecurityException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } }
3,234,375
public ReflectionCallback( Class type, String methodName, Class[] argumentTypes, boolean isRestArgs, boolean isStaticMethod, Arity arity) { super(type, methodName, argumentTypes, isRestArgs, isStaticMethod, arity); if (isStaticMethod) { Class[] types = new Class[argumentTypes.length + 1]; System.arraycopy(argumentTypes, 0, types, 1, argumentTypes.length); types[0] = IRubyObject.class; argumentTypes = types; } try { this.method = type.getMethod(methodName, argumentTypes); } catch (NoSuchMethodException e) { throw new RuntimeException( "NoSuchMethodException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } catch (SecurityException e) { throw new RuntimeException( "SecurityException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } }
public ReflectionCallback( Class type, String methodName, Class[] argumentTypes, boolean isRestArgs, boolean isStaticMethod, Arity arity) { super(type, methodName, argumentTypes, isRestArgs, isStaticMethod, arity); if (isStaticMethod) { Class[] types = new Class[argumentTypes.length + 1]; System.arraycopy(argumentTypes, 0, types, 1, argumentTypes.length); types[0] = IRubyObject.class; argumentTypes = types; } try { this.method = type.getMethod(methodName, argumentTypes); } catch (NoSuchMethodException e) { throw new RuntimeException( "NoSuchMethodException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } catch (SecurityException e) { throw new RuntimeException( "SecurityException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } }
3,234,376
public ReflectionCallback( Class type, String methodName, Class[] argumentTypes, boolean isRestArgs, boolean isStaticMethod, Arity arity) { super(type, methodName, argumentTypes, isRestArgs, isStaticMethod, arity); if (isStaticMethod) { Class[] types = new Class[argumentTypes.length + 1]; System.arraycopy(argumentTypes, 0, types, 1, argumentTypes.length); types[0] = IRubyObject.class; argumentTypes = types; } try { this.method = type.getMethod(methodName, argumentTypes); } catch (NoSuchMethodException e) { throw new RuntimeException( "NoSuchMethodException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } catch (SecurityException e) { throw new RuntimeException( "SecurityException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } }
public ReflectionCallback( Class type, String methodName, Class[] argumentTypes, boolean isRestArgs, boolean isStaticMethod, Arity arity) { super(type, methodName, argumentTypes, isRestArgs, isStaticMethod, arity); if (isStaticMethod) { Class[] types = new Class[argumentTypes.length + 1]; System.arraycopy(argumentTypes, 0, types, 1, argumentTypes.length); types[0] = IRubyObject.class; argumentTypes = types; } try { this.method = type.getMethod(methodName, argumentTypes); } catch (NoSuchMethodException e) { throw new RuntimeException( "NoSuchMethodException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } catch (SecurityException e) { throw new RuntimeException( "SecurityException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } }
3,234,377
public ReflectionCallback( Class type, String methodName, Class[] argumentTypes, boolean isRestArgs, boolean isStaticMethod, Arity arity) { super(type, methodName, argumentTypes, isRestArgs, isStaticMethod, arity); if (isStaticMethod) { Class[] types = new Class[argumentTypes.length + 1]; System.arraycopy(argumentTypes, 0, types, 1, argumentTypes.length); types[0] = IRubyObject.class; argumentTypes = types; } try { this.method = type.getMethod(methodName, argumentTypes); } catch (NoSuchMethodException e) { throw new RuntimeException( "NoSuchMethodException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } catch (SecurityException e) { throw new RuntimeException( "SecurityException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } }
public ReflectionCallback( Class type, String methodName, Class[] argumentTypes, boolean isRestArgs, boolean isStaticMethod, Arity arity) { super(type, methodName, argumentTypes, isRestArgs, isStaticMethod, arity); if (isStaticMethod) { Class[] types = new Class[argumentTypes.length + 1]; System.arraycopy(argumentTypes, 0, types, 1, argumentTypes.length); types[0] = IRubyObject.class; argumentTypes = types; } try { this.method = type.getMethod(methodName, argumentTypes); } catch (NoSuchMethodException e) { throw new RuntimeException( "NoSuchMethodException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } catch (SecurityException e) { throw new RuntimeException( "SecurityException: Cannot get method \"" + methodName + "\" in class \"" + type.getName() + "\" by Reflection."); } }
3,234,378
protected IRubyObject invokeMethod0(IRubyObject recv, Object[] methodArgs) throws IllegalAccessException, InvocationTargetException { if (isStaticMethod) { Object[] args = new Object[methodArgs.length + 1]; System.arraycopy(methodArgs, 0, args, 1, methodArgs.length); args[0] = recv; recv = null; methodArgs = args; } return (IRubyObject) method.invoke(recv, methodArgs); }
protected IRubyObject invokeMethod0(IRubyObject recv, Object[] methodArgs) throws IllegalAccessException, InvocationTargetException { if (isStaticMethod) { Object[] args = new Object[methodArgs.length + 1]; System.arraycopy(methodArgs, 0, args, 1, methodArgs.length); args[0] = recv; recv = null; methodArgs = args; } return (IRubyObject) method.invoke(recv, methodArgs); }
3,234,379
public RubyObject initialize(RubyObject[] args) { modify(); int size = RubyFixnum.fix2int(getInstanceVariable(getRubyClass(), "__size___")); if (args.length > size) { throw new ArgumentError(ruby, "struct size differs"); } for (int i = 0; i < args.length; i++) { values[i] = args[i]; } for (int i = args.length; i < size; i++) { values[i] = ruby.getNil(); } return ruby.getNil(); }
public RubyObject initialize(RubyObject[] args) { modify(); int size = RubyFixnum.fix2int(getInstanceVariable(getRubyClass(), "__size__")); if (args.length > size) { throw new ArgumentError(ruby, "struct size differs"); } for (int i = 0; i < args.length; i++) { values[i] = args[i]; } for (int i = args.length; i < size; i++) { values[i] = ruby.getNil(); } return ruby.getNil(); }
3,234,380
public static RubyClass newInstance(Ruby ruby, RubyObject recv, RubyObject[] args) { String name = null; if (args.length > 0 && args[0] instanceof RubyString) { name = args[0].toString(); } RubyArray member = RubyArray.newArray(ruby); for (int i = name == null ? 0 : 1; i < args.length; i++) { member.push(RubySymbol.newSymbol(ruby, args[i].toId())); } RubyClass newStruct; if (name == null) { newStruct = RubyClass.newClass(ruby, (RubyClass) recv); } else { if (!IdUtil.isConstant(name)) { throw new NameError(ruby, "identifier " + name + " needs to be constant"); } newStruct = ((RubyClass) recv).defineClassUnder(name, ((RubyClass) recv)); } newStruct.setInstanceVar("__size__", member.length()); newStruct.setInstanceVar("__member__", member); newStruct.defineSingletonMethod("new", CallbackFactory.getOptSingletonMethod(RubyStruct.class, "newStruct")); newStruct.defineSingletonMethod("[]", CallbackFactory.getOptSingletonMethod(RubyStruct.class, "newStruct")); newStruct.defineSingletonMethod("members", CallbackFactory.getSingletonMethod(RubyStruct.class, "members")); // define access methods. for (int i = name == null ? 0 : 1; i < args.length; i++) { newStruct.defineMethod(args[i].toId(), CallbackFactory.getMethod(RubyStruct.class, "get", RubyObject.class)); newStruct.defineMethod(args[i].toId() + "=", CallbackFactory.getMethod(RubyStruct.class, "set", RubyObject.class)); } return newStruct; }
public static RubyClass newInstance(Ruby ruby, RubyObject recv, RubyObject[] args) { String name = null; if (args.length > 0 && args[0] instanceof RubyString) { name = args[0].toString(); } RubyArray member = RubyArray.newArray(ruby); for (int i = name == null ? 0 : 1; i < args.length; i++) { member.push(RubySymbol.newSymbol(ruby, args[i].toId())); } RubyClass newStruct; if (name == null) { newStruct = RubyClass.newClass(ruby, (RubyClass) recv); } else { if (!IdUtil.isConstant(name)) { throw new NameError(ruby, "identifier " + name + " needs to be constant"); } newStruct = ((RubyClass) recv).defineClassUnder(name, ((RubyClass) recv)); } newStruct.setInstanceVar("__size__", member.length()); newStruct.setInstanceVar("__member__", member); newStruct.defineSingletonMethod("new", CallbackFactory.getOptSingletonMethod(RubyStruct.class, "newStruct")); newStruct.defineSingletonMethod("[]", CallbackFactory.getOptSingletonMethod(RubyStruct.class, "newStruct")); newStruct.defineSingletonMethod("members", CallbackFactory.getSingletonMethod(RubyStruct.class, "members")); // define access methods. for (int i = name == null ? 0 : 1; i < args.length; i++) { newStruct.defineMethod(args[i].toId(), CallbackFactory.getMethod(RubyStruct.class, "get")); newStruct.defineMethod(args[i].toId() + "=", CallbackFactory.getMethod(RubyStruct.class, "set", RubyObject.class)); } return newStruct; }
3,234,381
public static RubyStruct newStruct(Ruby ruby, RubyObject recv, RubyObject[] args) { RubyStruct struct = new RubyStruct(ruby, (RubyClass) recv); int size = RubyFixnum.fix2int(getInstanceVariable((RubyClass) recv, "__size___")); struct.values = new RubyObject[size]; struct.callInit(args); return struct; }
public static RubyStruct newStruct(Ruby ruby, RubyObject recv, RubyObject[] args) { RubyStruct struct = new RubyStruct(ruby, (RubyClass) recv); int size = RubyFixnum.fix2int(getInstanceVariable((RubyClass) recv, "__size__")); struct.values = new RubyObject[size]; struct.callInit(args); return struct; }
3,234,382
void parse_args(DirectiveDescriptor descriptor, ArgDescriptor[] args, DirectiveArgs da) throws ParseException { try { for (int i=0; i < args.length; ) { ArgDescriptor arg = args[i]; if (arg.type == Directive.ArgType_GROUP) parse_arg_group(descriptor, args, i, da); else if (arg.type == Directive.ArgType_CHOICE) { for (int j=0; j<arg.subordinateArgs; j++) { // Each child is a GROUP, so we want to look at child's first child ArgDescriptor child = args[arg.children[j]]; if (lookahead_keyword(args[child.children[0]].keyword)) parse_arg_group(descriptor, args, arg.children[j], da); } } else { Object o = parse_arg(descriptor, arg); da.setArg(arg.id, o); } i = arg.nextArg; } } catch (BuildException e) { throw new ParseException("BuildException", e); } }
void parse_args(DirectiveDescriptor descriptor, ArgDescriptor[] args, DirectiveArgs da) throws ParseException { try { for (int i=0; i < args.length; ) { ArgDescriptor arg = args[i]; if (arg.type == Directive.ArgType_GROUP) parse_arg_group(descriptor, args, i, da); else if (arg.type == Directive.ArgType_CHOICE) { for (int j=0; j<arg.subordinateArgs; j++) { // Each child is a GROUP, so we want to look at child's first child ArgDescriptor child = args[arg.children[j]]; if (lookahead_keyword(args[child.children[0]].keyword)) parse_arg_group(descriptor, args, arg.children[j], da); } } else { Object o = parse_arg(descriptor, arg); da.setArg(arg.id, o); } i = arg.nextArg; } } catch (BuildException e) { throw new ParseException("BuildException", e); } }
3,234,385
public void testQdox() throws Exception{ QdoxMappingLoader mappingLoader = new QdoxMappingLoader(DEFAULT_NAMESPACE, new File[] { new File("src/test")}); Set namespaces = mappingLoader.loadNamespaces(); validateModel(namespaces); }
public void testQdox() throws Exception{ String basedir = System.getProperties().getProperty("basedir", "."); QdoxMappingLoader mappingLoader = new QdoxMappingLoader(DEFAULT_NAMESPACE, new File[] { new File(basedir, "/src/test")}); Set namespaces = mappingLoader.loadNamespaces(); validateModel(namespaces); }
3,234,386
public void mousePressed(MouseEvent me) { ImageDisplay d = findParentDisplay(me.getSource()); d.moveToFront(); model.setSelectedDisplay(d); view.setTitle(model.currentPathString()); if (me.isPopupTrigger()) model.setPopupPoint(me.getPoint()); }
public void mousePressed(MouseEvent me) { ImageDisplay d = findParentDisplay(me.getSource()); d.moveToFront(); model.setSelectedDisplay(d); view.setTitle(model.currentPathString()); if (me.isPopupTrigger()) popupTrigger = true; }
3,234,388
public void mouseReleased(MouseEvent me) { if (me.isPopupTrigger()) model.setPopupPoint(me.getPoint()); else { Object src = me.getSource(); ImageDisplay d = findParentDisplay(src); if (d instanceof ImageNode && !(d.getTitleBar() == src)) model.setThumbSelected(true); } }
public void mouseReleased(MouseEvent me) { if (popupTrigger || me.isPopupTrigger()) model.setPopupPoint(me.getPoint()); else { Object src = me.getSource(); ImageDisplay d = findParentDisplay(src); if (d instanceof ImageNode && !(d.getTitleBar() == src)) model.setThumbSelected(true); } }
3,234,389
public void mouseReleased(MouseEvent me) { if (me.isPopupTrigger()) model.setPopupPoint(me.getPoint()); else { Object src = me.getSource(); ImageDisplay d = findParentDisplay(src); if (d instanceof ImageNode && !(d.getTitleBar() == src)) model.setThumbSelected(true); } }
public void mouseReleased(MouseEvent me) { if (me.isPopupTrigger()) model.setPopupPoint(me.getPoint()); else { Object src = me.getSource(); ImageDisplay d = findParentDisplay(src); if (d instanceof ImageNode && !(d.getTitleBar() == src)) model.setThumbSelected(true); } }
3,234,390
public void indent(int many) { newData(); _currentData.setType (WikiDataTypes.INDENT); _currentData.setData (""+many); }
public void indent(int many) { newData(); _currentData.setType (WikiDataTypes.INDENT); _currentData.setData (""+many); }
3,234,392
public static IRubyObject s_readline(IRubyObject recv, IRubyObject prompt, IRubyObject add_to_hist) throws IOException { IRubyObject line = recv.getRuntime().getNil(); String v = readline.readLine(prompt.toString()); if(null != v) { if (add_to_hist.isTrue()) readline.getHistory().addToHistory(v); line = recv.getRuntime().newString(v); } if(line.isNil()) { return recv.getRuntime().newString(""); } return line; }
public static IRubyObject s_readline(IRubyObject recv, IRubyObject prompt, IRubyObject add_to_hist) throws IOException { IRubyObject line = recv.getRuntime().getNil(); String v = readline.readLine(prompt.toString()); if(null != v) { if (add_to_hist.isTrue()) readline.getHistory().addToHistory(v); line = recv.getRuntime().newString(v); } if(line.isNil()) { return recv.getRuntime().newString(""); } return line; }
3,234,395
public Collection getLines(String methodNameAndDescriptor) { Collection lines = new HashSet(); Iterator iter = children.values().iterator(); while (iter.hasNext()) { LineData next = (LineData)iter.next(); if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor())) { lines.add(next); } } return lines; }
public Collection getLines(String methodNameAndDescriptor) { Collection lines = new HashSet(); Iterator iter = children.values().iterator(); while (iter.hasNext()) { LineData next = (LineData)iter.next(); if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor())) { lines.add(next); } } return lines; }
3,234,396
public Collection getLines(String methodNameAndDescriptor) { Collection lines = new HashSet(); Iterator iter = children.values().iterator(); while (iter.hasNext()) { LineData next = (LineData)iter.next(); if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor())) { lines.add(next); } } return lines; }
public Collection getLines(String methodNameAndDescriptor) { Collection lines = new HashSet(); Iterator iter = children.values().iterator(); while (iter.hasNext()) { LineData next = (LineData)iter.next(); if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor())) { lines.add(next); } } return lines; }
3,234,397
void coverage(String[] filenames) { if (filenames.length == 0) { return; } for (int i = 0; i < filenames.length; i++) { getProject().log("Adding " + filenames[i] + " to list", Project.MSG_VERBOSE); addArg(filenames[i]); } saveArgs(); Copyright.print(System.out); System.out.println("instrumenting " + filenames.length + " " + (filenames.length == 1 ? "class" : "classes") + (toDir != null ? " to " + toDir : "")); /** * TODO: Do something here so that we can set System.in and System.out on * getJava() to the one we're using now. So that when instrumentation calls * System.out, it will show up as "[instrument] doing stuff" instead of * "[java] doing stuff" in the ant output. */ if (getJava().executeJava() != 0) { throw new BuildException(); } }
void coverage(String[] filenames) { if (filenames.length == 0) { return; } for (int i = 0; i < filenames.length; i++) { getProject().log("Adding " + filenames[i] + " to list", Project.MSG_VERBOSE); addArg(filenames[i]); } saveArgs(); Copyright.print(System.out); System.out.println("instrumenting " + filenames.length + " " + (filenames.length == 1 ? "class" : "classes") + (toDir != null ? " to " + toDir : "")); /** * TODO: Do something here so that we can set System.in and System.out on * getJava() to the one we're using now. So that when instrumentation calls * System.out, it will show up as "[instrument] doing stuff" instead of * "[java] doing stuff" in the ant output. */ if (getJava().executeJava() != 0) { throw new BuildException(); } }
3,234,398
public static RubyModule createMathModule(Ruby ruby) { Callback atan2 = new ReflectionCallbackMethod(RubyMath.class, "atan2", new Class[] { RubyNumeric.class, RubyNumeric.class }); Callback cos = new ReflectionCallbackMethod(RubyMath.class, "cos", RubyNumeric.class); Callback exp = new ReflectionCallbackMethod(RubyMath.class, "exp", RubyNumeric.class); Callback frexp = new ReflectionCallbackMethod(RubyMath.class, "frexp", RubyNumeric.class); Callback ldexp = new ReflectionCallbackMethod(RubyMath.class, "ldexp", new Class[] { RubyFloat.class, RubyInteger.class }); Callback log = new ReflectionCallbackMethod(RubyMath.class, "log", RubyNumeric.class); Callback log10 = new ReflectionCallbackMethod(RubyMath.class, "log10", RubyNumeric.class); Callback sin = new ReflectionCallbackMethod(RubyMath.class, "sin", RubyNumeric.class); Callback sqrt = new ReflectionCallbackMethod(RubyMath.class, "sqrt", RubyNumeric.class); Callback tan = new ReflectionCallbackMethod(RubyMath.class, "tan", RubyNumeric.class); RubyModule mathModule = ruby.defineModule("Math"); mathModule.defineConstant("E", RubyFloat.newFloat(ruby, Math.E)); mathModule.defineConstant("PI", RubyFloat.newFloat(ruby, Math.PI)); mathModule.defineSingletonMethod("atan2", atan2); mathModule.defineSingletonMethod("cos", cos); mathModule.defineSingletonMethod("exp", exp);// mathModule.defineSingletonMethod("frexp", frexp); mathModule.defineSingletonMethod("ldexp", ldexp); mathModule.defineSingletonMethod("log", log); mathModule.defineSingletonMethod("log10", log10); mathModule.defineSingletonMethod("sin", sin); mathModule.defineSingletonMethod("sqrt", sqrt); mathModule.defineSingletonMethod("tan", tan); return mathModule; }
public static RubyModule createMathModule(Ruby ruby) { Callback atan2 = new ReflectionCallbackMethod(RubyMath.class, "atan2", new Class[] { RubyNumeric.class, RubyNumeric.class }); Callback cos = new ReflectionCallbackMethod(RubyMath.class, "cos", RubyNumeric.class); Callback exp = new ReflectionCallbackMethod(RubyMath.class, "exp", RubyNumeric.class); Callback frexp = new ReflectionCallbackMethod(RubyMath.class, "frexp", RubyNumeric.class); Callback ldexp = new ReflectionCallbackMethod(RubyMath.class, "ldexp", new Class[] { RubyFloat.class, RubyInteger.class }); Callback log = new ReflectionCallbackMethod(RubyMath.class, "log", RubyNumeric.class); Callback log10 = new ReflectionCallbackMethod(RubyMath.class, "log10", RubyNumeric.class); Callback sin = new ReflectionCallbackMethod(RubyMath.class, "sin", RubyNumeric.class); Callback sqrt = new ReflectionCallbackMethod(RubyMath.class, "sqrt", RubyNumeric.class); Callback tan = new ReflectionCallbackMethod(RubyMath.class, "tan", RubyNumeric.class); RubyModule mathModule = ruby.defineModule("Math"); mathModule.defineConstant("E", RubyFloat.newFloat(ruby, Math.E)); mathModule.defineConstant("PI", RubyFloat.newFloat(ruby, Math.PI)); mathModule.defineSingletonMethod("atan2", atan2); mathModule.defineSingletonMethod("cos", cos); mathModule.defineSingletonMethod("exp", exp);// mathModule.defineSingletonMethod("frexp", frexp); mathModule.defineSingletonMethod("ldexp", ldexp); mathModule.defineSingletonMethod("log", log); mathModule.defineSingletonMethod("log10", log10); mathModule.defineSingletonMethod("sin", sin); mathModule.defineSingletonMethod("sqrt", sqrt); mathModule.defineSingletonMethod("tan", tan); return mathModule; }
3,234,399
public static RubyModule createMathModule(Ruby ruby) { Callback atan2 = new ReflectionCallbackMethod(RubyMath.class, "atan2", new Class[] { RubyNumeric.class, RubyNumeric.class }); Callback cos = new ReflectionCallbackMethod(RubyMath.class, "cos", RubyNumeric.class); Callback exp = new ReflectionCallbackMethod(RubyMath.class, "exp", RubyNumeric.class); Callback frexp = new ReflectionCallbackMethod(RubyMath.class, "frexp", RubyNumeric.class); Callback ldexp = new ReflectionCallbackMethod(RubyMath.class, "ldexp", new Class[] { RubyFloat.class, RubyInteger.class }); Callback log = new ReflectionCallbackMethod(RubyMath.class, "log", RubyNumeric.class); Callback log10 = new ReflectionCallbackMethod(RubyMath.class, "log10", RubyNumeric.class); Callback sin = new ReflectionCallbackMethod(RubyMath.class, "sin", RubyNumeric.class); Callback sqrt = new ReflectionCallbackMethod(RubyMath.class, "sqrt", RubyNumeric.class); Callback tan = new ReflectionCallbackMethod(RubyMath.class, "tan", RubyNumeric.class); RubyModule mathModule = ruby.defineModule("Math"); mathModule.defineConstant("E", RubyFloat.newFloat(ruby, Math.E)); mathModule.defineConstant("PI", RubyFloat.newFloat(ruby, Math.PI)); mathModule.defineSingletonMethod("atan2", atan2); mathModule.defineSingletonMethod("cos", cos); mathModule.defineSingletonMethod("exp", exp);// mathModule.defineSingletonMethod("frexp", frexp); mathModule.defineSingletonMethod("ldexp", ldexp); mathModule.defineSingletonMethod("log", log); mathModule.defineSingletonMethod("log10", log10); mathModule.defineSingletonMethod("sin", sin); mathModule.defineSingletonMethod("sqrt", sqrt); mathModule.defineSingletonMethod("tan", tan); return mathModule; }
public static RubyModule createMathModule(Ruby ruby) { Callback atan2 = new ReflectionCallbackMethod(RubyMath.class, "atan2", new Class[] { RubyNumeric.class, RubyNumeric.class }); Callback cos = new ReflectionCallbackMethod(RubyMath.class, "cos", RubyNumeric.class); Callback exp = new ReflectionCallbackMethod(RubyMath.class, "exp", RubyNumeric.class); Callback frexp = new ReflectionCallbackMethod(RubyMath.class, "frexp", RubyNumeric.class); Callback ldexp = new ReflectionCallbackMethod(RubyMath.class, "ldexp", new Class[] { RubyFloat.class, RubyInteger.class }); Callback log = new ReflectionCallbackMethod(RubyMath.class, "log", RubyNumeric.class); Callback log10 = new ReflectionCallbackMethod(RubyMath.class, "log10", RubyNumeric.class); Callback sin = new ReflectionCallbackMethod(RubyMath.class, "sin", RubyNumeric.class); Callback sqrt = new ReflectionCallbackMethod(RubyMath.class, "sqrt", RubyNumeric.class); Callback tan = new ReflectionCallbackMethod(RubyMath.class, "tan", RubyNumeric.class); RubyModule mathModule = ruby.defineModule("Math"); mathModule.defineConstant("E", RubyFloat.newFloat(ruby, Math.E)); mathModule.defineConstant("PI", RubyFloat.newFloat(ruby, Math.PI)); mathModule.defineSingletonMethod("atan2", atan2); mathModule.defineSingletonMethod("cos", cos); mathModule.defineSingletonMethod("exp", exp);// mathModule.defineSingletonMethod("frexp", frexp); mathModule.defineSingletonMethod("ldexp", ldexp); mathModule.defineSingletonMethod("log", log); mathModule.defineSingletonMethod("log10", log10); mathModule.defineSingletonMethod("sin", sin); mathModule.defineSingletonMethod("sqrt", sqrt); mathModule.defineSingletonMethod("tan", tan); return mathModule; }
3,234,400
public IRubyObject rbClone() { IRubyObject clone = getMetaClass().getRealClass().allocate(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setFrozen(false); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; }
public IRubyObject rbClone() { IRubyObject clone = doClone(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setFrozen(false); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; }
3,234,401
public IRubyObject rbClone() { IRubyObject clone = getMetaClass().getRealClass().allocate(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setFrozen(false); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; }
public IRubyObject rbClone() { IRubyObject clone = getMetaClass().getRealClass().allocate(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setTaint(this.isTaint()); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; }
3,234,402
public IRubyObject rbClone() { IRubyObject clone = getMetaClass().getRealClass().allocate(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setFrozen(false); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; }
public IRubyObject rbClone() { IRubyObject clone = getMetaClass().getRealClass().allocate(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setFrozen(false); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; }
3,234,403
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").toArray(new ArticleItemBean[0]); int availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(bean, i); } _dataModel.setRowCount(availableRows); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
publicvoidupdateDataModel(Integerstart,Integerrows){ if(_dataModel==null){ _dataModel=newWFDataModel(); } try{ ArticleItemBean[]articleItemBean=(ArticleItemBean[])ArticleListBean.loadAllArticlesInFolder("/files/content").toArray(newArticleItemBean[0]); intavailableRows=articleItemBean.length; intnrOfRows=rows.intValue(); if(nrOfRows==0){ nrOfRows=availableRows; } intmaxRow=Math.min(start.intValue()+nrOfRows,availableRows); for(inti=start.intValue();i<maxRow;i++){// ListArticlesBeanbean=newListArticlesBean(String.valueOf(i),testHeadlines[i],testPublished[i]); //TODOwedon'thavepublishedinthearticleitembean ListArticlesBeanbean=newListArticlesBean(articleItemBean[i].getHeadline(),articleItemBean[i].getHeadline(),"");// ArticleListBeana=newArticleListBean(String.valueOf(i),articleItemBean[i].getHeadline(),articleItemBean[i].getItemType(),articleItemBean[i].getAuthor(),articleItemBean[i].getStatus()); _dataModel.set(bean,i); } _dataModel.setRowCount(availableRows); } catch(XmlExceptione){ //TODOAuto-generatedcatchblock e.printStackTrace(); } catch(IOExceptione){ //TODOAuto-generatedcatchblock e.printStackTrace(); } }
3,234,404
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").toArray(new ArticleItemBean[0]); int availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(bean, i); } _dataModel.setRowCount(availableRows); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").toArray(new ArticleItemBean[0]); int availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(bean, i); } _dataModel.setRowCount(availableRows); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
3,234,405
ImageEditorManager(ImageEditor view, DataManagerCtrl control, ImageData model) { this.view = view; this.control = control; this.model = model; nameChange = false; isName = false; }
ImageEditorManager(ImageEditor view, DataManagerCtrl control, ImageData model) { this.view = view; this.control = control; this.model = model; nameChange = false; isName = false; }
3,234,406
void initListeners() { attachButtonListener(view.getSaveButton(), SAVE); attachButtonListener(view.getViewButton(), VIEW); JTextArea nameField = view.getNameField(); nameField.getDocument().addDocumentListener(this); nameField.addMouseListener(this); JTextArea descriptionArea = view.getDescriptionArea(); descriptionArea.getDocument().addDocumentListener(this); }
void initListeners() { attachButtonListener(view.getSaveButton(), SAVE); attachButtonListener(view.getViewButton(), VIEW); JTextArea nameField = view.getNameField(); nameField.getDocument().addDocumentListener(this); nameField.addMouseListener(this); JTextArea descriptionArea = view.getDescriptionArea(); descriptionArea.getDocument().addDocumentListener(this); }
3,234,407
public void insertUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); }
public void insertUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); }
3,234,408
public void removeUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); }
public void removeUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); }
3,234,409
public Filterable filter(String fieldId, Filterable f) { if (null==f || !Hibernate.isInitialized(f)){ if (f instanceof IObject) { IObject proxy = (IObject) f; IObject unloaded = (IObject) Utils.trueInstance(f.getClass()); unloaded.setId(proxy.getId()); // TODO is this causing a DB hit? unloaded.unload(); return unloaded; } return null; } return super.filter(fieldId, f); }
public Filterable filter(String fieldId, Filterable f) { if (null==f || !Hibernate.isInitialized(f)){ if (f instanceof IObject) { IObject proxy = (IObject) f; IObject unloaded = (IObject) Utils.trueInstance(f.getClass()); unloaded.setId(proxy.getId()); // TODO is this causing a DB hit? unloaded.unload(); return unloaded; } return null; } return super.filter(fieldId, f); }
3,234,410
public Filterable filter(String fieldId, Filterable f) { if (null==f || !Hibernate.isInitialized(f)){ if (f instanceof IObject) { IObject proxy = (IObject) f; IObject unloaded = (IObject) Utils.trueInstance(f.getClass()); unloaded.setId(proxy.getId()); // TODO is this causing a DB hit? unloaded.unload(); return unloaded; } return null; } return super.filter(fieldId, f); }
public Filterable filter(String fieldId, Filterable f) { if (null==f || !Hibernate.isInitialized(f)){ if (f instanceof IObject) { IObject proxy = (IObject) f; IObject unloaded = (IObject) Utils.trueInstance(f.getClass()); unloaded.setId(proxy.getId()); // TODO is this causing a DB hit? unloaded.unload(); return unloaded; } return null; } return super.filter(fieldId, f); }
3,234,411