query
stringlengths 7
33.1k
| document
stringlengths 7
335k
| metadata
dict | negatives
sequencelengths 3
101
| negative_scores
sequencelengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Method created to remove a Graphic Object and it's Transform Points from the Graphic Canvas | private void removeObject() {
if(this.curr_obj != null) {
this.canvas.uRemove(this.curr_obj);
this.canvas.remove(this.transformPoints);
this.transformPoints.clear();
this.curr_obj = null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void unSelect() {\n /** if we had some object selected we need to delete it's Transformation Points. */\n if(this.action.isSelect() && this.curr_obj != null) {\n this.canvas.remove(this.transformPoints);\n this.transformPoints.clear();\n this.curr_obj = null;\n\n /** if we were in the middle of a text operation, we have to remove the TextBox and set the text to it's last version*/\n } else if(this.action.isText()) {\n int size = Integer.parseInt(currentFontSize.getItemText(currentFontSize.getSelectedIndex()));\n\n curr_obj = new Text(editor.getText());\n ((Text)curr_obj).setFont(currFont);\n addTextObject(curr_obj, (int)aux_obj.getX() + (int)((1.0/4.0)*size), (int)aux_obj.getY()+ (size) + (int)((1.0/4.0)*size));\n\n aux_obj = null;\n curr_obj = null;\n apanel.remove(editor);\n editor = null;\n action.setAction(Action.TEXTBOX);\n }\n }",
"public void cleanCanvas() {\n\t\tclean = true;\n\t\tthis.invalidate();\n\t\t\n\t\t// adiciona ponto fict’cio para informar que o canvas foi limpo num dado momento\n\t\tif (toReplay) {\n\t\t\txs.add(-2.0f);\n\t\t\tys.add(-2.0f);\n\t\t\tcolors.add(mPaint.getColor());\n\t\t}\n\t}",
"public void removeObjectOnlyFromCanvas(int ID) {\n super.removeObject(ID);\n }",
"void remove(GeometricalObject object);",
"public void removeGameObj(GameObject obj){\n display.getChildren().remove(obj.getDisplay());\n }",
"public void remove(GeometricalObject object);",
"boolean removeObject(PointLatLng point, String id);",
"public void removePoint(Point2D p);",
"private void erase()\n {\n Canvas canvas = Canvas.getCanvas();\n canvas.erase(this);\n }",
"public void clearComplexRelationshipCoordinates()\n {\n if(this.isVisible())\n {\n this.coordinates = null;\n this.paint(this.getGraphics());\n }\n }",
"void unsetSurfaceRefs();",
"void positionCleared();",
"public void deleteNonSerializableObjects() {\n \n ArrayList<VisualObject> delList = new ArrayList<VisualObject>();\n \n for (CanvasWindow w : this) {\n \n if (w instanceof VisualObject) {\n VisualObject o = (VisualObject) w;\n \n VisualCanvas mainCanvas = (VisualCanvas) getMainCanvas();\n \n int inspectorID = o.getObjectRepresentation().getObjectID();\n \n Object result = mainCanvas.getInspector().getObject(inspectorID);\n \n if (!(result instanceof Serializable)) {\n delList.add(o);\n } else {\n String value = Base64.encodeObject((Serializable) result);\n if (value == null) {\n delList.add(o);\n }\n }\n }\n }\n \n for (VisualObject vObj : delList) {\n \n if (vObj == null) {\n getMainCanvas().getMessageBox().addMessage(\n \"Error: object does not exist\",\n \"Error: null obj in visual-object-list\",\n MessageType.ERROR);\n continue;\n }\n \n VisualCanvas canvas = (VisualCanvas) getMainCanvas();\n \n Object o = canvas.getInspector().\n getObject(vObj.getObjectRepresentation().getObjectID());\n \n removeObjectWithoutEffect(vObj.getID());\n \n if (o == null) {\n getMainCanvas().getMessageBox().addMessage(\n \"Error: object does not exist\",\n \"Error: object with id \"\n + vObj.getObjectRepresentation().getObjectID()\n + \" is null!\",\n MessageType.ERROR);\n \n System.err.println(\"Error: object with id \"\n + vObj.getObjectRepresentation().getObjectID()\n + \" is null!\");\n \n continue;\n }\n \n if (!(o instanceof IgnoreNotSerializableWarnings)\n && !ComponentUtil.isSerializationEnabled(o.getClass())) {\n \n getMainCanvas().getMessageBox().addMessage(\n \"Warning: Can't save some objects\",\n \"Some objects are not serializable and had to be\"\n + \" removed.<br><br> <p>Please ensure that all \"\n + \"objects implement the <b><i>Serializable</i></b> \"\n + \"interface and that properties don't prevent\"\n + \" serialization. \"\n + \"Use <b><i>transient</i></b> in this case.<p>\"\n + \"Classes added from shell cannot be deserialized\"\n + \" because source code definition is not available.\"\n + \"This can be fixed by adding a new \"\n + \"<b><i>AbstractCode</i></b> to the canvas before\"\n + \"saving the session.\",\n MessageType.WARNING);\n }\n }\n }",
"public void clear() {\n\t\tpoints.clear();\n\t\trepaint();\n\t}",
"public void remove(GObject object);",
"public void removeAllOnlyFromCanvas() {\n ArrayList<Integer> delList = new ArrayList<Integer>();\n \n for (CanvasWindow o : this) {\n delList.add(o.getID());\n }\n \n for (Integer i : delList) {\n removeObjectOnlyFromCanvas(i);\n }\n }",
"public void removeShape(Shapes obj) {\n \tthis.listShapes.remove(obj);\n \t W.repaint();\n }",
"protected void deleteSelectedControlPoints() {\n\t\tfor (int i = 0; i < selectedPoints.size(); ++i) {\n\t\t\tif (i == 0)\n\t\t\t\tpush();\n\n\t\t\tfor (int j = 0; j < selectedCurves.size(); ++j) {\n\t\t\t\tint temp;\n\t\t\t\t// Als het controlepunt tot de curve behoort --> het punt uit\n\t\t\t\t// die curve verwijderen.\n\t\t\t\twhile ((temp = selectedCurves.elementAt(j).containsInputPointi(\n\t\t\t\t\t\tselectedPoints.elementAt(i))) != -1) {\n\t\t\t\t\tselectedCurves.elementAt(j).getInput().remove(temp);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Het punt ook uit de container halen.\n\t\t\tselectionTool.deleteControlPoint(selectedPoints.elementAt(i).X(),\n\t\t\t\t\tselectedPoints.elementAt(i).Y());\n\t\t}\n\n\t\t// Indien curves nu leeg blijken te zijn --> die curves verwijderen.\n\t\tfor (int j = 0; j < selectedCurves.size(); ++j) {\n\t\t\tif (selectedCurves.elementAt(j).getNbInputPoints() == 0) {\n\t\t\t\tselectionTool.deleteCurve(selectedCurves.elementAt(j));\n\t\t\t\tselectedCurves.remove(j--);\n\t\t\t}\n\t\t}\n\n\t\trecalculateSelectedCurves(); // De curves herberekenen.\n\t\tcurves.addAll(selectedCurves); // De curves deselecteren.\n\t\tselectedCurves.clear();\n\t\tselectedPoints.clear();\n\t\tpushNew();\n\t}",
"public void removeMapObject(MapObject obj) {\n markers.remove(obj);\n if(internalNative != null) {\n internalNative.removeMapElement(obj.mapKey);\n } else {\n if(obj.lines != null) {\n if(internalLightweightCmp != null) {\n internalLightweightCmp.removeLayer(obj.lines);\n } else {\n // TODO: Browser component\n }\n } else {\n points.removePoint(obj.point);\n }\n }\n }",
"public void remove()\n {\n removed();\n node.shapeRemoved(shape);\n }",
"public interface RemoveNeeded {\n\t/** \n\t * This method is called once the drawable is not needed.\n\t * It should remove all auxiliary objects of this drawable. \n\t */\n\tpublic void remove();\n}",
"@Override\n\t// IMPORTANT , points not in panel.paintComponents, so won't removed by regular remove method\n\tpublic void remove(PaintPanel panel) {\n\t\tfor(DataFromPoint fromPoint: getFromPoints()) {\n\t\t\tif(fromPoint.getLineSegment() != null)\n\t\t\t\tfromPoint.getLineSegment().remove(panel);\n\t\t}\n\t\tfor(DataToPoint toPoint: getToPoints()) {\n\t\t\tif(toPoint.getLineSegment() != null)\n\t\t\t\ttoPoint.getLineSegment().remove(panel);\n\t\t}\n\t\tsuper.remove(panel);\n\t\t\n\t}",
"public void undo(){\n if(!isFreeDraw) { //in waypoint mode delete the last point\n int size = mMapInterface.getPathFrame().size();\n if (size >= 1) {\n isPathReady=false;\n mMapInterface.getPathFrame().remove(size - 1);\n pointsCounter--;\n googleMap.clear();\n drawLine();\n }\n }\n else{ //in continu mode delete all path\n deletePath();\n drawFree();\n }\n }",
"public void removePiece() {\n\t\troot.getChildren().clear();\n\t\tthis.piece = null;\n\t\troot.getChildren().add(rectangle);\n\t}",
"public void destroyed() {\n\t\twidth = SIZE_INC * width;\n\t\t// make the end points at the new location\n\t\tthis.makeEndPoints(width, (0 - (xSpeed * width)),\n\t\t\t\t(0 - (ySpeed * width)));\n\n\t}",
"void release() {\n\t\tfor (int i = 0; i < amount; i++) {\n\t\t\tpoint[i].sticked = false;\n\t\t\tpoint[i].beginPosition.set(point[i].position);\n\t\t}\n\n\t\tdragLock = false; //\n\t\tmouseLockedToLine = false;\n\t\tpolygonLockedToMouse = false;\n\t\t// pointLockedToMouse = false;\n\t\trotationLockedToMouse = false;\n\t\tselectedLine = -1;\n\n\t\t// isSelected =\n\t\t// pointMode = 0; // switch to deafult point mode\n\n\t\t// TODO: release all lines in this class\n\t}",
"public void remove()\n {\n ShapeParent parent = getShapeParent();\n \n if (parent != null)\n {\n parent.remove(this);\n }\n }",
"public void componentRemoved(GPaintable object);",
"public final void destroy(){\n stop();\n LIBRARY.CLEyeDestroyCamera(camera_);\n camera_ = null;\n PS3_LIST_.remove(this);\n }",
"@Override\r\n\tpublic void undo() {\n\t\tfor(IShape shape : tempList)\r\n\t\t\tshapeList.remove(shape);\r\n\t}",
"public void removeGraphic(FGraphic graphic) {\r\n\t\tgraphics.remove(graphic);\r\n\t\treCalculateFullExtent();\r\n\r\n\t}",
"public void eraseOnClick(View view){\n mMap.clear();//clears the map\r\n points = new ArrayList<LatLng>();//resets the markers holder\r\n }",
"public void removeByObject()\r\n\t{\n\t}",
"public boolean removePoint(Point p);",
"public void removeGraphic(int id)\n\t{\n\t\tgetObject().removeGraphic(id);\n\t\treturn;\n\t}",
"public void removeObj(Obj3d obj) {\n\t\tfor (int i = panes.size() - 1; i >= 0; i--) {\n\t\t\tif (panes.get(i).getObj() == obj) {\n\t\t\t\tthis.remove(panes.get(i));\n\t\t\t\tthis.revalidate();\n\t\t\t\tthis.repaint();\n\t\t\t\tpanes.remove(i);\n\t\t\t}\n\t\t}\n\t\ts.getObjs().remove(obj);\n\t}",
"@Override\n public void unexecute()\n {\n if(layer.removeMeasurementPointByPosition(measurementPoint.getPosition()))\n {\n //remove local reference to the measurement point\n measurementPoint = null;\n //remove marker\n if(mapCanvas.removeMarkerFromMap(markerPositionOnMap))\n {\n markerPositionOnMap = null;\n }\n else\n {\n Log.d(DEBUGTAG, \"Error: While undoing 'add measurement point' could not remove the marker\");\n }\n\n }\n else\n {\n Log.d(DEBUGTAG, \"Error: MeasurementPoint not found in layer!\");\n }\n Log.d(DEBUGTAG, \"Command AddMeasurement Point Unexecuted\");\n }",
"private void touch() {\n\t\tint toDelete = -1;\n\t\tfor(int i = 0; i < drawData.size(); i++) {\n\t\t\tif(drawData.get(i).getDelete()){\n\t\t\t\ttoDelete = i;\n\t\t\t}\n\t\t}\n\t\tif(toDelete >= 0) {\n\t\t\tremove(drawData.get(toDelete));\n\t\t\treturn;\n\t\t}\n\t\tif (drawData.size() > 0) {\n\t\t\tShape o = drawData.get(0);\n\t\t\tdrawData.remove(0);\n\t\t\tdrawData.add(0, o);\n\t\t}\n\t}",
"boolean removeObject(Circle circle, String id);",
"public void clear_strokes() {\n this.contours = new ArrayList<ContourClass>(); // Argument (if any) specifies initial capacity (default 10)\n }",
"public void clearAllPoints() {\n\t\tpoints.clear();\n\t\tnotifyListeners();\n\t}",
"public Point2D removePoint(int i);",
"public void dissociateShape() {\n\t\tif(currentShape != null && (groupedShapes.contains(currentShape))) {\n\t\t\tgroupedShapes.remove(currentShape);\n\t\t\tnotifyObservers();\n\t\t}\n\t}",
"static void ClearDraw() {\n\t\tshape = new GeneralPath();\n\t\ti1.setOverlay(null);\n\t\tOL = new Overlay();\n\n\t}",
"public void removeCompositeComponent(DrawingComponent component)\n\t{\n\t\t\n\t}",
"boolean removeObject(RectangleLatLng rectangle, String id);",
"void despawnHitbox() {\n\t\tif (hitbox == null) return;\n\t\thitbox.remove();\n\t\thitbox = null;\n\t}",
"private void removeVisualization() {\n\t\tif(this.visualization != null) {\n\t\t\tthis.visualization.dispose();\n\t\t}\n\t}",
"public void remove(Shape c) {\n\t\tc.centerXProperty().removeListener(doubleListener);\n\t\tc.centerYProperty().removeListener(doubleListener);\n\t\tc.radiusProperty().removeListener(doubleListener);\n\t\tc.colorProperty().removeListener(colorListener);\n\t\tc.widthProperty().removeListener(doubleListener);\n\t\tc.heightProperty().removeListener(doubleListener);\n\t\tc.arcWidthProperty().removeListener(doubleListener);\n\t\tc.arcHeightProperty().removeListener(doubleListener);\n\t\tc.textProperty().removeListener(textListener);\n\t\tc.typeProperty().removeListener(typeListener);\n\t\tc.deleteProperty().removeListener(deleteListener);\n\t\tdrawData.remove(c);\n\t}",
"public void undo() {\n firePropertyChange(\"undo\", null, \"enable\");\n final Drawing removeMe = myDrawingArray.get(myDrawingArray.size() - 1);\n myDrawingArray.remove(removeMe);\n myUndoStack.push(removeMe);\n myCurrentShape = new Drawing(new Line2D.Double(), Color.WHITE, 0);\n if (myDrawingArray.isEmpty()) {\n firePropertyChange(\"stack\", null, EMPTY_STRING);\n }\n repaint();\n }",
"public void supprimerJoueur() {\n cercle.setStroke(Color.TRANSPARENT);\n isVisible = false;\n }",
"private void undoLastPoint() {\n \t\tif ( this.markers.isEmpty() ) {\n \t\t\treturn;\n \t\t}\n \n \t\tthis.markers.remove( this.markers.size() - 1 ).remove();\n \t\tthis.commitPolygon();\n \n \t\tif ( this.markers.size() > 1 ) {\n \t\t\tthis.moveCameraToPolygon( true );\n \t\t}\n \n \t\tthis.disableIfDissatisfied();\n \t}",
"public void evt_DeleteCurrentObject()\r\n {\r\n rh2EventPos.hoOiList.oilNumOfSelected -= 1;\t\t\t\t\t// Un de moins dans l'OiList\r\n if (rh2EventPrev != null)\r\n {\r\n rh2EventPrev.hoNextSelected = rh2EventPos.hoNextSelected;\r\n rh2EventPos = rh2EventPrev; // Car le courant est vire!\r\n }\r\n else\r\n {\r\n// rhPtr.rhOiList[rh2EventPosOiList].oilListSelected=rh2EventPos.hoNextSelected;\r\n rh2EventPrevOiList.oilListSelected = rh2EventPos.hoNextSelected;\r\n rh2EventPos = null;\r\n }\r\n }",
"public void clear(){\r\n canvas.getGraphicsContext2D().clearRect(canvas.getWidth(),canvas.getHeight(),1,1);\r\n pane.getChildren().clear();\r\n }",
"private void desenhaCanosuperior(Canvas canvas) {\n canvas.drawBitmap(canoSuperior, posicao, 0, null);\n }",
"public void removeAllOverlayObj()\n/* 91: */ {\n/* 92:146 */ this.mapPanel.removeAllOverlayObj();\n/* 93: */ }",
"protected void destroy() {\n final RenderObject me = this;\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n GameRenderer.s_instance.removeRenderObject(me);\n }\n });\n }",
"public abstract void removeCreature(Point p);",
"protected Object remObject(int position){\n \n }",
"void clearShapeMap();",
"public void enemyoff(){\n getWorld().removeObject(this);\n }",
"public void removeObject(AdvObject obj) {\n\t\tobjects.remove(obj); // Replace with your code\n\t}",
"public void removeOverlayObj(IOverlay a)\n/* 96: */ {\n/* 97:153 */ this.mapPanel.removeOverlayObj(a);\n/* 98: */ }",
"public void act() \n {\n if(Greenfoot.mousePressed(this)){\n World world = getWorld();\n world.removeObject(this);\n }\n }",
"void figureRemovedAt(Location loc);",
"public void removeVertex();",
"void unsetObjectives();",
"public void clearCircle();",
"public void clear() { drawData.clear(); }",
"private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}",
"public void undo() {\n compositionManager.ungroup(group);\n }",
"public void removePainter(Integer id);",
"@Override\n\tpublic void destroy()\n\t{\n\t\tprojectileCount--;\n\t\trbCount--;\n\t}",
"public void clear(){\n\t\tfor (LinkedList<Line> list : lineLists){\n\t\t\tfor (Line l : list){\n\t\t\t\tpane.getChildren().remove(l);\n\t\t\t}\n\t\t\tlist.clear();\n\t\t}\n\t\tfor (Line l : bezierCurve){\n\t\t\tpane.getChildren().remove(l);\n\t\t}\n\t\tbezierCurve.clear();\n\t\t\n\t\tlineLists.clear();\n\t\tlineLists.add(new LinkedList<Line>());\n\t}",
"void removeBall(Coordinates at);",
"@Override\n public void onDone() {\n /*try {\n mOverlay.remove(mEyesGraphic);\n }catch (NullPointerException e){\n e.printStackTrace();\n }*/\n }",
"public void remove();",
"public void remove();",
"public void remove();",
"public void remove();",
"public void remove();",
"@Override\n\tpublic void undo() {\n\t\tthis.list.delete(shape);\n\n\t}",
"void removeDrawDetail(Pool pool);",
"public void doRemove() throws VisADException, RemoteException {\n rangeRings = null;\n super.doRemove();\n }",
"protected void cleanup() throws QTException {\n switch(action) {\n case REMOVE_DRAWING_COMPLETE_PROC:\n MoviePlayer player = (MoviePlayer)needsCleaning[0];\n if (player == null) return;\n Movie movie = player.getMovie();\n movie.removeDrawingCompleteProc();\n player.setGWorld(QDGraphics.scratch);\n needsCleaning[0] = null;\n }\n }",
"public void removeSprites(){\r\n\r\n\t}",
"private void removeCrossReference ()\n\t{\n\t\tif (crossReference != null)\n\t\t{\n\t\t\tcrossReferences.remove (crossReference);\n\t\t}\n\t}",
"private void clear() {\n\t\tremoveAll();\n\t\taddCircle();\n\t}",
"Object remove();",
"private void removeFigureFromPlayerCollection(Figure figure, Player player) {\n player.removeFigure(figure);\n }",
"public void removeSelected()\n {\n for (int i = shapes.size() - 1; i >= 0; i--)\n {\n SceneShape s = shapes.get(i);\n if (s.isSelected()) shapes.remove(i);\n }\n repaint();\n }",
"void removeLayer(int whichLayer);",
"public void clearScreen()\n {\n showText(\"\", 150, 175);\n List objects = getObjects(null);\n if(objects != null)\n {\n removeObjects(objects);\n }\n }",
"void destroy() {\n\t\tdespawnHitbox();\n\t\tinventory.clear();\n\t\texperience = 0;\n\t\tinvalid = true;\n\t}",
"synchronized public void destroy() {\n \t\tsuper.destroy();\n \t\tp = null;\n \t\tp_layer = null;\n \t}",
"public void remove(GameObject object) {\n\t\tgameObjects.remove(object);\t\n\t}",
"public void erase()\n {\n canvas.eraseCircle(xPosition, yPosition, diameter);\n }",
"public void mouseMoved(GraphicObject graphicObject, Event event) {\n\t\tint x, y;\n\t\t\n\t\tx = DOM.eventGetClientX(event) - canvas.getAbsoluteLeft() + Window.getScrollLeft();\n\t\ty = DOM.eventGetClientY(event) - canvas.getAbsoluteTop() + Window.getScrollTop(); \n\t\t\n\t\tif(action.isSelect()) {\n /** If the user clicked on the object, it then performs a translation */\n if((isMovable) && (curr_obj != null)) {\n\t\t\t\tcurr_obj.uTranslate(x - lastPosition[0], y - lastPosition[1]);\n\t\t\t\ttransformPoints.uTranslate(x - lastPosition[0], y - lastPosition[1]);\n\n lastPosition[0] = x;\n\t\t\t\tlastPosition[1] = y;\n /** If the user has clicked on a Transformation Point, it performs the given transformation */\n } else if(isTransformable) {\n\t\t\t\ttransformObject(x, y);\n\t\t\t}\n\n /* Drawing with pencil. This adds a new point to the path */\n } else if(action.isPencil() && (curr_obj != null)) {\n\t\t\t((Path)curr_obj).lineTo(x, y);\n\n /* Drawing a line. This updates the line end point */\n } else if(action.isLine() && (curr_obj != null)) {\n\t\t\tcanvas.remove(curr_obj);\n\t\t\t\n\t\t\tcurr_obj = new Line(0, 0, x - objPosition[0], y - objPosition[1]);\n\t\t\taddGraphicObject( curr_obj, objPosition[0], objPosition[1]);\n\n /* Drawing a rectangle. This updates the rectangle's size and position*/\n } else if(action.isRectangle() && (curr_obj != null)) {\n\t\t\tcanvas.remove(curr_obj);\n\t\t\t\n\t\t\t/* Lower right corner */\n\t\t\tif(x > objPosition[0] && y > objPosition[1]) {\t\n\t\t\t\tcurr_obj = new Rect(x - objPosition[0], y - objPosition[1]);\n\t\t\t\taddGraphicObject( curr_obj, objPosition[0], objPosition[1]);\n\t\t\t\t\n\t\t\t/* Upper right corner*/\n\t\t\t} else if(x > objPosition[0] && y < objPosition[1]) {\n\t\t\t\tcurr_obj = new Rect(x - objPosition[0], objPosition[1] - y);\n\t\t\t\taddGraphicObject( curr_obj, objPosition[0], y);\n\t\t\t\n\t\t\t/* Lower left corner*/\n\t\t\t} else if(x < objPosition[0] && y > objPosition[1]) {\n\t\t\t\tcurr_obj = new Rect(objPosition[0] - x, y - objPosition[1]);\n\t\t\t\taddGraphicObject( curr_obj, x, objPosition[1]);\n\t\t\t\n\t\t\t/* Upper left corner*/\n\t\t\t} else if(x < objPosition[0] && y < objPosition[1]) {\n\t\t\t\tcurr_obj = new Rect(objPosition[0] - x, objPosition[1] - y);\n\t\t\t\taddGraphicObject( curr_obj, x, y);\t\t\t\t\n\t\t\t}\n\n /* Drawing a circle. This updates the circle's diameter */\n } else if(action.isCircle() && (curr_obj != null)) {\n\t\t\tint abs_x = Math.abs(x - objPosition[0]);\n\t\t\tint abs_y = Math.abs(y - objPosition[1]);\n\t\t\t\n\t\t\tcanvas.remove(curr_obj);\n\t\t\t\n\t\t\tif(abs_x > abs_y) {\n\t\t\t\tcurr_obj = new Circle(abs_x);\n\t\t\t} else {\n\t\t\t\tcurr_obj = new Circle(abs_y);\n\t\t\t}\n\t\t\taddGraphicObject( curr_obj, objPosition[0], objPosition[1] );\n\n /* Drawing a ellipse. This updates both ellipse's diameters */\n } else if(action.isEllipse() && (curr_obj != null)) {\n\t\t\tcanvas.remove(curr_obj);\n\t\t\t\n\t\t\t/* Lower right corner */\n\t\t\tif(x > objPosition[0]+1 && y > objPosition[1]+1) {\n\t\t\t\tcurr_obj = new Ellipse((x - objPosition[0])/2, (y - objPosition[1])/2);\n\t\t\t\taddGraphicObject( curr_obj, objPosition[0] + ((x - objPosition[0])/2), objPosition[1] + ((y - objPosition[1])/2));\n\t\t\t\t\n\t\t\t/* Upper right corner*/\n\t\t\t} else if(x > objPosition[0]+1 && y+1 < objPosition[1]) {\t\t\t\t\n\t\t\t\tcurr_obj = new Ellipse((x - objPosition[0])/2, (objPosition[1] - y)/2 );\n\t\t\t\taddGraphicObject( curr_obj, objPosition[0] + ((x - objPosition[0])/2), objPosition[1] - ((objPosition[1] - y)/2));\n\t\t\t\n\t\t\t/* Lower left corner*/\n\t\t\t} else if(x+1 < objPosition[0] && y > objPosition[1]+1) {\n\t\t\t\tcurr_obj = new Ellipse((objPosition[0] - x)/2, (y - objPosition[1])/2);\n\t\t\t\taddGraphicObject( curr_obj, objPosition[0] - ((objPosition[0] - x)/2), objPosition[1] + ((y - objPosition[1])/2));\n\t\t\t\n\t\t\t/* Upper left corner*/\n\t\t\t} else if(x+1 < objPosition[0] && y+1 < objPosition[1]) {\n\t\t\t\tcurr_obj = new Ellipse((objPosition[0] - x)/2, (objPosition[1] - y)/2);\n\t\t\t\taddGraphicObject( curr_obj, objPosition[0] - ((objPosition[0] - x)/2), objPosition[1] - ((objPosition[1] - y)/2));\t\t\t\t\n\t\t\t}\n\n /** Drawing a TextBox. This updates the TextBox's size and position. */\n } else if(action.isTextBox() && (curr_obj != null)) {\n\t\t\tcanvas.remove(curr_obj);\n\n\t\t\t/* Lower right corner */\n\t\t\tif(x > objPosition[0] && y > objPosition[1]) {\n\t\t\t\tcurr_obj = new com.objetdirect.tatami.client.gfx.TextBox(x - objPosition[0], y - objPosition[1], null);\n\t\t\t\taddTextBox( curr_obj, objPosition[0], objPosition[1]);\n\n\t\t\t/* Upper right corner*/\n\t\t\t} else if(x > objPosition[0] && y < objPosition[1]) {\n\t\t\t\tcurr_obj = new com.objetdirect.tatami.client.gfx.TextBox(x - objPosition[0], objPosition[1] - y, null);\n\t\t\t\taddTextBox( curr_obj, objPosition[0], y);\n\n\t\t\t/* Lower left corner*/\n\t\t\t} else if(x < objPosition[0] && y > objPosition[1]) {\n\t\t\t\tcurr_obj = new com.objetdirect.tatami.client.gfx.TextBox(objPosition[0] - x, y - objPosition[1], null);\n\t\t\t\taddTextBox( curr_obj, x, objPosition[1]);\n\n\t\t\t/* Upper left corner*/\n\t\t\t} else if(x < objPosition[0] && y < objPosition[1]) {\n\t\t\t\tcurr_obj = new com.objetdirect.tatami.client.gfx.TextBox(objPosition[0] - x, objPosition[1] - y, null);\n\t\t\t\taddTextBox( curr_obj, x, y);\n\t\t\t}\n\n /** Drawing a polyline, this updates the current point's position */\n } else if(this.action.isPolyline() && (this.curr_obj != null)) {\n if(DOM.eventGetButton(event) == Event.BUTTON_LEFT) {\n\n this.canvas.remove(this.curr_obj);\n this.curr_obj = new Path(this.currentPath);\n ((Path)this.curr_obj).smoothCurveTo( x, y, lastPosition[0], lastPosition[1]);\n this.addGraphicObject(this.curr_obj, 0, 0);\n } else {\n this.canvas.remove(this.curr_obj);\n this.curr_obj = new Path(this.currentPath);\n ((Path)this.curr_obj).lineTo(x, y);\n this.addGraphicObject(this.curr_obj, 0, 0);\n }\n }\n }",
"public void clear() {\n\t\tpointList.clear();\n\t\tySum = 0;\n\t}",
"public void undoMove(){\n circleObj.setX(oldX);\n circleObj.setY(oldY); \n }"
] | [
"0.6729262",
"0.6612344",
"0.6602157",
"0.6463408",
"0.64537424",
"0.6444445",
"0.6432393",
"0.6278594",
"0.6187124",
"0.61772466",
"0.61466056",
"0.61368185",
"0.6118663",
"0.6115067",
"0.60556704",
"0.60394603",
"0.60175306",
"0.60122967",
"0.60044074",
"0.599404",
"0.59748584",
"0.59713626",
"0.59643453",
"0.5949517",
"0.5902908",
"0.58934444",
"0.58930194",
"0.5885556",
"0.5861843",
"0.58592904",
"0.5850935",
"0.58426076",
"0.584117",
"0.58383834",
"0.5835149",
"0.5822833",
"0.58174974",
"0.58136",
"0.5804188",
"0.58009356",
"0.5800298",
"0.5796777",
"0.5792299",
"0.5788105",
"0.5787756",
"0.57832044",
"0.5764347",
"0.5763739",
"0.57579577",
"0.5755447",
"0.5754455",
"0.5747363",
"0.57469916",
"0.57404774",
"0.5736147",
"0.571444",
"0.5709993",
"0.5702027",
"0.56846076",
"0.5683199",
"0.5678851",
"0.5677921",
"0.5677317",
"0.5677041",
"0.5675507",
"0.56742543",
"0.5664751",
"0.5661382",
"0.5648916",
"0.5639637",
"0.56391084",
"0.5638986",
"0.56362975",
"0.5630397",
"0.5627032",
"0.5622568",
"0.56224746",
"0.56224746",
"0.56224746",
"0.56224746",
"0.56224746",
"0.5614064",
"0.561394",
"0.56138086",
"0.55944264",
"0.55920833",
"0.5587378",
"0.55868447",
"0.5586434",
"0.5580878",
"0.5579693",
"0.5571118",
"0.55702484",
"0.55680925",
"0.55629325",
"0.555933",
"0.55586475",
"0.5555033",
"0.55479014",
"0.5547415"
] | 0.85189 | 0 |
Method to send the Graphic Object to the back of the DOM order | private void backObject() {
if(this.curr_obj != null) {
this.curr_obj.uMoveToBack();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract void saveGraphicsState();",
"public void restoreGraphics() {\n\n if ( g2 instanceof AimxcelGraphics2D ) {\n AimxcelGraphics2D aimxcelGraphics2D = (AimxcelGraphics2D) g2;\n aimxcelGraphics2D.popState();\n }\n else {\n if ( g2.getRenderingHints() != renderingHints ) {\n g2.setRenderingHints( renderingHints );\n }\n if ( g2.getPaint() != paint ) {\n g2.setPaint( paint );\n }\n if ( g2.getColor() != color ) {\n g2.setColor( color );\n }\n if ( g2.getStroke() != stroke ) {\n g2.setStroke( stroke );\n }\n if ( g2.getComposite() != composite ) {\n g2.setComposite( composite );\n }\n if ( g2.getTransform() != transform ) {\n g2.setTransform( transform );\n }\n if ( g2.getFont() != font ) {\n g2.setFont( font );\n }\n if ( g2.getClip() != clip ) {\n g2.setClip( clip );\n }\n if ( g2.getBackground() != background ) {\n g2.setBackground( background );\n }\n }\n }",
"@Override\n public void handlePaint()\n {\n for(GraphicObject obj : this.graphicObjects)\n {\n obj.draw();\n }\n \n }",
"private void draw() {\n gsm.draw(g);\n }",
"private void flushElements() {\n if (elements != null) {\n TopItemList smallModel = new TopItemList();\n smallModel.addAll(elements);\n\n SimpleViewBuilder builder = new SimpleViewBuilder();\n\n // scale Compute\n double scale = (double) lineHeight\n / drawingSpecifications.getMaxCadratHeight();\n\n MDCView view = builder.buildView(smallModel,\n drawingSpecifications);\n\n if (view.getWidth() == 0 || view.getHeight() == 0) {\n return;\n }\n ViewDrawer drawer = new ViewDrawer();\n\n BufferedImage image = new BufferedImage((int) Math.ceil(view\n .getWidth()\n * scale + 1), (int) Math.ceil(view.getHeight() * scale\n + 2 * pictureMargin + 1), BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g = image.createGraphics();\n GraphicsUtils.antialias(g);\n\n g.setColor(backgroundColor);\n g.fillRect(0, 0, image.getWidth(), image.getHeight());\n g.setColor(drawingSpecifications.getBlackColor());\n g.translate(1, 1 + pictureMargin);\n\n g.scale(scale, scale);\n drawer.draw(g, view, drawingSpecifications);\n g.dispose();\n\n File fic = getImageFile(imageNumber);\n try {\n ImageIO.write(image, \"png\", fic); //$NON-NLS-1$\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n String center = \"\"; //$NON-NLS-1$\n\n if (centerPictures) {\n center = \" align='center' \"; //$NON-NLS-1$\n }\n if (pictureScale != 100) {\n write(\"<img \" + center + \" src='\" + fic.getName() //$NON-NLS-1$ //$NON-NLS-2$\n + \"' width='\" + pictureScale + \"%' height='\" //$NON-NLS-1$ //$NON-NLS-2$\n + pictureScale + \"%'>\"); //$NON-NLS-1$\n\n } else if (generatePictureSize) {\n write(\"<img \" + center + \" src='\" + fic.getName() //$NON-NLS-1$ //$NON-NLS-2$\n + \"' width='\" + image.getWidth() + \"' height='\" //$NON-NLS-1$ //$NON-NLS-2$\n + image.getHeight() + \"'>\"); //$NON-NLS-1$\n } else {\n write(\"<img \" + center + \"src='\" + fic.getName() + \"'>\"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n }\n imageNumber++;\n image.flush();\n elements = null;\n }\n }",
"@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}",
"public void draw() {\n \n // TODO\n }",
"void writeGraphics() throws Exception;",
"protected abstract void restoreGraphicsState();",
"@Override\n public void save() {\n graphicsEnvironmentImpl.save(canvas);\n }",
"public void redraw() {\n\t\tif(this.getGraphics() != null){\n\t\t\tthis.getGraphics().drawImage(imageBuffer, 0, 0, this); // Swap\n\t\t}\n\t}",
"@Override\n\tpublic void draw() {\n\n\t}",
"@Override\n\tpublic void draw() {\n\n\t}",
"public void completeRedraw()\r\n\t{\r\n\t\tg = (Graphics2D) s.getDrawGraphics();\r\n\t}",
"public void drawOn(Graphics g);",
"public void addGraphicObject(GraphicObject obj)\n {\n graphicObjects.addLast(obj);\n }",
"@Override\n public void draw()\n {\n }",
"@Override\r\n public void draw() {\n }",
"@Override\n\tpublic void draw() {\n\t}",
"public String draw() {\n\t\treturn null;\r\n\t}",
"void reDraw();",
"public void draw(){\n\t\tcomponent.draw();\r\n\t}",
"@Override\n public void draw() {\n }",
"protected void render() {\n\t\tentities.render();\n\t\t// Render GUI\n\t\tentities.renderGUI();\n\n\t\t// Flips the page between the two buffers\n\t\ts.drawToGraphics((Graphics2D) Window.strategy.getDrawGraphics());\n\t\tWindow.strategy.show();\n\t}",
"void draw() {\n\t\t// display debug information\n\t\t// if (debugMode)\n\t\t// displayDebugInformation();\n\n\t\tupdate();\n\t\trender(); // display freetransform points, lines and colorings\n\n\t\t// display opposite objects\n\t\t// displayOppositeObject();\n\t}",
"@Override\n\tpublic void draw() {\n\t\t\n\t}",
"@Override\n\tpublic void draw() {\n\t\t\n\t}",
"@Override\n\tpublic void redraw() {\n\t\t\n\t}",
"public void drawAllGraphics(){\r\n\t\t \r\n\t}",
"public void draw() {\n\t\tsuper.repaint();\n\t}",
"private void updateObjects(Graphics g){\n\t\tclearMhos(g);\n\t\tclearPlayer(g);\n\t\tdrawMhos(g);\n\t\tdrawPlayer(g);\n\t\tdrawFences(g);\n\t\tDraw.drawInstructions(g,smallFont);\n\t}",
"public Graphics2D createGraphics() {\n\treturn recorder.createGraphics();\n }",
"@Override\n\tpublic void render(Graphics g)\n\t{\n\t}",
"@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}",
"@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}",
"final void drawobj(java.awt.Graphics g) {\n\t\tdraw(g, Engine.scaleX(x), Engine.scaleY(y));\n\t}",
"public void draw() {\n }",
"private void render() {\n\t\ttheMap.draw(g);\n\t\ttheTrainer.draw(g);\n\t}",
"public Graphic getGraphic(){\r\n\t\treturn this.graphic;\r\n\t}",
"public void endDrawing();",
"@Override\n public void paint(Graphics g1){\n\n try{\n super.paint(g1);\n\n drawSymbols_Rel( g1 );\n drawSymbols_Att( g1 );\n /**\n //==== only for test ====\n this.setComplexRelationsCoordinates(20, 28, 33, 38);\n this.setComplexRelationsCoordinates_extraEnds(400, 404);\n */\n\n drawComplexRelationship(g1);\n drawPath(g1);\n \n \n \n }catch(Exception ex){\n }\n }",
"public Graphics getGraphics() {\n return graphics_;\n }",
"public void toBack() {\n internalGroup.toBack();\n dataTrait.zIndex = internalGroup.getZIndex();\n }",
"private void render()\n {\n //Applicazione di un buffer \"davanti\" alla tela grafica. Prima di disegnare \n //sulla tela grafica il programma disegnerà i nostri oggetti grafici sul buffer \n //che, in seguito, andrà a disegnare i nostri oggetti grafici sulla tela\n bufferStrategico = display.getTelaGrafica().getBufferStrategy();\n \n //Se il buffer è vuoto (== null) vengono creati 3 buffer \"strategici\"\n if(bufferStrategico == null)\n {\n display.getTelaGrafica().createBufferStrategy(3);\n return;\n }\n \n //Viene definito l'oggetto \"disegnatore\" di tipo Graphic che disegnerà i\n //nostri oggetti grafici sui nostri buffer. Può disegnare qualsiasi forma\n //geometrica\n disegnatore = bufferStrategico.getDrawGraphics();\n \n //La riga seguente pulisce lo schermo\n disegnatore.clearRect(0, 0, larghezza, altezza);\n \n //Comando per cambiare colore dell'oggetto \"disegnatore\". Qualsiasi cosa\n //disengata dal disegnatore dopo questo comando avrà questo colore.\n \n /*disegnatore.setColor(Color.orange);*/\n \n //Viene disegnato un rettangolo ripieno. Le prime due cifre indicano la posizione \n //da cui il nostro disegnatore dovrà iniziare a disegnare il rettangolo\n //mentre le altre due cifre indicano le dimensioni del rettangolo\n \n /*disegnatore.fillRect(10, 50, 50, 70);*/\n \n //Viene disegnato un rettangolo vuoto. I parametri hanno gli stessi valori\n //del comando \"fillRect()\"\n \n /*disegnatore.setColor(Color.blue);\n disegnatore.drawRect(0,0,10,10);*/\n \n //I comandi seguenti disegnano un cerchio seguendo la stessa logica dei\n //rettangoli, di colore verde\n \n /*disegnatore.setColor(Color.green);\n disegnatore.fillOval(50, 10, 50, 50);*/\n \n /*Utilizziamo il disegnatore per caricare un'immagine. Il primo parametro\n del comando è l'immagine stessa, il secondo e il terzo parametro sono \n le coordinate dell'immagine (x,y) mentre l'ultimo parametro è l'osservatore\n dell'immagine (utilizzo ignoto, verrà impostato a \"null\" in quanto non\n viene usato)*/\n //disegnatore.drawImage(testImmagine,10,10,null);\n \n /*Comando che disegna uno dei nostri sprite attraverso la classe \"FoglioSprite\".*/\n //disegnatore.drawImage(foglio.taglio(32, 0, 32, 32), 10, 10,null);\n \n /*Viene disegnato un albero dalla classe \"Risorse\" attraverso il disegnatore.*/\n //disegnatore.drawImage(Risorse.omino, x, y,null);\n \n /*Se lo stato di gioco esiste eseguiamo la sua renderizzazione.*/\n if(Stato.getStato() != null)\n {\n \t Stato.getStato().renderizzazione(disegnatore);\n }\n \n //Viene mostrato il rettangolo\n bufferStrategico.show();\n disegnatore.dispose();\n }",
"private void paintHand3(Graphics2D gfx)\r\n {\n \r\n }",
"@Override\n public void restore() {\n graphicsEnvironmentImpl.restore(canvas);\n }",
"@Override\n\tpublic void draw(Graphics g) {\n\t\t\n\t}",
"@Override\n\tpublic void draw(Graphics g) {\n\t\t\n\t}",
"protected void clearToBack()\n {\n\tGraphics g = getGraphics();\n\tsetRenderColor(g,getBackground());\n\trenderFilledRect(g,0,0,width,height);\n }",
"public void render() {\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null) { //if the buffer strategy doesnt get created, then you create it\n\t\t\tcreateBufferStrategy(3); //the number 3 means it creates triple buffering\n\t\t\treturn;\t\t\t\t\t//, so when you backup frame gets displayed (2) it will also have a backup\t\n\t\t}\n\t\t\n\t\t//apply data to the buffer \"bs\"\n\t\t//this is creating a link to graphics to drawing graphics to the screen.\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t/**\n\t\t * You input all of your graphics inbetween the g object and g.dispose();\n\t\t */\n\t\t//###################\n\t\t\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\t//###################\n\t\tg.dispose(); //this dispose of all the graphics\n\t\tbs.show(); //this will make the next available buffer visible\n\t}",
"public void draw() {\n \n }",
"public void go() {\n update();\n borders();\n render();\n }",
"public PGraphics push() {\n\t\tPGraphics pg = papplet.createGraphics(papplet.width, papplet.height);\n\t\tpg.clear();\n\t\treturn push(pg);\n\t}",
"@Override\n\tpublic void withdraw() {\n\t\t\n\t}",
"public void draw() {\n\n }",
"public void draw(){\n }",
"private void render() {\n\t\tBufferStrategy buffStrat = display.getCanvas().getBufferStrategy();\n\t\tif(buffStrat == null) {\n\t\t\tdisplay.getCanvas().createBufferStrategy(3); //We will have 3 buffered screens for the game\n\t\t\treturn;\n\t\t}\n\n\t\t//A bufferstrategy prevents flickering since it preloads elements onto the display.\n\t\t//A graphics object is a paintbrush style object\n\t\tGraphics g = buffStrat.getDrawGraphics();\n\t\t//Clear the screen\n\t\tg.clearRect(0, 0, width, height); //Clear for further rendering\n\t\t\n\t\tif(State.getState() !=null) {\n\t\t\tState.getState().render(g);\n\t\t}\n\t\t//Drawings to be done in this space\n\t\t\n\t\t\n\t\t\n\t\tbuffStrat.show();\n\t\tg.dispose();\n\t}",
"private void render() {\n\n\tbs=display.getCanvas().getBufferStrategy();\t\n\t\n\tif(bs==null) \n\t {\t\n\t\tdisplay.getCanvas().createBufferStrategy(3);\n\t\treturn ;\n\t }\n\t\n\tg=bs.getDrawGraphics();\n\n\t//Clear Screen\n\tg.clearRect(0, 0, width, height);\n\t\n\tif(State.getState()!=null )\n\t\tState.getState().render(g);\n\t\n\t//End Drawing!\n\tbs.show();\n\tg.dispose();\n\t\n\t}",
"void draw() {\n scsw.draw();\n \n}",
"@Override\r\n public void draw()\r\n {\n\r\n }",
"@Override\n protected void finalRender() {\n finishTraversalAnimation();\n placeTreeNodes();\n placeNodesAtDestination();\n render();\n\n }",
"public void showNet()\n/* */ {\n/* 482 */ update(getGraphics());\n/* */ }",
"protected abstract void draw();",
"public void draw(Graphics window);",
"void render(Graphics g);",
"public abstract void draw(Object o);",
"public void draw() {\n draw(root, false);\n }",
"public void flush(){\r\n\t\tColor tempcol = screengraphics.getColor();\r\n\t\tscreengraphics.setColor(backgroundcolor);\r\n\t\tscreengraphics.fillRect(0, 0, sizex, sizey);\r\n\t\tscreengraphics.dispose();\r\n\t\tstrategy.show();\r\n\t\tscreengraphics =(Graphics2D) strategy.getDrawGraphics();\r\n\t\tscreengraphics.setColor(backgroundcolor);\r\n\t\tscreengraphics.fillRect(0, 0, sizex, sizey);\r\n\t\tscreengraphics.dispose();\r\n\t\tstrategy.show();\r\n\t\tscreengraphics =(Graphics2D) strategy.getDrawGraphics();\r\n\t\tscreengraphics.setColor(tempcol);\r\n\t\t\r\n\t}",
"@Override\n\tpublic void draw(Graphics2D g) {\n\t\t\n\t}",
"public void draw(Graphics g){\r\n\r\n /*\r\n we want to create 2D graphics for better performance\r\n g.create() will create a new reference so that we don't use the old one and create problems\r\n */\r\n\r\n Graphics2D graphics2D = (Graphics2D)g.create();\r\n\r\n //this makes graphics more smooth\r\n graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\r\n\r\n //this rotates the obstacle to that angle and it rotates around a position around its own\r\n graphics2D.rotate(Math.toRadians(angle),getXPosition(),getYPosition());\r\n\r\n //set the color and draw the object frame into the screen\r\n graphics2D.setColor(getFrame().getColor());\r\n graphics2D.fill(getFrame().getModel());\r\n\r\n //set the color and draw the object into the screen\r\n graphics2D.setColor(getColor());\r\n graphics2D.fill(getModel());\r\n\r\n //in order to not use too much memory, and because we don't need it any more, we will dispose the graphics object\r\n graphics2D.dispose();\r\n\r\n }",
"void dynamicRendering(ConversationBlip startBlip);",
"public void draw()\r\n\t\t{\r\n\t\tfor(PanelStationMeteo graph: graphList)\r\n\t\t\t{\r\n\t\t\tgraph.repaint();\r\n\t\t\t}\r\n\t\t}",
"public void draw() {\n //Grey background, which removes the tails of the moving elements\n background(0, 0, 0);\n //Running the update function in the environment class, updating the positions of stuff in environment\n //update function is a collection of the methods needing to be updated\n if(stateOfProgram == 0) { startTheProgram.update(); }\n if(stateOfProgram == 1) {\n theEnvironment.update();\n //update function is a collection of the methods needing to be updated\n //Running the update function in the Population class, updating the positions and states of the rabbits.\n entitiesOfRabbits.update();\n entitiesOfGrass.update();\n entitiesOfFoxes.update();\n\n entitiesOfRabbits.display();\n entitiesOfGrass.display();\n entitiesOfFoxes.display();\n openGraph.update();\n }\n }",
"public void render(){\n\t\tBufferStrategy bs = frame.getBufferStrategy();\n\t\tif(bs == null){\n\t\t\tframe.createBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\trenderGraphics(bs);\n\t}",
"public void withdraw() {\n\t\t\t\n\t\t}",
"public void render()\n\t{\n\t\tBufferStrategy bs = this.getBufferStrategy();\n\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t//////////////////////////////\n\n\t\tg.setColor(Color.DARK_GRAY);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\tif (display != null && GeneticSimulator.updateRendering)\n\t\t{\n\t\t\tg.drawImage(display, 0, 0, getWidth(), getHeight(), this);\n\t\t}\n\n\t\tWorld world = GeneticSimulator.world();\n\n\t\tworld.draw((Graphics2D) g, view);\n\n\t\tg.setColor(Color.WHITE);\n\t\tg.drawString(String.format(\"view: [%2.1f, %2.1f, %2.1f, %2.1f, %2.2f]\", view.x, view.y, view.width, view.height, view.PxToWorldScale), (int) 10, (int) 15);\n\n\t\tg.drawString(String.format(\"world: [time: %2.2f pop: %d]\", world.getTime() / 100f, World.popCount), 10, 30);\n\n\t\tg.drawRect(view.pixelX, view.pixelY, view.pixelWidth, view.pixelHeight);\n//\t\tp.render(g);\n//\t\tc.render(g);\n\n\n\t\t//g.drawImage(player,100,100,this);\n\n\t\t//////////////////////////////\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"@Override\n\tpublic void draw(Graphics2D g2d) {\n\t\t\n\t}",
"public abstract void render(Graphics2D graphics);",
"public void draw();",
"public void draw();",
"public void draw();",
"@Override\n\tpublic void draw() {\n\t\tbg.draw();\n\t\tfor(Test2 t : test)\n\t\t\tt.draw();\n\t\tfor(Test2 t : test2)\n\t\t\tt.draw();\n\t\t\n\t\tfor(Test2 t : test3)\n\t\t\tt.draw();\n\t\tobj.draw();\n\t\tEffect().drawEffect(1);\n\t}",
"public void draw() {\r\n System.out.print(this);\r\n }",
"public abstract void draw( );",
"@Override\r\n\tpublic void paint(Graphics g) {\n\t\tsuper.paint(g);\r\n\t\trender(g);\r\n\t}",
"public void makeGraphic() {\n\t\tStdDraw.clear();\n\n\t\tfor (int i = 0; i < p.showArray.size(); i++) {\n\t\t\tStdDraw.setPenColor(0, 255, 255);\n\n\t\t\tStdDraw.circle(p.showArray.get(i).acquirePosition().x, p.showArray.get(i).acquirePosition().y,\n\t\t\t\t\tp.showArray.get(i).acquireSizeOfBody());\n\t\t\tStdDraw.setPenColor(StdDraw.GRAY);\n\n\t\t\tStdDraw.filledCircle(p.showArray.get(i).acquirePosition().x, p.showArray.get(i).acquirePosition().y,\n\t\t\t\t\tp.showArray.get(i).acquireSizeOfBody());\n\n\t\t}\n\t\tStdDraw.show();\n\t}",
"public void draw() {\n GraphicsContext gc = getGraphicsContext2D();\n /*gc.clearRect(0, 0, getWidth(), getHeight());\n\n if (squareMap != null) {\n squareMap.draw(gc);\n }\n if (hexMap != null) {\n hexMap.draw(gc);\n }*/\n\n // Draw animations\n for (SpriteAnimationInstance anim : animationList) {\n anim.draw(gc);\n }\n\n // Lastly draw the dialogue window, no matter which canvas\n // we are on, all the same.\n DfSim.dialogueWindow.draw(gc);\n\n /*if (landMap != null) {\n landMap.draw(gc);\n }*/\n\n // Draw a border around the canvas\n //drawBorder(gc);\n\n // And now just draw everything directly from the simulator\n /*for (Raindrop item : sim.getDrops()) {\n drawMovableCircle(gc, item);\n }\n for (Earthpatch item : sim.getPatches()) {\n drawMovableCircle(gc, item);\n }\n for (SysShape item : sim.getShapes()) {\n drawSysShape(gc, item);\n }\n for (Spike item : sim.getSpikes()) {\n drawMovablePolygon(gc, item);\n }\n for (GravityWell item : sim.getGravityWells()) {\n drawGravityWell(gc, item);\n }*/\n }",
"public void addNotify()\n {\n super.addNotify();\n\t\n ib = createImage(width,height);\n ig = ib.getGraphics(); \n }",
"protected abstract GraphicsWriter newGraphicsWriter();",
"public void draw(Graphics graphics);",
"protected abstract void render(Graphics g);",
"public void render(Graphics g) {\n\t}",
"public void draw()\n {\n inorder(root);\n }",
"private void saveCurrentObject() {\n\t}",
"public void swap() {\n\t\tPGraphics tmp = this.src;\n\t\tthis.src = this.dst;\n\t\tthis.dst = tmp;\n\t}",
"public void toutDessiner(Graphics g);",
"private void sendDrawEndEvent() {\n\t\tint type = this.drawType;\n\t\tthis.deactivate();\n\t\tthis.activate(type);\n\t}",
"private void render() {\n bs = display.getCanvas().getBufferStrategy();\n /* if it is null, we define one with 3 buffers to display images of\n the game, if not null, then we display every image of the game but\n after clearing the Rectanlge, getting the graphic object from the \n buffer strategy element. \n show the graphic and dispose it to the trash system\n */\n if (bs == null) {\n display.getCanvas().createBufferStrategy(3);\n } else {\n g = bs.getDrawGraphics();\n g.drawImage(Assets.background, 0, 0, width, height, null);\n g.setColor(Color.white);\n g.drawLine(0, 500, 595, 500);\n player.render(g);\n for (int i = 0; i < aliens.size(); i++) {\n Alien al = aliens.get(i);\n al.render(g);\n }\n if (shotVisible) {\n shot.render(g);\n }\n\n if(gameOver==false)\n {\n gameOver();\n }\n for(Alien alien: aliens){\n Bomb b = alien.getBomb();\n b.render(g);\n }\n g.setColor(Color.red);\n Font small = new Font(\"Helvetica\", Font.BOLD, 20);\n g.setFont(small);\n g.drawString(\"G - Guardar\", 10, 50);\n g.drawString(\"C - Cargar\", 10, 70);\n g.drawString(\"P - Pausa\", 10, 90);\n\n if(keyManager.pause)\n {\n g.drawString(\"PAUSA\", 250, 300);\n }\n \n bs.show();\n g.dispose();\n }\n\n }",
"@Override\n\tpublic void draw(Graphics2D g2d) {\n\t\ts.draw(g2d);\n\t}",
"public void repaint(Graphic graphic, Rectangle2D objectiveArea, Rectangle displayArea) {\n }"
] | [
"0.62688446",
"0.62327373",
"0.61285007",
"0.6098016",
"0.59584105",
"0.5948837",
"0.5948837",
"0.59316385",
"0.59136873",
"0.586102",
"0.58199906",
"0.5800782",
"0.5778449",
"0.5778449",
"0.576159",
"0.57613117",
"0.57592463",
"0.5751182",
"0.57226783",
"0.5721",
"0.5713035",
"0.57118434",
"0.57071567",
"0.5699464",
"0.56973207",
"0.569523",
"0.56925935",
"0.56925935",
"0.5691318",
"0.5685769",
"0.5681502",
"0.56540847",
"0.5652007",
"0.56393504",
"0.56389004",
"0.56389004",
"0.56354636",
"0.56088597",
"0.5606366",
"0.5602986",
"0.5597969",
"0.55874366",
"0.5585044",
"0.55783135",
"0.55666506",
"0.5558872",
"0.55564815",
"0.5545926",
"0.5545926",
"0.55404705",
"0.5536796",
"0.5527118",
"0.5525807",
"0.55249083",
"0.5518983",
"0.5494218",
"0.54928017",
"0.54887897",
"0.5488194",
"0.5487909",
"0.54854894",
"0.5484967",
"0.54506505",
"0.5448676",
"0.54430246",
"0.5442627",
"0.5433661",
"0.5423224",
"0.5417313",
"0.5416464",
"0.54140735",
"0.5410058",
"0.540307",
"0.53973514",
"0.53919184",
"0.5385071",
"0.538405",
"0.5379411",
"0.53779614",
"0.5377186",
"0.5377186",
"0.5377186",
"0.53765446",
"0.5370262",
"0.5369463",
"0.53684264",
"0.5367618",
"0.53631663",
"0.53586745",
"0.5358135",
"0.53567725",
"0.5355252",
"0.5350812",
"0.53436303",
"0.53400826",
"0.5336239",
"0.53339124",
"0.53309405",
"0.53296125",
"0.5329196",
"0.532511"
] | 0.0 | -1 |
Method to bring the Graphic Object to the front of the DOM order | private void frontObject() {
if(this.curr_obj != null) {
this.curr_obj.uMoveToFront();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void toFront() {\n internalGroup.toFront();\n dataTrait.zIndex = internalGroup.getZIndex();\n }",
"public void bringToFront()\n {\n this.toFront();\n }",
"public void toFront() {\n WindowPeer peer = (WindowPeer) this.peer;\n if (peer != null) {\n peer.toFront();\n }\n }",
"public void bringSimpleMapToBack()\n\t{\n\t\tthis.openLayersMap.setStyleName(\"blipnip-gwt-Menu-Map-Back\");\n\t\t//this.openLayersMap.getElement().getStyle().setZIndex(-1); \n\t\t//this.openLayersMap.getElement().getFirstChildElement().getStyle().setZIndex(-1); // \n\t}",
"public void preOrderTraversal() {\n beginAnimation();\n treePreOrderTraversal(root);\n stopAnimation();\n\n }",
"private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }",
"private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }",
"private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }",
"public void updateDrawingOrder(){\n\n //get all actors in the objectStage\n Array<Actor> actorsList = objectStage.getActors();\n actorsList.sort(new ActorComparator());\n }",
"public static void moveToFrontForDraw(GComponent comp){\n\t\tPApplet app = comp.getPApplet();\n\t\tAppletInfo info = applets.get(app);\n\t\tif(info != null && info.paControls.remove(comp)){\n\t\t\tinfo.paControls.add(comp);\n\t\t\tif(comp.parent == null && app != null && info.autoDrawOn){\n\t\t\t\tapp.unregisterDraw(comp);\n\t\t\t\tapp.registerDraw(comp);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tprotected void onLoad() {\n\t // Reset the position attribute of the parent element\n\t //DOM.setStyleAttribute(getElement(), \"position\", \"relative\");\n\t //ResizableWidgetCollection.get().add(this);\n\t redraw();\n\t }",
"public void bringToFront()\n {\n if(getExtendedState() == JFrame.ICONIFIED)\n setExtendedState(JFrame.NORMAL);\n\n this.toFront();\n }",
"public void toBack() {\n internalGroup.toBack();\n dataTrait.zIndex = internalGroup.getZIndex();\n }",
"private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n dialog.setPadding(new Insets(0,0,0,7));\n }",
"void ToFront() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public void beforeFirst() {\n\t\tmoveTo(0);\n\t}",
"public void bringToFront(int id)\n\t{\n\t\tgetObject().bringToFront(id);\n\t\treturn;\n\t}",
"private void backObject() {\n\t\tif(this.curr_obj != null) {\n this.curr_obj.uMoveToBack();\n }\n\t}",
"public void draw()\n {\n inorder(root);\n }",
"public void present()\n {\n front = (front == page1) ? page2 : page1;\n repaint();\n getToolkit().sync();\n }",
"public void inOrderTraversal() {\n beginAnimation();\n treeInOrderTraversal(root);\n stopAnimation();\n\n }",
"void movePrev()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == front) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added this because i kept failing the test cases on the grading script\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.prev; //moves cursor toward front of the list\n index--; //added this because i kept failing the test cases on the grading script\n\t\t\t}\n\t\t}\n\t}",
"void moveFront()\n\t{\n\t\tif (length != 0)\n\t\t {\n\t\t\tcursor = front;\n\t\t\tindex = 0; //cursor will be at the front\n\t\t\t\n\n\t\t}\n\t}",
"public void PreOrder() {\n\t\tPreOrder(root);\n\t}",
"void front() {\n startAnimation(frontSubCubes(), Axis.Z, Direction.CLOCKWISE);\n frontCubeSwap();\n }",
"public void preOrder() {\n preOrder(root);\n }",
"public void windowBecameFront() \n {\n return; \n }",
"public void partBroughtToTop(IWorkbenchPartReference partRef) {\n\t\t\t\t\n\t\t\t}",
"public Figure drawFromStack()\n\t{\n\t\tif (this.on_stack.size() > 0)\n\t\t{\n\t\t Random r = new Random();\n\t\t Figure rf = this.on_stack.get(r.nextInt(this.on_stack.size()));\n\t\t this.on_stack.remove(rf);\n\t\t rf.setPlacement(Placement.ON_SHELF);\n\t\t return rf;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}",
"@Override\n\tpublic void placeOrder() {\n\t\t\n\t}",
"public void setTop(Shape c) {\n\t\tif (c != null) {\n\t\t\tint i = drawData.lastIndexOf(c);\n\t\t\tif (i != -1 && i != (drawData.size() - 1)) {\n\t\t\t\tdrawData.remove(i);\n\t\t\t\tadd(c);\n\t\t\t}\n\t\t}\n\t}",
"public void sendToFront(Component component) {\n\t\tcomponents.remove(component);\n\t\tcomponents.add(0, component);\n\t}",
"@Override\r\n\t\t\tpublic void partBroughtToTop(IWorkbenchPartReference partRef) {\n\t\t\t\t\r\n\t\t\t}",
"public void pushFront(O o)\r\n {\r\n //create new VectorItem\r\n VectorItem<O> vi = new VectorItem<O> (o,null, first);\r\n \r\n first = vi;\r\n if (isEmpty()) last = vi;\r\n count++;\r\n }",
"public void moveFirst() {\n\t\tcurrentElement = 0;\n\t}",
"public static void setDrawOrder(GWindow window){\n\t\tPApplet app = window.papplet;\n\t\tsetDrawOrder(app);\n\t}",
"private void putToTop()\r\n {\r\n OrderManager manager = myOrderManagerRegistry.getOrderManager(ourKey);\r\n manager.activateParticipant(ourKey);\r\n manager.moveToTop(ourKey);\r\n }",
"void top() {\n startAnimation(topSubCubes(), Axis.Y, Direction.CLOCKWISE);\n topCubeSwap();\n }",
"public static void setDrawOrder(PApplet app){\n\t\tAppletInfo info = applets.get(app);\n\t\tif(info != null && info.autoDrawOn ){\n\t\t\tCollections.sort(info.paControls, new GComponent.Z_Order());\n\t\t\t// Change physical order in PApplet by removing then adding the components\n\t\t\tif(info.autoDrawOn){\n\t\t\t\tfor(GComponent comp : info.paControls){\n\t\t\t\t\tif(comp.getParent() == null)\n\t\t\t\t\t\tapp.unregisterDraw(comp);\n\t\t\t\t}\n\t\t\t\tfor(GComponent comp : info.paControls){\n\t\t\t\t\tif(comp.getParent() == null)\n\t\t\t\t\t\tapp.registerDraw(comp);\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic boolean setWindowToFront() {\n\t\treturn true;\r\n\t}",
"public void addGraphicObject(GraphicObject obj)\n {\n graphicObjects.addLast(obj);\n }",
"private void m146649c() {\n if (this.f108106a) {\n getHolder().setFormat(-2);\n setZOrderOnTop(true);\n }\n getHolder().addCallback(this.f108110e);\n setAlpha(0.0f);\n }",
"public static void moveToFrontForMouse(GComponent comp){\n\t\tPApplet app = comp.getPApplet();\n\t\tAppletInfo info = applets.get(app);\n\t\tif(info != null && info.paControls.remove(comp)){\n\t\t\tinfo.paControls.add(comp);\n\t\t\tapp.unregisterMouseEvent(comp);\n\t\t\tapp.registerMouseEvent(comp);\n\t\t}\n\t}",
"@Override\n protected void finalRender() {\n finishTraversalAnimation();\n placeTreeNodes();\n placeNodesAtDestination();\n render();\n\n }",
"public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }",
"@Override\n protected Void call() {\n ((HBox) root.getTop()).getChildren().get(2).setDisable(true);\n ((HBox) root.getTop()).getChildren().get(3).setDisable(true);\n\n // The array of rectangle heights is sorted and a list of animations for the rectangles\n // on the screen is created as the sorting executes\n List<List<List<double[]>>> animations = new ArrayList<List<List<double[]>>>();\n runMergeSort(heights, numOfThreads, animations);\n runAnimations(recs, animations);\n\n return null;\n }",
"public void bringToFront(int index) {\n\t\tif (index<this.size()){\n\t\t\tNode front = this.head;\n\t\t\tNode oneBack = new Node(\"\");\n\t\t\tfor (int counter=0; counter < index; counter++){\n\t\t\t\toneBack = front;\n\t\t\t\tfront = front.next;\n\t\t\t}\n\t\t\toneBack.next=front.next;\n\t\t\tfront.next = head;\n\t\t\thead = front;\n\t\t}\n\t}",
"protected void clearToBack()\n {\n\tGraphics g = getGraphics();\n\tsetRenderColor(g,getBackground());\n\trenderFilledRect(g,0,0,width,height);\n }",
"public void traversePreOrder() {\n\t\tpreOrder(this);\n\t}",
"private void sort() {\n ObservableList<Node> workingCollection = FXCollections.observableArrayList(\n this.getChildren()\n );\n\n Collections.sort(workingCollection, new Comparator<Node>() {\n @Override\n public int compare(Node o1, Node o2) {\n CardView c1 = (CardView) o1;\n CardView c2 = (CardView) o2;\n return c1.getCard().compareTo(c2.getCard());\n }\n });\n\n this.getChildren().setAll(workingCollection);\n }",
"public void preorder() {\n\t\tpreorder(root);\n\t}",
"public void postOrderTraversal() {\n beginAnimation();\n treePostOrderTraversal(root);\n stopAnimation();\n\n }",
"public void addDItemToFront(DisplayPoolItem dItem) {\n\t\t\tmFragLock.lock();\r\n\t\t\tmDispItems.addFirst(dItem);\r\n\t\t\tmFragLock.unlock();\r\n\t\t}",
"public void firstElement() {\r\n \t\tcurrentObject = 0;\r\n \t}",
"public void goToStart() {\n\t\tsetPosition(0);\n\t}",
"@Override\n\tpublic void inorder() {\n\n\t}",
"protected void moveFrontAndLaterally() {\n\n dbugThis(\"================================= NEW TRY ====================================================\");\n botTop.swing(BotTop.SWING_UP_COMMAND, true);\n autonomousIdleTasks();\n botTop.openClaw();\n autonomousIdleTasks();\n justWait(1000);\n moveXInchesFromFrontObject(DISTANCE_TO_STONEWALL, 10000, 0.2);\n boolean right = true;\n while (opModeIsActive()) {\n justWait(1000);\n if (right) {\n moveRight(40.0, 0.4);\n right = false;\n }\n else {\n moveLeft(40.0, 0.4);\n right = true;\n }\n }\n return;\n }",
"private void hitGraphic(GObject element) {\r\n\t\tfor(int i = 0; i < 10; i++) {\r\n\t\t\telement.setVisible(true);\r\n\t\t\tmoveGame();\r\n\t\t\telement.setVisible(false);\r\n\t\t\tmoveGame();\r\n\t\t\telement.setVisible(true);\r\n\t\t}\r\n\t}",
"public void setTop() {\n reset(State.TOP);\n }",
"public void preorder()\n {\n preorder(root);\n }",
"public void preorder()\n {\n preorder(root);\n }",
"public void draw() {\n if (first.p == null) return;\n Node n = first;\n Node n2 = first.next;\n while (!n.next.equals(first)) {\n n.p.drawTo(n2.p);\n n = n.next;\n n2 = n2.next;\n }\n n.p.drawTo(n2.p);\n }",
"protected void checkInFront()\n {\n d = (Defender)getOneObjectAtOffset(getImage().getWidth()/4, 0, Defender.class);\n if (d != null )\n {\n\n frontEmpty= false;\n d.takeDamage(damage);\n }\n\n else\n {\n frontEmpty = true;\n }\n }",
"public void addAtFront(double element){\r\n\t head = new DoubleNode(element, head);\r\n\t cursor = head; \r\n\t precursor = null; \r\n\t \r\n }",
"public final void lp() {\n for (int size = this.aue.size() - 1; size >= 0; size--) {\n addView((View) this.aue.get(size));\n }\n this.aue.clear();\n }",
"@Override\n public void setOnTop(boolean arg0)\n {\n \n }",
"public void setOrder(int order) {\n this.order = order;\n paint();\n }",
"public void breadthFirstTraversal() {\n beginAnimation();\n treeBreadthFirstTraversal();\n stopAnimation();\n\n }",
"public void forward() {\n\t\t\n\t\tif(hasEaten()) {\n\t\t\taddBodyPart();\n\t\t} else {\n\t\t\tshuffleBody();\n\t\t}\n\t\t\n\t\tthis.setLocation(this.getX()+dX, this.getY()+dY); // move head\n\t\tthis.display(w); \n\t}",
"protected void addOrderedRenderable(DrawContext dc)\n {\n dc.addOrderedRenderable(this);\n }",
"void removeTop()\n {\n \tif(first!=null)\t\t\t\n \t{\n \t\tfirst=first.next;\n \t\tif(first!=null)\n \t\t\tfirst.prev=null;\n \t}\n }",
"public boolean getStrokeOnTop() { return false; }",
"public void place() {\n\t\tprocessing.image(Image, x, y);\n\t}",
"private void reposition(){\n int lastBackgroundIndex = firstBackgroundIndex-1;\n if(firstBackgroundIndex == 0){\n lastBackgroundIndex = backgrounds.length-1;\n }\n backgrounds[firstBackgroundIndex].getPosition().x = backgrounds[lastBackgroundIndex].getPosition().x + drawingWidth;\n firstBackgroundIndex = (firstBackgroundIndex+1) % backgrounds.length;\n }",
"@Override\n\tpublic void preorder() {\n\n\t}",
"public void addToFront(UnitOfWork workUnit) {\n synchronized (addedFrontWork) {\n addedFrontWork.addFirst(workUnit);\n }\n }",
"public void place(){\n\t\tplace((float) Math.floor(Main.mouseSelector.x)+0.5f,(float) Math.floor(Main.mouseSelector.y)+0.5f);\r\n\t}",
"void frontInv() {\n startAnimation(frontSubCubes(), Axis.Z, Direction.ANTICLOCKWISE);\n frontCubeSwap();\n frontCubeSwap();\n frontCubeSwap();\n }",
"void changeOrder(GeometricalObject object, int offset);",
"void changeOrder(GeometricalObject object, int offset);",
"public void setDrawingOrder(int drawingOrderInParent) {\n/* 1082 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public void swap() {\n\t\tPGraphics tmp = this.src;\n\t\tthis.src = this.dst;\n\t\tthis.dst = tmp;\n\t}",
"public void restoreGraphics() {\n\n if ( g2 instanceof AimxcelGraphics2D ) {\n AimxcelGraphics2D aimxcelGraphics2D = (AimxcelGraphics2D) g2;\n aimxcelGraphics2D.popState();\n }\n else {\n if ( g2.getRenderingHints() != renderingHints ) {\n g2.setRenderingHints( renderingHints );\n }\n if ( g2.getPaint() != paint ) {\n g2.setPaint( paint );\n }\n if ( g2.getColor() != color ) {\n g2.setColor( color );\n }\n if ( g2.getStroke() != stroke ) {\n g2.setStroke( stroke );\n }\n if ( g2.getComposite() != composite ) {\n g2.setComposite( composite );\n }\n if ( g2.getTransform() != transform ) {\n g2.setTransform( transform );\n }\n if ( g2.getFont() != font ) {\n g2.setFont( font );\n }\n if ( g2.getClip() != clip ) {\n g2.setClip( clip );\n }\n if ( g2.getBackground() != background ) {\n g2.setBackground( background );\n }\n }\n }",
"private void orderList() {\n Iterator<PlanarShape> sort = unorderedList.iterator();\n\n while(sort.hasNext()) {\n orderedList.insertInOrder(sort.next());\n }\n }",
"void setZOrder(int order, Object source);",
"private void insertRandomShapes() {\n for (int i = 0; i < gameProperties.numShapes; i++) {\n trayFlowPane.getChildren().add(new CardBack());\n }\n\n for (int i = 0; i < gameProperties.numShapes; i++) {\n int shapeRand = random.nextInt(gameProperties.shapes.size());\n int colorRand = random.nextInt(gameProperties.colors.size());\n\n CardShape s = new CardShape(gameProperties.shapes.get(shapeRand).getImage(),\n gameProperties.colors.get(colorRand).getImage(), shapeRand, colorRand);\n\n setCardShapeOnClicked(s);\n\n correctShapeOrdering.add(s);\n }\n\n\n //apparently getChildren.sort() doesn't work, so here we have this silly workaround:\n ObservableList<Node> workingCollection = FXCollections.observableArrayList(correctShapeOrdering);\n Collections.sort(workingCollection, null);\n shapeFlowPane.getChildren().setAll(workingCollection);\n shapeFlowPane.getChildren().forEach(s -> {\n Timeline t = new Timeline(\n new KeyFrame(new Duration(200), new KeyValue(s.rotateProperty(), 0)),\n new KeyFrame(new Duration(1000), new KeyValue(s.rotateProperty(), 360))\n );\n t.playFromStart();\n });\n }",
"void topInv() {\n startAnimation(topSubCubes(), Axis.Y, Direction.ANTICLOCKWISE);\n topCubeSwap();\n topCubeSwap();\n topCubeSwap();\n }",
"public void moveStart(\n )\n {\n index = StartIndex;\n if(state == null)\n {\n if(parentLevel == null)\n {state = new GraphicsState(this);}\n else\n {state = parentLevel.state.clone(this);}\n }\n else\n {\n if(parentLevel == null)\n {state.initialize();}\n else\n {parentLevel.state.copyTo(state);}\n }\n\n notifyStart();\n\n refresh();\n }",
"void prepend(Object data)\n\t{\n\t\tNode temp = new Node(data);\n\t\tif (front == null) \n\t\t{\n\t\t\tfront = back = temp; // if the list is empty the node will be the first node in the list making it the front and back node\n\t\t\tlength++;\n index = 0; //added because i failed the test scripts because i wasn't managing the indicies\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfront.prev=temp; //the temp node is inserted before the front\n\t\t\ttemp.next=front; //the node after temp will be the front because temp was inserted before the front\n\t\t\tfront = temp; //the front is now the temp node\n\t\t\tlength++;\n index++;//added because i failed the test scripts because i wasn't managing the indicies\n\t\t}\n\t}",
"public void insertReorderBarrier() {\n\t\t\n\t}",
"private void updateOrder() {\n Arrays.sort(positions);\n }",
"@Override\r\n\tpublic void focus() {\r\n\t\tactivate();\r\n\t\ttoFront();\r\n\t}",
"public void installFirstDrawTrigger() {\n mFrameAdapter.getFrameContainer().getViewTreeObserver().addOnGlobalLayoutListener(\n mFirstDrawTrigger);\n }",
"public void preOrder() {\r\n\t\tSystem.out.print(\"PRE: \");\r\n\r\n\t\tpreOrder(root);\r\n\t\tSystem.out.println();\r\n\r\n\t}",
"public void preLayout(ZGroup node) {\n }",
"public void moveFirst() throws CodeException {\n obj.moveFirst();\n \n showData();\n mf.setIcon(CLASSNAME);\n }",
"public void offerFront(E elem);",
"public void lockFront()\n {\n m_bFrontLock = true;\n }",
"private void flushElements() {\n if (elements != null) {\n TopItemList smallModel = new TopItemList();\n smallModel.addAll(elements);\n\n SimpleViewBuilder builder = new SimpleViewBuilder();\n\n // scale Compute\n double scale = (double) lineHeight\n / drawingSpecifications.getMaxCadratHeight();\n\n MDCView view = builder.buildView(smallModel,\n drawingSpecifications);\n\n if (view.getWidth() == 0 || view.getHeight() == 0) {\n return;\n }\n ViewDrawer drawer = new ViewDrawer();\n\n BufferedImage image = new BufferedImage((int) Math.ceil(view\n .getWidth()\n * scale + 1), (int) Math.ceil(view.getHeight() * scale\n + 2 * pictureMargin + 1), BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g = image.createGraphics();\n GraphicsUtils.antialias(g);\n\n g.setColor(backgroundColor);\n g.fillRect(0, 0, image.getWidth(), image.getHeight());\n g.setColor(drawingSpecifications.getBlackColor());\n g.translate(1, 1 + pictureMargin);\n\n g.scale(scale, scale);\n drawer.draw(g, view, drawingSpecifications);\n g.dispose();\n\n File fic = getImageFile(imageNumber);\n try {\n ImageIO.write(image, \"png\", fic); //$NON-NLS-1$\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n String center = \"\"; //$NON-NLS-1$\n\n if (centerPictures) {\n center = \" align='center' \"; //$NON-NLS-1$\n }\n if (pictureScale != 100) {\n write(\"<img \" + center + \" src='\" + fic.getName() //$NON-NLS-1$ //$NON-NLS-2$\n + \"' width='\" + pictureScale + \"%' height='\" //$NON-NLS-1$ //$NON-NLS-2$\n + pictureScale + \"%'>\"); //$NON-NLS-1$\n\n } else if (generatePictureSize) {\n write(\"<img \" + center + \" src='\" + fic.getName() //$NON-NLS-1$ //$NON-NLS-2$\n + \"' width='\" + image.getWidth() + \"' height='\" //$NON-NLS-1$ //$NON-NLS-2$\n + image.getHeight() + \"'>\"); //$NON-NLS-1$\n } else {\n write(\"<img \" + center + \"src='\" + fic.getName() + \"'>\"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n }\n imageNumber++;\n image.flush();\n elements = null;\n }\n }",
"public Card drawCardFromTop() {\n Card temp = this.cards [this.topCardIndex];\n this.topCardIndex++;\n return temp;\n }"
] | [
"0.6986376",
"0.6952759",
"0.62174773",
"0.60607696",
"0.60467476",
"0.6042944",
"0.6042944",
"0.6042944",
"0.602469",
"0.60190016",
"0.6006774",
"0.59327143",
"0.58733314",
"0.5871651",
"0.58278555",
"0.58274186",
"0.57772076",
"0.574034",
"0.5680176",
"0.5657064",
"0.5625119",
"0.562449",
"0.5615269",
"0.55930537",
"0.55899304",
"0.55873466",
"0.5562079",
"0.5547019",
"0.55431557",
"0.55064666",
"0.54661834",
"0.54565287",
"0.5453669",
"0.54382336",
"0.54168934",
"0.5415304",
"0.5412157",
"0.5407207",
"0.54022557",
"0.5401366",
"0.5400092",
"0.5394917",
"0.5381559",
"0.5377744",
"0.53682953",
"0.5362401",
"0.5356846",
"0.5354398",
"0.53294206",
"0.5303344",
"0.530216",
"0.5301475",
"0.52775985",
"0.5274638",
"0.5271096",
"0.52532756",
"0.524874",
"0.5240263",
"0.52396995",
"0.52304333",
"0.52304333",
"0.52188367",
"0.52156484",
"0.5211706",
"0.52111465",
"0.5209876",
"0.5205457",
"0.51987135",
"0.51924837",
"0.5186387",
"0.51835227",
"0.5177865",
"0.5155731",
"0.5150282",
"0.5150006",
"0.51355636",
"0.51348084",
"0.51315844",
"0.51294255",
"0.51294255",
"0.51177055",
"0.5115816",
"0.51076615",
"0.5105503",
"0.5105074",
"0.5099695",
"0.5092607",
"0.5086908",
"0.50819045",
"0.506727",
"0.506389",
"0.5062089",
"0.50599205",
"0.5053525",
"0.5042108",
"0.5036298",
"0.5028937",
"0.5000489",
"0.5000243",
"0.49865413"
] | 0.6799205 | 2 |
This method is used to backup the current style when the user selects any object. | private void backupStyle() {
if(!this.backedup) {
this.backedup = true;
this.lastFillColor = this.currentFillColor;
this.lastFillOpacity = this.fillOpacity.getValue();
this.lastStrokeColor = this.currentStrokeColor;
this.lastStrokeOpacity = this.strokeOpacity.getValue();
this.lastStrokeSize = this.currentStrokeSize.getValue();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void restoreStyle() {\n if(this.backedup) {\n this.backedup = false;\n\n this.currentFillColor = this.lastFillColor;\n DOM.setStyleAttribute(fill.getElement(), \"backgroundColor\",currentFillColor.toCss(false));\n this.fillOpacity.setValue(this.lastFillOpacity);\n this.currentFillColor.setAlpha(this.fillOpacity.getValue());\n\n this.currentStrokeColor = this.lastStrokeColor;\n DOM.setStyleAttribute(stroke.getElement(), \"backgroundColor\",currentStrokeColor.toCss(false));\n this.strokeOpacity.setValue(this.lastStrokeOpacity);\n this.currentStrokeColor.setAlpha(this.strokeOpacity.getValue());\n\n this.currentStrokeSize.setValue(this.lastStrokeSize);\n }\n }",
"public void copyStyle() {\n if (this.getSelectedElements().size() == 0) return;\r\n this.getMainFrame().setStyleClipbardContent( ((ReportElement)this.getSelectedElements().elementAt(0)).cloneMe() );\r\n\r\n }",
"public void resetCurrentlySelectedObject() {\n this.currentlySelectedObject.setTransparency(255);\n this.currentlySelectedObject = null;\n }",
"public synchronized void resetStyle() {\n \t\tstyleInitialized = false;\n \t}",
"public void applyCurrentStyle()\n\t{\n\t\tthis.getCurrentStyleTree().saveCurrentStyle();\n\t\tthis.guiController.rebuildStyle();\n\n\t\tThreadService.executeOnEDT(new Runnable()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tgetCurrentStyleTree().repaint();\n\t\t\t}\n\t\t});\n\t}",
"private void setStyleToDefault() {\n // enable syntax highlighting\n commandTextField.enableSyntaxHighlighting();\n }",
"public void resetSelected(){\n\t\tfor(int x =0; x<9; x++){\n\t\t\tClientWindow.retButtons()[x].setBackground(Color.LIGHT_GRAY);\n\t\t}\n\t}",
"private void defaultStyle() {\n\t\t//idField.setStyle(\"\");\n\t\tproductNameField.setStyle(\"\");\n\t\tinvField.setStyle(\"\");\n\t\tpriceField.setStyle(\"\");\n\t\tmaxField.setStyle(\"\");\n\t\tminField.setStyle(\"\");\n\t}",
"private void setReleasedStyle() {\n this.setStyle(BUTTON_FREE);\n this.setPrefHeight(47);\n this.setLayoutY(getLayoutY() - 4);\n }",
"public void reset() {\n _styles.clear();\n _styles.add(TextStyle.DEFAULT);\n }",
"public void changeToStandard(){\n drawAttributeManager.toggleStandardView();\n getContentPane().setBackground(DrawAttribute.whiteblue);\n canvas.repaint();\n }",
"public void revertColor()\r\n\t{\r\n\t\tif (savedColor != null)\r\n\t\t{\r\n\t\t\tg.setColor(savedColor);\r\n\t\t}\r\n\t}",
"@Override\n protected Color getSelectionBackground() {\n return Color.BLACK;\n }",
"@Override\n protected Color getSelectionBackground() {\n return Color.BLACK;\n }",
"@Override\n protected Color getSelectionBackground() {\n return Color.BLACK;\n }",
"@Override\n protected Color getSelectionBackground() {\n return Color.BLACK;\n }",
"void onStyleModify() {\n\t\tif (mergedStyleSheet != null) {\n\t\t\tmergedStyleSheet = null;\n\t\t\tsheets.setNeedsUpdate(true);\n\t\t} else if (sheets != null) {\n\t\t\tsheets.setNeedsUpdate(true);\n\t\t}\n\t}",
"public void cancelSelectionBorder(){\n BackgroundImage bgselected= new BackgroundImage(new Image(\"rugbeats/img/Background_selectedhdpi.png\"),BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT,\n new BackgroundSize(1.0, 1.0, true, true, false, false));\n ImgStack.setBackground(new Background(bgselected));\n }",
"public void resetSelections()\n {\n for(Node child: gridpane.getChildren())\n {\n Button randButton = (Button) child;\n\n // set all buttons to have default background\n randButton.setStyle(null);\n }\n }",
"@Override\n public void undo(){\n this.parent.getSelectedArea().clear();\n }",
"protected void copy(){\n\t\tthis.model.copy(this.color.getBackground());\n\t}",
"private void applyInitialLook() {\r\n\t\tthis.control.setFont(this.initialFont);\r\n\t\tthis.control.setBackground(this.initialBackgroundColor);\r\n\t\tthis.control.setForeground(this.initialForegroundColor);\r\n\t}",
"public void revertColorAndFont()\r\n\t{\r\n\t\trevertColor();\r\n\t\trevertFont();\r\n\t}",
"private void applyBackgroundColor() {\r\n\t\tthis.control.setBackground(PromptSupport.getBackground(this.control));\r\n\t}",
"public void refresh()\n\t{\n\t\tif(grepStyle == null)\n\t\t{\n\t\t\ttextName.setText(\"\"); //$NON-NLS-1$\n\t\t\t\n\t\t\tcbBold.setSelection(false);\n\t\t\tcbItalic.setSelection(false);\n\t\t\t\n\t\t\tcpForeground.setColor(null);\n\t\t\tcpBackground.setColor(null);\n\t\t\tcpUnderline.setColor(null);\n\t\t\tcpUnderline.setChecked(false);\n\t\t\tcpStrikethrough.setColor(null);\n\t\t\tcpStrikethrough.setChecked(false);\n\t\t\tcpBorder.setColor(null);\n\t\t\tcpBorder.setChecked(false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString name = grepStyle.getName();\n\t\t\ttextName.setText(name == null ? StyleLabelProvider.LABEL_UNNAMED : name);\n\n\t\t\tcbBold.setSelection(grepStyle.isBold());\n\t\t\tcbItalic.setSelection(grepStyle.isItalic());\n\t\t\t\n\t\t\tcpForeground.setColor(grepStyle.getForeground());\n\t\t\tcpBackground.setColor(grepStyle.getBackground());\n\t\t\tcpUnderline.setColor(grepStyle.getUnderlineColor());\n\t\t\tcpUnderline.setChecked(grepStyle.isUnderline());\n\t\t\tcpStrikethrough.setColor(grepStyle.getStrikeoutColor());\n\t\t\tcpStrikethrough.setChecked(grepStyle.isStrikeout());\n\t\t\tcpBorder.setColor(grepStyle.getBorderColor());\n\t\t\tcpBorder.setChecked(grepStyle.isBorder());\n\t\t}\n\t\t\n\t\ttextName.selectAll();\n\t\tupdatePreview();\n\t}",
"public void styleforOne() {\r\n\t\t\r\n\r\n\t\tsuper.styleforOne();\r\n\t\t\r\n\t}",
"public void synchronizeStyles()\n\t{\n\t\tArrayList<Style> styles = this.guiController.getStyles();\n\t\tArrayList<Style> toRemove = new ArrayList<Style>();\n\n\t\tStyle style;\n\t\tStyleEditorTree tree;\n\n\t\t// Check to see if all the styles are in the map:\n\t\tfor (int i = 0; i < styles.size(); i++)\n\t\t{\n\t\t\tstyle = styles.get(i);\n\n\t\t\t// Does the element exist in the collection? (it should)\n\t\t\t// No:\n\t\t\tif (this.styleTrees.get(style) == null)\n\t\t\t{\n\t\t\t\t// Create it and add to the collection:\n\t\t\t\ttree = new StyleEditorTree(this, style);\n\t\t\t\tthis.styleTrees.put(style, tree);\n\t\t\t}\n\t\t}\n\n\t\t// Check to see if there are no left-over styles in the collection (the\n\t\t// reverse question):\n\t\tfor (Iterator<Style> keys = this.styleTrees.keySet().iterator(); keys.hasNext();)\n\t\t{\n\t\t\tstyle = keys.next();\n\n\t\t\t// Does the element exist in the list of styles?\n\t\t\t// No:\n\t\t\tif (!styles.contains(style))\n\t\t\t{\n\t\t\t\t// Remove the left over:\n\t\t\t\ttoRemove.add(style);\n\t\t\t}\n\t\t}\n\n\t\t// Actually remove the styles:\n\t\t// (This is because you can't modify while you're iterating over it)\n\t\tfor (int i = 0; i < toRemove.size(); i++)\n\t\t{\n\t\t\tthis.styleTrees.get(toRemove.get(i)).delete();\n\t\t\tthis.styleTrees.remove(toRemove.get(i));\n\t\t}\n\n\t\tStyle currentStyle = this.guiController.getCurrentStyle();\n\t\tStyleEditorTree currentTree = this.styleTrees.get(currentStyle);\n\n\t\t// GUI components might not be built when this is called.\n\t\tif (this.built)\n\t\t{\n\t\t\tthis.styleComboBox.update();\n\t\t\tthis.styleComboBox.updateSelection(currentTree);\n\t\t}\n\t}",
"@Override\n public void selected ( final ExampleData document, final PaneData<ExampleData> pane, final int index )\n {\n styleViewer.setText ( document.getExample ().getStyleCode ( StyleManager.getSkin () ) );\n styleViewer.setCaretPosition ( 0 );\n }",
"private void unSelect() {\n /** if we had some object selected we need to delete it's Transformation Points. */\n if(this.action.isSelect() && this.curr_obj != null) {\n this.canvas.remove(this.transformPoints);\n this.transformPoints.clear();\n this.curr_obj = null;\n\n /** if we were in the middle of a text operation, we have to remove the TextBox and set the text to it's last version*/\n } else if(this.action.isText()) {\n int size = Integer.parseInt(currentFontSize.getItemText(currentFontSize.getSelectedIndex()));\n\n curr_obj = new Text(editor.getText());\n ((Text)curr_obj).setFont(currFont);\n addTextObject(curr_obj, (int)aux_obj.getX() + (int)((1.0/4.0)*size), (int)aux_obj.getY()+ (size) + (int)((1.0/4.0)*size));\n\n aux_obj = null;\n curr_obj = null;\n apanel.remove(editor);\n editor = null;\n action.setAction(Action.TEXTBOX);\n }\n }",
"public void restoreGraphics() {\n\n if ( g2 instanceof AimxcelGraphics2D ) {\n AimxcelGraphics2D aimxcelGraphics2D = (AimxcelGraphics2D) g2;\n aimxcelGraphics2D.popState();\n }\n else {\n if ( g2.getRenderingHints() != renderingHints ) {\n g2.setRenderingHints( renderingHints );\n }\n if ( g2.getPaint() != paint ) {\n g2.setPaint( paint );\n }\n if ( g2.getColor() != color ) {\n g2.setColor( color );\n }\n if ( g2.getStroke() != stroke ) {\n g2.setStroke( stroke );\n }\n if ( g2.getComposite() != composite ) {\n g2.setComposite( composite );\n }\n if ( g2.getTransform() != transform ) {\n g2.setTransform( transform );\n }\n if ( g2.getFont() != font ) {\n g2.setFont( font );\n }\n if ( g2.getClip() != clip ) {\n g2.setClip( clip );\n }\n if ( g2.getBackground() != background ) {\n g2.setBackground( background );\n }\n }\n }",
"@Override\n\tpublic void undo() {\n\t\tlight.off();\n\t}",
"private OOBibStyle getSelectedStyle() {\n if (selectionModel.getSelected().size() > 0) {\n return selectionModel.getSelected().get(0);\n } else {\n return null;\n }\n }",
"public void resetButtonStyles() {\n\t\tint drawable_id = R.drawable.stockbutton;\n\t\tDrawable stockbutton = getResources().getDrawable(drawable_id);\n\t\t\n\t\t// For now I'm just going to set the bg colors\n\t\tButton outsideButton = (Button) findViewById(R.id.outside);\n\t\toutsideButton.setBackground(stockbutton);\n\t\tButton fridgeButton = (Button) findViewById(R.id.fridge);\n\t\tfridgeButton.setBackground(stockbutton);\n\t\tButton freezerButton = (Button) findViewById(R.id.freezer);\n\t\tfreezerButton.setBackground(stockbutton);\n\t}",
"private void reset() {\n darkSquare.reset();\n lightSquare.reset();\n background.reset();\n border.reset();\n showCoordinates.setSelected(resetCoordinates);\n pieceFont.reset();\n }",
"private void selectStyleButton() {\n for (int i = 0; i < mapStylesView.getChildCount(); i++) {\n mapStylesView.getChildAt(i).setSelected(false);\n }\n SKMapViewStyle mapStyle = mapView.getMapSettings().getMapStyle();\n if (mapStyle == null || mapStyle.getStyleFileName().equals(\"daystyle.json\")) {\n findViewById(R.id.map_style_day).setSelected(true);\n } else if (mapStyle.getStyleFileName().equals(\"nightstyle.json\")) {\n findViewById(R.id.map_style_night).setSelected(true);\n } else if (mapStyle.getStyleFileName().equals(\"outdoorstyle.json\")) {\n findViewById(R.id.map_style_outdoor).setSelected(true);\n } else if (mapStyle.getStyleFileName().equals(\"grayscalestyle.json\")) {\n findViewById(R.id.map_style_grayscale).setSelected(true);\n }\n }",
"private void styleIngredientBrowsePane(){\n //Ingredients Browser / Edit\n InterfaceStyling.setHighlightStyling(ingredCalorieInputBrowse, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredSugarInputBrowse, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredProteinInputBrowse, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredFiberInputBrowse, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredCarbsInputBrowse, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredFatInputBrowse, ingredientColor , defaultColor);\n InterfaceStyling.buttonStyle(updateIngredsBtn, ingredientColor, ingredientColorDark);\n InterfaceStyling.toggleButtonStyle(ingredBrowseEditToggle, ingredientColor);\n InterfaceStyling.setHighlightStyling(ingredQuantityNameInputBrowse, ingredientColor, defaultColor);\n InterfaceStyling.setHighlightStyling(ingredQuantityAmountInputBrowse, ingredientColor, defaultColor);\n\n //Style all the labels in the Pane\n for (Node n: IngredientsBrowseSubPane.getChildren()){\n if (n.getClass().isInstance(new Label())){\n ((Label) n).setFont(InterfaceStyling.titleFontNonBold);\n ((Label) n).setTextFill((Paint.valueOf(defaultTextColor)));\n }\n }\n }",
"public void revertFont()\r\n\t{\r\n\t\tif (savedFont != null)\r\n\t\t{\r\n\t\t\tg.setFont(savedFont);\r\n\t\t}\r\n\t}",
"public void resetListStyles() {\n\t\t\t\t for (int i=0; i<wordsList.getChildCount(); i++) {\n\t\t\t\t\t View child = wordsList.getChildAt(i);\n\t\t\t\t\t child.setBackgroundColor(Color.TRANSPARENT);\n\t\t\t\t }\n\t\t\t }",
"public int getSelectionBoxStyle();",
"private void storeInitialLook() {\r\n\t\tthis.initialFont = this.control.getFont();\r\n\t\tthis.initialBackgroundColor = this.control.getBackground();\r\n\t\tthis.initialForegroundColor = this.control.getForeground();\r\n\t}",
"@Override\n public void restore() {\n graphicsEnvironmentImpl.restore(canvas);\n }",
"public void chooseBackgroundColor(){\n currentBackgroundColor = backgroundColorPicker.getValue();\n draw();\n }",
"@Override\n public void removeHighlight()\n {\n }",
"@Override\n public void restore() {\n }",
"private void setPressedStyle() {\n this.setStyle(BUTTON_PRESSED);\n this.setPrefHeight(43);\n this.setLayoutY(getLayoutY() + 4);\n }",
"private void setToNormalStateTextItemView(){\n\t\t\n\t\tmCurrentSelect = -1;\n\t\tfor (int i = 0; i < mTotalTexts.size(); i++) {\n\t\t\tInnerTextView contactView = mTotalTexts.get(i);\n\t\t\tif (contactView != null) {\n\t\t\t\tcontactView.setBackground(false);\n\t\t\t}\n\t\t}\n\t}",
"public static void saveSkinSelection() {\r\n\t\tclearSkin();\r\n\t\t\r\n\t\tif (GameOptions.iowaState.getState()) {\r\n\t\t\tMain.skinIsIowaState = true;\r\n\t\t}\r\n\t\tif (GameOptions.iowa.getState()) {\r\n\t\t\tMain.skinIsIowa = true;\r\n\t\t}\r\n\t\tif (GameOptions.northernIowa.getState()) {\r\n\t\t\tMain.skinIsNorthernIowa = true;\r\n\t\t}\r\n\t}",
"private void applyStyle() {\n\t\tmenu.getStyleClass().add(menuColor);\n\t}",
"public abstract void clearSelection(TextAppearance appearance);",
"protected void clearToBack()\n {\n\tGraphics g = getGraphics();\n\tsetRenderColor(g,getBackground());\n\trenderFilledRect(g,0,0,width,height);\n }",
"public static void showPreviousSelectedSkin() {\r\n\t\tGameOptions.iowaState.setState(Main.skinIsIowaState);\r\n\t\tGameOptions.iowa.setState(Main.skinIsIowa);\r\n\t\tGameOptions.northernIowa.setState(Main.skinIsNorthernIowa);\r\n\t}",
"public void clearSelection()\n\t{\n\t\tgetObject().clearSelection();\n\t\treturn;\n\t}",
"protected void paste(){\n\t\tColor col = this.model.paste();\n\t\tif (col == null) return;\n\t\tthis.setBackground(col);\n\t}",
"public void removeAllHighlights() {}",
"private void save() {\n prefs.saveCardBackground(selectedBackground);\n prefs.saveCardBackgroundColor(selectedBackgroundColor);\n\n updateSummary();\n }",
"private void applyCurrentTheme() {\n TempestatibusApplicationSettings tempestatibusApplicationSettings = getTempestatibusApplicationSettings();\n tempestatibusApplicationSettings.createSharedPreferenceContext(this);\n String theme = tempestatibusApplicationSettings.getAppThemePreference();\n mRefreshImageView.setBackgroundResource(TempestatibusApplicationSettings.getRefreshId());\n mDegreeImageView.setBackgroundResource(TempestatibusApplicationSettings.getLargeDegreeId(theme));\n mDewValueSmallDegree.setBackgroundResource(TempestatibusApplicationSettings.getSmallDegreeId(theme));\n mApparentTemperatureValueSmallDegree.setBackgroundResource(TempestatibusApplicationSettings.getSmallDegreeId(theme));\n mSettingsImageView.setBackgroundResource(TempestatibusApplicationSettings.getSettingsIconId());\n mHourglassIconImageView.setBackgroundResource(TempestatibusApplicationSettings.getHourglassId());\n mSaveIconImageView.setBackgroundResource(TempestatibusApplicationSettings.getSaveIconId());\n mSearchIconImageView.setBackgroundResource(TempestatibusApplicationSettings.getSearchIconId());\n }",
"public boolean isNewIsDefaultStyle()\r\n {\r\n return myNewIsDefaultStyle;\r\n }",
"void reset() {\n colorSelectedList = new HashSet<>();\n }",
"public void updateStyle()\n {\n this.textOutput.setForeground(new Color(null, ShellPreference.OUTPUT_COLOR_INPUT.getRGB()));\n this.textOutput.setBackground(new Color(null, ShellPreference.OUTPUT_BACKGROUND.getRGB()));\n this.textOutput.setFont(new Font(null, ShellPreference.OUTPUT_FONT.getFontData()));\n this.colorOuput = new Color(null, ShellPreference.OUTPUT_COLOR_OUTPUT.getRGB());\n this.colorError = new Color(null, ShellPreference.OUTPUT_COLOR_ERROR.getRGB());\n\n this.textInput.setForeground(new Color(null, ShellPreference.INPUT_COLOR.getRGB()));\n this.textInput.setBackground(new Color(null, ShellPreference.INPUT_BACKGROUND.getRGB()));\n this.textInput.setFont(new Font(null, ShellPreference.INPUT_FONT.getFontData()));\n\n this.historyMax = ShellPreference.MAX_HISTORY.getInt();\n }",
"@Override\n protected Color getSelectionForeground() {\n return Color.BLACK;\n }",
"@Override\n protected Color getSelectionForeground() {\n return Color.BLACK;\n }",
"@Override\n protected Color getSelectionForeground() {\n return Color.BLACK;\n }",
"@Override\n protected Color getSelectionForeground() {\n return Color.BLACK;\n }",
"private void chooseTo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseTo1ActionPerformed\n chooseTo1.setBackground(Color.black);\n }",
"private void chooseTo3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseTo3ActionPerformed\n chooseTo3.setBackground(Color.black);\n }",
"protected abstract void restoreGraphicsState();",
"public void resetSelectPresentation();",
"public final void mo39711K() {\n setBackgroundColor(0);\n }",
"public void restoreFromFile()\n\t{\n rectForSelection = new Rectangle2D.Double(rettangoloX,rettangoloY,larghezza,altezza);\n rectSelTopLeft = new Rectangle2D.Double(rettangoloX-3,rettangoloY-3,6,6);\n rectSelBottomLeft = new Rectangle2D.Double(rettangoloX-3,rettangoloY+altezza-3,6,6);\n rectSelTopRight = new Rectangle2D.Double(rettangoloX+larghezza-3,rettangoloY-3,6,6);\n rectSelBottomRight = new Rectangle2D.Double(rettangoloX+larghezza-3,rettangoloY+altezza-3,6,6);\t\t\n\t}",
"protected void restoreTreeSelection() {\n _spTree.setIgnoreSelection(true);\n tree.setSelectionPaths(selections);\n\n // Restore the lead selection\n if (leadSelection != null) {\n tree.removeSelectionPath(leadSelection);\n tree.addSelectionPath(leadSelection);\n }\n\n _spTree.setIgnoreSelection(false);\n }",
"public void undoAll() {\n firePropertyChange(\"array\", null, EMPTY_STRING);\n myDrawingArray.clear();\n myUndoStack.clear();\n myCurrentShape = new Drawing(new Line2D.Double(), Color.WHITE, 0);\n repaint();\n }",
"@Override\n\tprotected void OnRelease() {\n\t\tsetSelected(false);\n\t}",
"public void restoreState() \n\t{\n\t\tsuper.restoreState();\n\t}",
"public void updateGrepStyle()\n\t{\n\t\tgrepStyle.setName(textName.getText());\n\t\tgrepStyle.setBold(cbBold.getSelection());\n\t\tgrepStyle.setItalic(cbItalic.getSelection());\n\t\tgrepStyle.setForeground(cpForeground.getEffectiveColor());\n\t\tgrepStyle.setBackground(cpBackground.getEffectiveColor());\n\t\tgrepStyle.setUnderline(cpUnderline.isChecked());\n\t\tgrepStyle.setUnderlineColor(cpUnderline.getColor()); \n\t\tgrepStyle.setStrikeout(cpStrikethrough.isChecked());\n\t\tgrepStyle.setStrikeoutColor(cpStrikethrough.getColor());\n\t\tgrepStyle.setBorder(cpBorder.isChecked());\n\t\tgrepStyle.setBorderColor(cpBorder.getColor());\n\t}",
"public void undo() {\n\t\tlight.on();\n\t}",
"public void restoreState() {\n\t\tsuper.restoreState();\n\t}",
"private void styleIngredientAddPane(){\n InterfaceStyling.setHighlightStyling(ingredNameInput, ingredientColor, defaultColor);\n InterfaceStyling.setHighlightStyling(ingredCalorieInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredSugarInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredProteinInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredFiberInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredCarbsInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredFatInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredQuantityAmountInput, ingredientColor, defaultColor);\n InterfaceStyling.setHighlightStyling(ingredQuantityNameInput, ingredientColor, defaultColor);\n InterfaceStyling.setHighlightStyling(ingredientsBrowseCombo, ingredientColor, defaultColor);\n InterfaceStyling.buttonStyle(btnSaveIngredients, ingredientColor, ingredientColorDark);\n\n //Style all the text in the Pane\n for (Node n: IngredientsAddSubPane.getChildren()){\n if (n.getClass().isInstance(new Text())){\n ((Text) n).setFont(InterfaceStyling.titleFontNonBold);\n ((Text) n).setFill(Paint.valueOf(defaultTextColor));\n\n }\n }\n }",
"@Override\r\n\tpublic void undo() {\n\t\tfor(IShape shape : tempList)\r\n\t\t\tshapeList.remove(shape);\r\n\t}",
"public void restore() {\n setOrientation(0);\n setCropRect(getMaxCenteredCropRect(), false);\n autoZoom(true);\n }",
"private void init() {\n mSelectedColor = new Paint(Paint.ANTI_ALIAS_FLAG);\n mSelectedColor.setColor(getResources().getColor(R.color.colorPrimary));\n mSelectedColor.setStyle(Paint.Style.FILL);\n\n mUnselectedColor = new Paint(Paint.ANTI_ALIAS_FLAG);\n mUnselectedColor.setColor(getResources().getColor(R.color.textColorSecondaryInverse));\n\n mSelectedColor.setStyle(Paint.Style.FILL);\n mPosition = new RectF();\n\n mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n mTextPaint.setColor(getResources().getColor(R.color.textColorSecondary));\n mTextPaint.setTextSize(48);\n }",
"public void reset() {\n\t\tremoveAll();\n\t\tadd(new GLine(MARGIN, MARGIN, MARGIN, MARGIN + SCAFFOLD_HEIGHT));\n\t\tadd(new GLine(MARGIN, MARGIN, MARGIN + BEAM_LENGTH, MARGIN));\n\t\tadd(new GLine(MARGIN + BEAM_LENGTH, MARGIN, MARGIN + BEAM_LENGTH, MARGIN + ROPE_LENGTH));\n\t\tbody = new GCompound();\n\t\tbody.setLocation(MARGIN + BEAM_LENGTH, MARGIN + ROPE_LENGTH);\n\t\tadd(body);\n\t\twordLabel = new GLabel(\"\");\n\t\twordLabel.setFont(\"*-bold-18\");\n\t\tadd(wordLabel);\n\t\tguesses = \"\";\n\t\tguessesLabel = new GLabel(guesses);\n\t\tadd(guessesLabel);\n\t}",
"private void toClear()\n {\n tfPaintId.setText(\"\");\n tfName.setText(\"\");\n tfPrice.setText(\"\");\n tfColor.setText(\"\");\n rwCombo.setSelectedIndex(0);\n bCombo.setSelectedIndex(0);\n typeCombo.setSelectedIndex(0);\n tfQuantity.setText(\"\");\n bg.clearSelection();\n \n }",
"public void styleMealBrowsePane() {\n //style the various nodes in the pane\n InterfaceStyling.setHighlightStyling(mealMethod, mealColor, defaultColor);\n InterfaceStyling.setHighlightStyling(mealIngred, mealColor, defaultColor);\n InterfaceStyling.setHighlightStyling(comboMealSelection, mealColor, defaultColor);\n mealMethod.setFont(InterfaceStyling.textFieldFont);\n\n //look through all the labels and style them\n for (Node n : mealBrowseSubPane.getChildren()) {\n if (n.getClass().isInstance(new Label())) {\n ((Label) n).setFont(InterfaceStyling.titleFontNonBold);\n ((Label) n).setTextFill(Paint.valueOf(defaultTextColor));\n\n }\n }\n //style the nutritional information\n browseMealNutritionOne.setFont(InterfaceStyling.largeTextFont);\n browseMealNutritionTwo.setFont(InterfaceStyling.largeTextFont);\n }",
"public void setDropTrashBackground() {\n setBackgroundColor(sDropTrashBgColor);\n }",
"@Override\n\tpublic void undo() {\n\t\tthis.list.delete(shape);\n\n\t}",
"private void readStyles() {\n table.clearSelection();\n\n styles.getReadWriteLock().writeLock().lock();\n styles.clear();\n if (styleDir.getText().length() > 0) {\n addStyles(styleDir.getText(), true);\n }\n styles.getReadWriteLock().writeLock().unlock();\n\n selectLastUsed();\n }",
"private void chooseTo4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseTo4ActionPerformed\n chooseTo4.setBackground(Color.black);\n }",
"private void restoreFromOverlay() {\n \t\tString descriptorsString = getOverlayStore().getString(EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS);\n \t\tfTextHovers = getTextHoverManager().generateTextHoverDescriptors(descriptorsString);\n \t}",
"public void nonEditable() {\r\n\t\tzoneAffichage.setEditable(false);\r\n\t\tzoneAffichage.setBackground(Color.WHITE);\r\n\t\tzoneAffichage.setFocusable(false);\r\n\t\tzoneAffichage.setCursor(null);\r\n\t}",
"public void setClickedStyle(Button button){\n whiteCellButton.getStyleClass().clear();\n blackCellButton.getStyleClass().clear();\n removeCellButton.getStyleClass().clear();\n\n if (button == whiteCellButton) {\n whiteCellButton.getStyleClass().add(\"edit-buttons-selected\");\n blackCellButton.getStyleClass().add(\"edit-buttons\");\n removeCellButton.getStyleClass().add(\"edit-buttons\");\n }\n else if (button == blackCellButton) {\n blackCellButton.getStyleClass().add(\"edit-buttons-selected\");\n whiteCellButton.getStyleClass().add(\"edit-buttons\");\n removeCellButton.getStyleClass().add(\"edit-buttons\");\n }\n else if (button == removeCellButton) {\n removeCellButton.getStyleClass().add(\"edit-buttons-selected\");\n whiteCellButton.getStyleClass().add(\"edit-buttons\");\n blackCellButton.getStyleClass().add(\"edit-buttons\");\n }\n }",
"@Override\r\n\tpublic void undo() {\n\t\tlight.on();\r\n\t}",
"public void useStarObjectColor ( ) {\r\n\t\tcolor = null;\r\n\t}",
"@Override\n\tprotected void handleDrop() {\n\t\tif (getTargetEditPart() instanceof CrosstabEditPart) {\n\t\t\tMCrosstab crosstabModel = (MCrosstab) ((EditPart)getTargetEditPart()).getModel();\n\t\t\tTemplateStyle style = (TemplateStyle) IOUtils.readFromByteArray((byte[])getCurrentEvent().data);\n\t\t\tif (style != null && style instanceof CrosstabStyle){\n\t\t\t\tCrosstabStyle selectedStyle = (CrosstabStyle) style;\n\t\t\t\tif (crosstabModel != null) {\n\t\t\t\t\tShell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();\n\t\t\t\t\tMessageDialog question = new MessageDialog(shell, Messages.EditCrosstabStyleAction_questionTitle, null, Messages.EditCrosstabStyleAction_questionText, MessageDialog.QUESTION, \n\t\t\t\t\t\t\tnew String[]{Messages.EditCrosstabStyleAction_questionUpdate, \n\t\t\t\t\t\t\t\t\t\t Messages.EditCrosstabStyleAction_questionNewStyles, \n\t\t\t\t\t\t\t\t\t\t Messages.EditCrosstabStyleAction_questionCancel}, 0);\n\t\t\t\t\tint response = question.open();\n\t\t\t\t\t// response == 0 update the old styles, response == 1 create new styles, response == 2 cancel the operation\n\t\t\t\t\tif (response == 0 || response == 1) {\n\t\t\t\t\t\tUpdateCrosstabStyleCommand updateCommand = new UpdateCrosstabStyleCommand(crosstabModel, selectedStyle,response == 0);\n\t\t\t\t\t\tCommandStack cs = getCommandStack();\n\t\t\t\t\t\tif (cs!=null) cs.execute(updateCommand);\n\t\t\t\t\t\telse updateCommand.execute();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic void cleanup() {\r\n\t\tlevelList.setSelectedIndex(0);\t\t\r\n\t}",
"public void undo() {\n firePropertyChange(\"undo\", null, \"enable\");\n final Drawing removeMe = myDrawingArray.get(myDrawingArray.size() - 1);\n myDrawingArray.remove(removeMe);\n myUndoStack.push(removeMe);\n myCurrentShape = new Drawing(new Line2D.Double(), Color.WHITE, 0);\n if (myDrawingArray.isEmpty()) {\n firePropertyChange(\"stack\", null, EMPTY_STRING);\n }\n repaint();\n }",
"protected void reset() {\n\t\tpush();\n\n\t\t// Clearen, en niet opnieuw aanmaken, om referenties elders\n\t\t// in het programma niet corrupt te maken !\n\t\tcurves.clear();\n\t\tselectedCurves.clear();\n\t\thooveredCurves.clear();\n\t\tselectedPoints.clear();\n\t\thooveredPoints.clear();\n\t\tselectionTool.clear();\n\t}",
"private void updateDialog() {\n for (int i = 0; i < NUMBER_OF_CARD_BACKGROUNDS; i++) {\n linearLayoutsBackgrounds[i].setBackgroundResource(i == selectedBackground ? R.drawable.settings_highlight : typedValue.resourceId);\n }\n\n for (int i = 0; i < NUMBER_OF_CARD_BACKGROUNDS; i++) {\n imageViews[i].setImageBitmap(bitmaps.getCardBack(i, selectedBackgroundColor));\n }\n\n for (int i = 0; i < 4; i++) {\n linearLayoutsColors[i].setBackgroundResource(i == selectedBackgroundColor ? R.drawable.settings_highlight : typedValue.resourceId);\n }\n }",
"@Override\r\n\tpublic boolean forceSelection() {\r\n\t\treturn false;\r\n\t}",
"@VisibleForTesting\n protected void applyProvisionalSelection() {\n mSelection.addAll(mProvisionalSelection);\n mProvisionalSelection.clear();\n }",
"@Override\n public void deselectGolem() {\n }"
] | [
"0.7238291",
"0.6828306",
"0.6661939",
"0.6510043",
"0.6336004",
"0.6170944",
"0.61315614",
"0.59830576",
"0.597982",
"0.5958109",
"0.5942436",
"0.589051",
"0.58577824",
"0.58577824",
"0.58577824",
"0.58577824",
"0.58453214",
"0.5836488",
"0.5829034",
"0.5828702",
"0.57736135",
"0.5759726",
"0.5758327",
"0.57454",
"0.57381976",
"0.5689218",
"0.5687615",
"0.56750053",
"0.56738484",
"0.5661222",
"0.5618396",
"0.56175596",
"0.5610821",
"0.5610544",
"0.5557994",
"0.5550037",
"0.5548607",
"0.5548598",
"0.55338234",
"0.5533455",
"0.552765",
"0.55251616",
"0.55184126",
"0.5511423",
"0.5485487",
"0.5483401",
"0.54508245",
"0.5449435",
"0.54485357",
"0.54412436",
"0.54336524",
"0.5424834",
"0.54181963",
"0.5415201",
"0.53937304",
"0.5380344",
"0.5365496",
"0.5364906",
"0.53607714",
"0.53499097",
"0.53499097",
"0.53499097",
"0.53499097",
"0.53477514",
"0.53325385",
"0.5332256",
"0.5330746",
"0.53240216",
"0.5315022",
"0.53137565",
"0.53108627",
"0.53069425",
"0.530525",
"0.5303189",
"0.5302597",
"0.5296721",
"0.52937454",
"0.52901286",
"0.5281684",
"0.52804697",
"0.5273584",
"0.5272457",
"0.52721417",
"0.52701926",
"0.52698386",
"0.52657217",
"0.5265337",
"0.5261357",
"0.5259157",
"0.52587414",
"0.52470773",
"0.5236881",
"0.523323",
"0.52308744",
"0.52305883",
"0.52290344",
"0.5223118",
"0.5220449",
"0.52193046",
"0.5212326"
] | 0.72234315 | 1 |
This method is used to restore the previous style when the user deselects any object. | private void restoreStyle() {
if(this.backedup) {
this.backedup = false;
this.currentFillColor = this.lastFillColor;
DOM.setStyleAttribute(fill.getElement(), "backgroundColor",currentFillColor.toCss(false));
this.fillOpacity.setValue(this.lastFillOpacity);
this.currentFillColor.setAlpha(this.fillOpacity.getValue());
this.currentStrokeColor = this.lastStrokeColor;
DOM.setStyleAttribute(stroke.getElement(), "backgroundColor",currentStrokeColor.toCss(false));
this.strokeOpacity.setValue(this.lastStrokeOpacity);
this.currentStrokeColor.setAlpha(this.strokeOpacity.getValue());
this.currentStrokeSize.setValue(this.lastStrokeSize);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void resetCurrentlySelectedObject() {\n this.currentlySelectedObject.setTransparency(255);\n this.currentlySelectedObject = null;\n }",
"public synchronized void resetStyle() {\n \t\tstyleInitialized = false;\n \t}",
"private void backupStyle() {\n if(!this.backedup) {\n this.backedup = true;\n this.lastFillColor = this.currentFillColor;\n this.lastFillOpacity = this.fillOpacity.getValue();\n this.lastStrokeColor = this.currentStrokeColor;\n this.lastStrokeOpacity = this.strokeOpacity.getValue();\n this.lastStrokeSize = this.currentStrokeSize.getValue();\n }\n }",
"public void revertColor()\r\n\t{\r\n\t\tif (savedColor != null)\r\n\t\t{\r\n\t\t\tg.setColor(savedColor);\r\n\t\t}\r\n\t}",
"public void resetSelected(){\n\t\tfor(int x =0; x<9; x++){\n\t\t\tClientWindow.retButtons()[x].setBackground(Color.LIGHT_GRAY);\n\t\t}\n\t}",
"public void reset() {\n _styles.clear();\n _styles.add(TextStyle.DEFAULT);\n }",
"public void revertColorAndFont()\r\n\t{\r\n\t\trevertColor();\r\n\t\trevertFont();\r\n\t}",
"@Override\n\tpublic void undo() {\n\t\tlight.off();\n\t}",
"private void unSelect() {\n /** if we had some object selected we need to delete it's Transformation Points. */\n if(this.action.isSelect() && this.curr_obj != null) {\n this.canvas.remove(this.transformPoints);\n this.transformPoints.clear();\n this.curr_obj = null;\n\n /** if we were in the middle of a text operation, we have to remove the TextBox and set the text to it's last version*/\n } else if(this.action.isText()) {\n int size = Integer.parseInt(currentFontSize.getItemText(currentFontSize.getSelectedIndex()));\n\n curr_obj = new Text(editor.getText());\n ((Text)curr_obj).setFont(currFont);\n addTextObject(curr_obj, (int)aux_obj.getX() + (int)((1.0/4.0)*size), (int)aux_obj.getY()+ (size) + (int)((1.0/4.0)*size));\n\n aux_obj = null;\n curr_obj = null;\n apanel.remove(editor);\n editor = null;\n action.setAction(Action.TEXTBOX);\n }\n }",
"private void reset() {\n darkSquare.reset();\n lightSquare.reset();\n background.reset();\n border.reset();\n showCoordinates.setSelected(resetCoordinates);\n pieceFont.reset();\n }",
"@Override\n public void undo(){\n this.parent.getSelectedArea().clear();\n }",
"public void resetSelectPresentation();",
"public void resetSelections()\n {\n for(Node child: gridpane.getChildren())\n {\n Button randButton = (Button) child;\n\n // set all buttons to have default background\n randButton.setStyle(null);\n }\n }",
"public void restoreState() {\n\t\tsuper.restoreState();\n\t}",
"public void restoreState() \n\t{\n\t\tsuper.restoreState();\n\t}",
"protected void restoreTreeSelection() {\n _spTree.setIgnoreSelection(true);\n tree.setSelectionPaths(selections);\n\n // Restore the lead selection\n if (leadSelection != null) {\n tree.removeSelectionPath(leadSelection);\n tree.addSelectionPath(leadSelection);\n }\n\n _spTree.setIgnoreSelection(false);\n }",
"void reset() {\n colorSelectedList = new HashSet<>();\n }",
"public void cancelSelectionBorder(){\n BackgroundImage bgselected= new BackgroundImage(new Image(\"rugbeats/img/Background_selectedhdpi.png\"),BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT,\n new BackgroundSize(1.0, 1.0, true, true, false, false));\n ImgStack.setBackground(new Background(bgselected));\n }",
"public void restore() {\n setOrientation(0);\n setCropRect(getMaxCenteredCropRect(), false);\n autoZoom(true);\n }",
"public void deselectPanel() {\n\t\tthis.displayNumberBlock.setBackground(dispNormal);\n\t}",
"@Override\n\tprotected void OnRelease() {\n\t\tsetSelected(false);\n\t}",
"@Override\n public void removeHighlight()\n {\n }",
"public void resetMouseState() {\r\n \t\tmouseListner.setDefaultState();\r\n \t\tcomponentBar.clearButtonGroupSelection(0);\r\n \t\tif (graph != null) {\r\n \t\t\tgraph.clearSelection();\r\n \t\t\tsetGraphCursor(Cursor.getDefaultCursor());\r\n \t\t}\r\n \t}",
"protected void reset() {\n\t\tpush();\n\n\t\t// Clearen, en niet opnieuw aanmaken, om referenties elders\n\t\t// in het programma niet corrupt te maken !\n\t\tcurves.clear();\n\t\tselectedCurves.clear();\n\t\thooveredCurves.clear();\n\t\tselectedPoints.clear();\n\t\thooveredPoints.clear();\n\t\tselectionTool.clear();\n\t}",
"@Override\n public void restore() {\n graphicsEnvironmentImpl.restore(canvas);\n }",
"@Override\n public void deselectGolem() {\n }",
"protected abstract void restoreGraphicsState();",
"public void reset(){\n active = false;\n done = false;\n state = State.invisible;\n curX = 0;\n }",
"public void resetCurrentValue()\r\n\t{\r\n\t\tborder=2;\r\n\t}",
"public void revertFont()\r\n\t{\r\n\t\tif (savedFont != null)\r\n\t\t{\r\n\t\t\tg.setFont(savedFont);\r\n\t\t}\r\n\t}",
"public void restoreGraphics() {\n\n if ( g2 instanceof AimxcelGraphics2D ) {\n AimxcelGraphics2D aimxcelGraphics2D = (AimxcelGraphics2D) g2;\n aimxcelGraphics2D.popState();\n }\n else {\n if ( g2.getRenderingHints() != renderingHints ) {\n g2.setRenderingHints( renderingHints );\n }\n if ( g2.getPaint() != paint ) {\n g2.setPaint( paint );\n }\n if ( g2.getColor() != color ) {\n g2.setColor( color );\n }\n if ( g2.getStroke() != stroke ) {\n g2.setStroke( stroke );\n }\n if ( g2.getComposite() != composite ) {\n g2.setComposite( composite );\n }\n if ( g2.getTransform() != transform ) {\n g2.setTransform( transform );\n }\n if ( g2.getFont() != font ) {\n g2.setFont( font );\n }\n if ( g2.getClip() != clip ) {\n g2.setClip( clip );\n }\n if ( g2.getBackground() != background ) {\n g2.setBackground( background );\n }\n }\n }",
"public void clearSelection()\n\t{\n\t\tgetObject().clearSelection();\n\t\treturn;\n\t}",
"@Override\n public void reset() {\n setActive(false);\n if (tablePane != null) {\n tablePane.removeAll();\n }\n table = null;\n tablePane = null;\n }",
"public void reset()\n\t{\n\t\tthis.resetSelected();\n\t\tthis.clearMsgArea();\n\t}",
"private void reset() {\n \n ((Shape3D)((Group)model).getChildren().get(0)).setMaterial(red);\n ((Shape3D)((Group)model).getChildren().get(1)).setMaterial(blue);\n \n }",
"@Override\r\n\tpublic void cleanup() {\r\n\t\tlevelList.setSelectedIndex(0);\t\t\r\n\t}",
"private void setReleasedStyle() {\n this.setStyle(BUTTON_FREE);\n this.setPrefHeight(47);\n this.setLayoutY(getLayoutY() - 4);\n }",
"public void reset(){\n super.reset();\n this.troef = CardColor.NONE;\n }",
"private void restoreSelectedTargetLayer() {\n\n\t\tif (currentNewLayerName != null) {\n\t\t\tthis.comboTargetLayer.setText(currentNewLayerName);\n\t\t} else if (currentTargetLayer != null) {\n\t\t\tint index = this.comboTargetLayer.indexOf(this.currentTargetLayer.getName());\n\t\t\tif (index != -1) {\n\t\t\t\tthis.comboTargetLayer.select(index);\n\t\t\t}else{\n\t\t\t\tcurrentTargetLayer=null;\n\t\t\t\tvalidateParameters();\n\t\t\t}\n\t\t}\n\t}",
"public void undo() {\n compositionManager.ungroup(group);\n }",
"public void undoAll() {\n firePropertyChange(\"array\", null, EMPTY_STRING);\n myDrawingArray.clear();\n myUndoStack.clear();\n myCurrentShape = new Drawing(new Line2D.Double(), Color.WHITE, 0);\n repaint();\n }",
"public void leftOff() {\r\n\t\tsetLeftColor(0, 0, 0);\r\n\t}",
"private void prevSelect() {\n\t\tif (selectionIndex - 1 < 0) {\n\t\t\tselectionIndex = selections.size() - 1;\n\t\t} else {\n\t\tselectionIndex--;\n\t\t}\n\t\tselected.setVisible(true);\n\t\tselected = selections.get(selectionIndex);\n\t\t\n\t}",
"@Override\n public void restore() {\n }",
"void restoreFormState();",
"private void setToNormalStateTextItemView(){\n\t\t\n\t\tmCurrentSelect = -1;\n\t\tfor (int i = 0; i < mTotalTexts.size(); i++) {\n\t\t\tInnerTextView contactView = mTotalTexts.get(i);\n\t\t\tif (contactView != null) {\n\t\t\t\tcontactView.setBackground(false);\n\t\t\t}\n\t\t}\n\t}",
"public void deselectObjects() {\n if (contextMenu != null) {\n contextMenu.hide();\n contextMenu = null;\n }\n\n // Deselect all objects\n objectsProperty.stream().forEach(ov -> ov.setSelected(false));\n hintsProperty.stream().forEach(hv -> hv.setSelected(false));\n }",
"void onStyleModify() {\n\t\tif (mergedStyleSheet != null) {\n\t\t\tmergedStyleSheet = null;\n\t\t\tsheets.setNeedsUpdate(true);\n\t\t} else if (sheets != null) {\n\t\t\tsheets.setNeedsUpdate(true);\n\t\t}\n\t}",
"void resetFocus();",
"void resetFocus();",
"public void copyStyle() {\n if (this.getSelectedElements().size() == 0) return;\r\n this.getMainFrame().setStyleClipbardContent( ((ReportElement)this.getSelectedElements().elementAt(0)).cloneMe() );\r\n\r\n }",
"public void reset(){\n currentStage = 0;\n currentSide = sideA;\n }",
"@Override\n\tpublic void unselect() {\n\t}",
"public void reset() {\n this.displayHasContent = false;\n this.obscured = false;\n this.syswin = false;\n this.preferredRefreshRate = 0.0f;\n this.preferredModeId = 0;\n }",
"private void defaultStyle() {\n\t\t//idField.setStyle(\"\");\n\t\tproductNameField.setStyle(\"\");\n\t\tinvField.setStyle(\"\");\n\t\tpriceField.setStyle(\"\");\n\t\tmaxField.setStyle(\"\");\n\t\tminField.setStyle(\"\");\n\t}",
"public void reset(){\n\t\t//int selectedColor = dots.getColor();\n\n\t\tfor (int i = 0; i < size; i++){\n\t\t\tfor (int j = 0; j < size; j++){\n\n\t\t\t\t\tdots[i][j].setColor(model.getColor(i,j));\n\t\t\t}\n\t\t}\n\t}",
"public void resetButtons() {\n\t\t group.clearSelection();\n\t }",
"@Override\n protected void processUnselect() {\n \n }",
"protected void clearToBack()\n {\n\tGraphics g = getGraphics();\n\tsetRenderColor(g,getBackground());\n\trenderFilledRect(g,0,0,width,height);\n }",
"public void removeSelected()\n {\n for (int i = shapes.size() - 1; i >= 0; i--)\n {\n SceneShape s = shapes.get(i);\n if (s.isSelected()) shapes.remove(i);\n }\n repaint();\n }",
"public void undo() {\n firePropertyChange(\"undo\", null, \"enable\");\n final Drawing removeMe = myDrawingArray.get(myDrawingArray.size() - 1);\n myDrawingArray.remove(removeMe);\n myUndoStack.push(removeMe);\n myCurrentShape = new Drawing(new Line2D.Double(), Color.WHITE, 0);\n if (myDrawingArray.isEmpty()) {\n firePropertyChange(\"stack\", null, EMPTY_STRING);\n }\n repaint();\n }",
"public void allOff() {\r\n\t\tsetAllColor(0, 0, 0);\r\n\t}",
"public void resetButtonStyles() {\n\t\tint drawable_id = R.drawable.stockbutton;\n\t\tDrawable stockbutton = getResources().getDrawable(drawable_id);\n\t\t\n\t\t// For now I'm just going to set the bg colors\n\t\tButton outsideButton = (Button) findViewById(R.id.outside);\n\t\toutsideButton.setBackground(stockbutton);\n\t\tButton fridgeButton = (Button) findViewById(R.id.fridge);\n\t\tfridgeButton.setBackground(stockbutton);\n\t\tButton freezerButton = (Button) findViewById(R.id.freezer);\n\t\tfreezerButton.setBackground(stockbutton);\n\t}",
"public void deselectFocusedNode(){\r\n \tfocusOut();\r\n }",
"private void clearInputFieldStyle(){\n nameInput.styleProperty().setValue(\"\");\n cogInput.styleProperty().setValue(\"\");\n wheelBaseInput.styleProperty().setValue(\"\");\n frontRollDistInput.styleProperty().setValue(\"\");\n cornerWeightFLInput.styleProperty().setValue(\"\");\n cornerWeightRLInput.styleProperty().setValue(\"\");\n cornerWeightRRInput.styleProperty().setValue(\"\");\n cornerWeightFRInput.styleProperty().setValue(\"\");\n }",
"public void reset() {\n txtReferredBy.setText(\"\");\n txtReferredBy.setBackground(theAppMgr.getBackgroundColor());\n //txtReferredBy.setEditable(false);\n //txtReferredBy.setBackground(Color.lightGray);\n if (cbxProfession.getItemCount() > 0)\n cbxProfession.setSelectedIndex(0);\n if (cbxEducation.getItemCount() > 0)\n cbxEducation.setSelectedIndex(0);\n txtNotes1.setText(\"\");\n txtNotes2.setText(\"\");\n txtPartFamName.setText(\"\");\n txtPartName.setText(\"\");\n txtBirthPlc.setText(\"\");\n if (cbxSpcEvt.getItemCount() > 0)\n cbxSpcEvt.setSelectedIndex(0);\n txtSpclDate.setText(\"\");\n txtChildNames.setText(\"\");\n txtNumChildren.setText(\"\");\n }",
"void unsetControlPosition();",
"public void undo() {\n\t\tlight.on();\n\t}",
"public void resetSelected()\n\t{\n\t\tfor (int i = 0; i < 13; i++)\n\t\t{\n\t\t\tthis.selected[i] = false;\n\t\t}\n\t}",
"public void reset() {\n\t\tremoveAll();\n\t\tadd(new GLine(MARGIN, MARGIN, MARGIN, MARGIN + SCAFFOLD_HEIGHT));\n\t\tadd(new GLine(MARGIN, MARGIN, MARGIN + BEAM_LENGTH, MARGIN));\n\t\tadd(new GLine(MARGIN + BEAM_LENGTH, MARGIN, MARGIN + BEAM_LENGTH, MARGIN + ROPE_LENGTH));\n\t\tbody = new GCompound();\n\t\tbody.setLocation(MARGIN + BEAM_LENGTH, MARGIN + ROPE_LENGTH);\n\t\tadd(body);\n\t\twordLabel = new GLabel(\"\");\n\t\twordLabel.setFont(\"*-bold-18\");\n\t\tadd(wordLabel);\n\t\tguesses = \"\";\n\t\tguessesLabel = new GLabel(guesses);\n\t\tadd(guessesLabel);\n\t}",
"private void toClear()\n {\n tfPaintId.setText(\"\");\n tfName.setText(\"\");\n tfPrice.setText(\"\");\n tfColor.setText(\"\");\n rwCombo.setSelectedIndex(0);\n bCombo.setSelectedIndex(0);\n typeCombo.setSelectedIndex(0);\n tfQuantity.setText(\"\");\n bg.clearSelection();\n \n }",
"public void resetListStyles() {\n\t\t\t\t for (int i=0; i<wordsList.getChildCount(); i++) {\n\t\t\t\t\t View child = wordsList.getChildAt(i);\n\t\t\t\t\t child.setBackgroundColor(Color.TRANSPARENT);\n\t\t\t\t }\n\t\t\t }",
"protected void restoreState(State s) {\n /*\n * We must set the transformation matrix first since it affects things\n * like clipping regions and patterns.\n */\n setAffineMatrix(s.affineMatrix);\n currentState.relativeClip = s.relativeClip;\n sharedClipping = true;\n\n // If the GC is currently advanced, but it was not when pushed, revert\n if (gc.getAdvanced() && (s.graphicHints & ADVANCED_GRAPHICS_MASK) == 0) {\n // Set applied clip to null to force a re-setting of the clipping.\n appliedState.relativeClip = null;\n gc.setAdvanced(false);\n appliedState.graphicHints &= ~ADVANCED_HINTS_MASK;\n appliedState.graphicHints |= ADVANCED_HINTS_DEFAULTS;\n }\n\n setBackgroundColor(s.bgColor);\n setBackgroundPattern(s.bgPattern);\n\n setForegroundColor(s.fgColor);\n setForegroundPattern(s.fgPattern);\n\n setAlpha(s.alpha);\n setLineAttributes(s.lineAttributes);\n setFont(s.font);\n\n // This method must come last because above methods will incorrectly set\n // advanced state\n setGraphicHints(s.graphicHints);\n\n translateX = currentState.dx = s.dx;\n translateY = currentState.dy = s.dy;\n }",
"protected void resetState()\n {\n // Nothing to do by default.\n }",
"public void loseFocus(){\r\n\t//\tthis.setId(\"single-image-widget\");\r\n//\t\t((ColumnViewPane) this.getParent()).refresh();\r\n\t\thasFocus = false;\r\n\t}",
"public void unselect() {\n for (int i = 0; i < series.size(); i++) {\n series.setItemSliced(i, false, false, true);\n }\n }",
"public void undo() {\n target.setCombatState( oldState );\n }",
"@Override\r\n\tpublic void resetObject() {\n\t\t\r\n\t}",
"public void changeToStandard(){\n drawAttributeManager.toggleStandardView();\n getContentPane().setBackground(DrawAttribute.whiteblue);\n canvas.repaint();\n }",
"public void deselect();",
"@Override\r\n\tpublic void undo() {\n\t\tfor(IShape shape : tempList)\r\n\t\t\tshapeList.remove(shape);\r\n\t}",
"public void resetToDefaults() {\r\n setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r\n setDateFormatSymbols(new DateFormatSymbols());\r\n setShowControls(true);\r\n setControlsPosition(JCalendar.TOP);\r\n setControlsStep(10);\r\n setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r\n setWeekDayDisplayType(JCalendar.ONE);\r\n setShowHorizontalLines(false);\r\n setShowVerticalLines(false);\r\n setChangingFirstDayOfWeekAllowed(true);\r\n setTooltipDateFormat(new SimpleDateFormat(\"MMMM dd, yyyy\"));\r\n }",
"public void resetDates() {\r\n selectedDate = null;\r\n currentDate = Calendar.getInstance();\r\n }",
"void reset() {\n setVisible(false);\n myJumpedOver = false;\n }",
"public abstract void clearSelection(TextAppearance appearance);",
"@Override\n\tpublic void undo() {\n\t\tthis.list.delete(shape);\n\n\t}",
"public void clean() {\n \tfor(int f=0; f<NUMCARTAS;f++) \n \tfor(int c=0; c<NUMCARTAS;c++) {\n \t\ttablero[f][c].setSelected(false);\n\t \t \t//Devuelve al color original\n\t if(tablero[f][c].getText().length()==2) tablero[f][c].setBackground(colorDiagonal);\n\t else if(tablero[f][c].getText().charAt(2)=='s') tablero[f][c].setBackground(colorSuited);\n\t else tablero[f][c].setBackground(colorOffsuited);\n \t}\n }",
"public void resetSelectedDate() {\r\n selectedDate = null;\r\n }",
"public void clearBorders() {\n\n findViewById(R.id.eslot1).setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(\"#00000000\")));\n findViewById(R.id.eslot2).setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(\"#00000000\")));\n findViewById(R.id.eslot3).setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(\"#00000000\")));\n findViewById(R.id.eslot4).setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(\"#00000000\")));\n\n findViewById(R.id.eslot1).refreshDrawableState();\n findViewById(R.id.eslot2).refreshDrawableState();\n findViewById(R.id.eslot3).refreshDrawableState();\n findViewById(R.id.eslot4).refreshDrawableState();\n }",
"public void synchronizeStyles()\n\t{\n\t\tArrayList<Style> styles = this.guiController.getStyles();\n\t\tArrayList<Style> toRemove = new ArrayList<Style>();\n\n\t\tStyle style;\n\t\tStyleEditorTree tree;\n\n\t\t// Check to see if all the styles are in the map:\n\t\tfor (int i = 0; i < styles.size(); i++)\n\t\t{\n\t\t\tstyle = styles.get(i);\n\n\t\t\t// Does the element exist in the collection? (it should)\n\t\t\t// No:\n\t\t\tif (this.styleTrees.get(style) == null)\n\t\t\t{\n\t\t\t\t// Create it and add to the collection:\n\t\t\t\ttree = new StyleEditorTree(this, style);\n\t\t\t\tthis.styleTrees.put(style, tree);\n\t\t\t}\n\t\t}\n\n\t\t// Check to see if there are no left-over styles in the collection (the\n\t\t// reverse question):\n\t\tfor (Iterator<Style> keys = this.styleTrees.keySet().iterator(); keys.hasNext();)\n\t\t{\n\t\t\tstyle = keys.next();\n\n\t\t\t// Does the element exist in the list of styles?\n\t\t\t// No:\n\t\t\tif (!styles.contains(style))\n\t\t\t{\n\t\t\t\t// Remove the left over:\n\t\t\t\ttoRemove.add(style);\n\t\t\t}\n\t\t}\n\n\t\t// Actually remove the styles:\n\t\t// (This is because you can't modify while you're iterating over it)\n\t\tfor (int i = 0; i < toRemove.size(); i++)\n\t\t{\n\t\t\tthis.styleTrees.get(toRemove.get(i)).delete();\n\t\t\tthis.styleTrees.remove(toRemove.get(i));\n\t\t}\n\n\t\tStyle currentStyle = this.guiController.getCurrentStyle();\n\t\tStyleEditorTree currentTree = this.styleTrees.get(currentStyle);\n\n\t\t// GUI components might not be built when this is called.\n\t\tif (this.built)\n\t\t{\n\t\t\tthis.styleComboBox.update();\n\t\t\tthis.styleComboBox.updateSelection(currentTree);\n\t\t}\n\t}",
"@ZAttr(id=669)\n public void unsetSkinSelectionColor() throws com.zimbra.common.service.ServiceException {\n HashMap<String,Object> attrs = new HashMap<String,Object>();\n attrs.put(Provisioning.A_zimbraSkinSelectionColor, \"\");\n getProvisioning().modifyAttrs(this, attrs);\n }",
"public void removeAllHighlights() {}",
"public void reset() {\n\t\trabbitcount[1]=8;\n\t\trabbitcount[2]=8;\n\t\tpieces.clear();\n\t\tselectedsquares.clear();\n\t\trepaint();\n\t}",
"private void resetButton() {\n for(int x=0;x<buttons.size();x++) {\n if(buttons.get(x).isOpaque())\n buttons.get(x).setOpaque(false);\n }\n }",
"public void resetWidget() {\n\t\tif (!modelList.isEmpty()) {\n\t\t\tthis.setSelectedIndex(0);\n\t\t}\n\t}",
"public static void reset() {\n\t\tselectedAtts.clear();\n\t}",
"public void resetFocus() {\n toSetFocus = null;\n focusOn = null;\n }",
"public static void clearFocus() {\n\t\tfor(Square s : BOARD_SQUARES) {\n\t\t\ts.setTempBackgroundColor((s).getBackgroundColor());\n\t\t\tif(s.hasPiece()) {\n\t\t\t\ts.getPiece().setFocus(false);\n\t\t\t}\n\t\t}\n\t}",
"public final void restore() {\r\n\t\tbi_image.restore();\r\n\t}",
"public void reset(){\r\n\t\tdialogToDisplay=0;\r\n\t\tqueuedDialog=0;\r\n\t\toptionSelection=null;\r\n\t\tdone=false;\r\n\t}"
] | [
"0.73207396",
"0.71958554",
"0.69800365",
"0.6626852",
"0.65698004",
"0.64978164",
"0.6443061",
"0.64262444",
"0.63942564",
"0.63715684",
"0.6308974",
"0.6283976",
"0.62031645",
"0.6193313",
"0.6190582",
"0.61584413",
"0.61519915",
"0.61393404",
"0.61386657",
"0.611827",
"0.61031073",
"0.61014026",
"0.6101282",
"0.60781723",
"0.6077576",
"0.6072185",
"0.6071025",
"0.6022219",
"0.5977967",
"0.59698725",
"0.59559005",
"0.59539795",
"0.593815",
"0.5935845",
"0.5934417",
"0.5909877",
"0.5898487",
"0.58925307",
"0.5891391",
"0.5882384",
"0.5880549",
"0.5873278",
"0.58727455",
"0.5866344",
"0.5864712",
"0.5853963",
"0.58532953",
"0.5836657",
"0.58323634",
"0.58323634",
"0.58213824",
"0.5820502",
"0.5807956",
"0.58031493",
"0.57961446",
"0.57915664",
"0.57791615",
"0.57785875",
"0.57779",
"0.5775236",
"0.5774272",
"0.5772207",
"0.57707804",
"0.57530344",
"0.57457185",
"0.57405585",
"0.5738596",
"0.57320166",
"0.5726286",
"0.57173055",
"0.57121027",
"0.5707541",
"0.57061446",
"0.570491",
"0.5703091",
"0.56940055",
"0.5692929",
"0.5670381",
"0.5666567",
"0.56602836",
"0.56585777",
"0.5655175",
"0.5648994",
"0.5646932",
"0.5644426",
"0.5643405",
"0.5639433",
"0.5637501",
"0.5635738",
"0.563521",
"0.5634514",
"0.5633117",
"0.5622585",
"0.56219673",
"0.56191343",
"0.5603761",
"0.56031084",
"0.56005",
"0.5599305",
"0.5597546"
] | 0.782924 | 0 |
This method adds a Transform Point to the current Graphic Canvas | private void addTransformPoint(double x, double y, int index, GraphicObject curr, double radiansAngle) {
/** If the object is rotated, the transform point also has to be rotated.
* Here we calculate the new coordinates acording to the rotation angle. */
if(radiansAngle != 0.0) {
GeoVector vect = new GeoVector(x, y, curr.getCenterX(), curr.getCenterY());
vect.rotate(radiansAngle);
vect.addPoint(curr.getCenterX(), curr.getCenterY());
x = vect.getX();
y = vect.getY();
}
/** If it's the rotation point, then it creates a green circle */
if(index==0) {
Circle aux = new Circle(2);
aux.setFillColor(Color.GREEN);
aux.setStroke(Color.GRAY, 1);
this.transformPoints.add(aux);
this.transformPointers[index] = aux;
aux.translate((int)x, (int)y);
/** Otherwise it just creates a normal white rectangle */
} else {
Rect aux = new Rect(4,4);
aux.setFillColor(Color.WHITE);
aux.setStroke(Color.GRAY, 1);
this.transformPoints.add(aux);
this.transformPointers[index] = aux;
aux.translate((int)x-2, (int)y-2);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Action\n public void addPoint() { \n Point2D pt = randomPoint();\n PrimitiveGraphic bp = JGraphics.point(pt, RandomStyles.point());\n bp.setDefaultTooltip(\"<html><b>Point</b>: <i> \" + pt + \"</i>\");\n bp.setDragEnabled(true);\n root1.addGraphic(bp);\n }",
"public void addPoint(Point point) {\n if (isValidStroke) {\n points.add(point);\n }\n }",
"public void addPoint(FPointType fpt) {\n moved = true;\n if (tLayerPool.getFirst() == null)\n throw new IllegalStateException(\"No layers exist in this TransformDesign.\");\n tLayerPool.getFirst().addPoint(fpt);\n }",
"private void addPoint( LatLng point ) {\n \t\tthis.addMarker( point );\n \t\tthis.commitPolygon();\n \t}",
"public void addPoint(Point p) {\r\n line.add(p);\r\n }",
"public void addPoint(T p) {\n points.add(p);\n }",
"public Point add(double translateX, double translateY) {\n return new Point(x+translateX,y+translateY);\n }",
"public void startDraw(Vector2 point){\n path.add(point);\n }",
"private static Point3d transformPoint(Matrix4d transformMat, Point3d originalPoint) {\n Point3d tempPoint = new Point3d();\n transformMat.transform(new Point3d(originalPoint.getX(), originalPoint.getY(), originalPoint.getZ()), tempPoint);\n return tempPoint;\n }",
"public void addPoint(Point3d p) {\n\n\t\t// Add the new point\n\t\tpoints.add(p);\n\n\t\tgeneratePoints();\n\t}",
"public void add(Point p) {\n add(p.xyz.x, p.xyz.y, p.xyz.z);\n }",
"public void addPoints(int point){\n\t\tthis.points += point;\n\t}",
"public void addPoint( final Point2d point ){\n points.add(new Point2d(point));\n\n dirty = true;\n }",
"@Override\n public void transform(double mxx, double myx, double mxy, double myy, double mxt, double myt) {\n graphicsEnvironmentImpl.transform(canvas, mxx, myx, mxy, myy, mxt, myt);\n }",
"public void addPoint() {\n points += 1;\n }",
"public void setTransform(Transform transform);",
"@SuppressWarnings(\"unchecked\")\n public AnimatorType position(PointF point)\n {\n addTransformer(new PositionTransformer(getShape(), point));\n return (AnimatorType) this;\n }",
"public void moveTo(Point point){\n updateUndoBuffers(new LinkedList<>());\n xPos = point.getMyX()+myGrid.getWidth()/ HALF;\n yPos = myGrid.getHeight()/ HALF-point.getMyY();\n }",
"public void add(Point point) {\n\t\tthis.points.add(point);\n\t}",
"public void setTransform(float a11, float a12, float a21, float a22, float x, float y);",
"public void addPoint(Point p) {\n\t\tpoints.add(p);\n\t\tnotifyListeners();\n\t}",
"public void addPoint( final Point2D point ){\n this.addPoint(point.getX(),point.getY());\n }",
"public boolean addPoint(Point p);",
"public final void setToPoint(Vector toPoint) {\n\t\ttransform.setToPoint(toPoint);\n\t}",
"@Override\t\t\t\n\tpublic final myPointf transformPoint(myPointf A, int transformIDX, float t) {\treturn trans[transformIDX].transformPoint(A, t);}",
"@Override\r\n\tprotected AffineTransform getPointTransformation() {\n\t\treturn null;\r\n\t}",
"public void addPoint(int x, int y) {\n\t\tshape.addPoint(x, y);\n\t}",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"public Point add(Point point)\n {\n return new Point(this.x + point.x, this.y + point.y);\n }",
"public void addPoint(Point point) {\r\n\t\t\r\n\t\tthis.listOfPoints.add(point);\r\n\t}",
"@Override\n public void setTransform(double mxx, double myx, double mxy, double myy, double mxt, double myt) {\n graphicsEnvironmentImpl.setTransform(canvas, mxx, myx, mxy, myy, mxt, myt);\n }",
"@NonNull\n @Override\n public PointF transformMeteringPoint(@NonNull PointF point) {\n PointF scaled = new PointF();\n scaled.x = -1000F + (point.x / previewSize.getWidth()) * 2000F;\n scaled.y = -1000F + (point.y / previewSize.getHeight()) * 2000F;\n\n // Apply rotation to this point.\n // https://academo.org/demos/rotation-about-point/\n PointF rotated = new PointF();\n double theta = ((double) displayToSensor) * Math.PI / 180;\n rotated.x = (float) (scaled.x * Math.cos(theta) - scaled.y * Math.sin(theta));\n rotated.y = (float) (scaled.x * Math.sin(theta) + scaled.y * Math.cos(theta));\n LOG.i(\"scaled:\", scaled, \"rotated:\", rotated);\n return rotated;\n }",
"public void add(GPoint point) {\n\t\tif (point == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tpoints.add(point);\n\t\trepaint();\n\t}",
"public void addPoints(int addP){\n this.points += addP;\n }",
"public void addPoint(int points){\n\t\tthis.fidelityCard.point += points;\t\t\n\t}",
"public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}",
"private void createTransformPoints(Rectangle bnds, GraphicObject curr) {\n double degreesAngle, radiansAngle;\n Rectangle novo = bnds;\n\n this.transformPoints = new VirtualGroup();\n\n degreesAngle = curr.getRotation();\n\n /** If the object is rotated, we need to rotate i back to the angle 0 in order to get valid boundaries. Tatami doesn't rotates the object's bounds, instead it gives wrong bounds so we need to perform this operation and rotate the bounds on our side. */\n if(degreesAngle != 0.0) {\n curr.uRotate((float) (degreesAngle * -1.0));\n novo = curr.getBounds();\n }\n radiansAngle = (degreesAngle * (2.0*Math.PI))/360.0;\n \n addTransformPoint(novo.getCenterX(), novo.getY()+novo.getHeight()+(novo.getHeight()/4), 0, curr, radiansAngle);\n addTransformPoint(novo.getX(), novo.getY(), 1, curr, radiansAngle);\n addTransformPoint(novo.getCenterX(), novo.getY(), 2, curr, radiansAngle);\n addTransformPoint(novo.getX() + novo.getWidth(), novo.getY(), 3, curr, radiansAngle);\n addTransformPoint(novo.getX(), novo.getCenterY(), 4, curr, radiansAngle);\n addTransformPoint(novo.getX() + novo.getWidth(), novo.getCenterY(), 5, curr, radiansAngle);\n addTransformPoint(novo.getX(), novo.getY() + novo.getHeight(), 6, curr, radiansAngle);\n addTransformPoint(novo.getCenterX(), novo.getY() + novo.getHeight(), 7, curr, radiansAngle);\n addTransformPoint(novo.getX() + novo.getWidth(), novo.getY() + novo.getHeight(), 8, curr, radiansAngle);\n\n /** This creates the line between the rotation point and the object */\n Line aux2 = new Line((int)(this.transformPointers[Action.SOUTH].getX()+2), (int)(this.transformPointers[Action.SOUTH].getY()+2), (int)(this.transformPointers[Action.ROTATE].getX()), (int)(this.transformPointers[Action.ROTATE].getY()));\n aux2.setStroke( Color.GRAY, 1);\n this.transformPoints.add(aux2);\n\n this.canvas.add(this.transformPoints, 0, 0);\n\n this.transformPointers[Action.SOUTH].moveToFront();\n this.transformPointers[Action.ROTATE].moveToFront();\n\n if(degreesAngle != 0.0) {\n curr.uRotate((float)degreesAngle);\n }\n }",
"public void insert(Point2D p) {\n mPoints.add(p);\n }",
"public void addPoint(LatLng point, int color) {\n if (currentLine == null) {\n PolylineOptions options = new PolylineOptions()\n .add(point)\n .color(color);\n currentLine = mMap.addPolyline(options);\n } else {\n List<LatLng> allPoints = currentLine.getPoints();\n allPoints.add(point);\n currentLine.setPoints(allPoints);\n }\n }",
"public void add(GPoint point) {\n\t\tpoints.add(new GPoint(point));\n\t}",
"public void setFrameXY(RMPoint aPoint) { setFrameXY(aPoint.x, aPoint.y); }",
"private Point transform(Point pt1) {\n Point pt2 = new Point(0,0) ;\n pt2.x = pos.x + new Double(pt1.x*Math.cos(heading)+pt1.y*Math.sin(heading)).intValue() ;\n pt2.y = pos.y + new Double(-pt1.x*Math.sin(heading)+pt1.y*Math.cos(heading)).intValue() ;\n return pt2 ;\n }",
"void turnToPoint(float x, float y) {\n _rotVector.set(x - _x, y - _y, 0);\n _rotVector.setMag(1);\n }",
"public void addPoint(Point pon)\n {\n poly[size] = pon;\n size++;\n }",
"public void insert(Point2D p) {\n pointSet.add(p);\n }",
"public void setTransform(CGAffineTransform transform) {\n \t\tthis.transform = transform;\n \t}",
"public void addPoint(Point point){\n\t\t\tclusterPointsList.add(point);\n\t\t}",
"public void addPoint(final DataPoint point) {\n logger.debug(\"addPoint called\");\n\n checkDimension(point);\n\n _addPoint(point);\n }",
"public Point2D addPoint(double x, double y);",
"void setPosition(Point point);",
"public void draw()\n {\n imageView.setRotate(teta);\n imageView.relocate(super.getX(),super.getY());\n }",
"public void addPoint(GridPoint newPoint) {\n\t\t//System.out.println(\"Added rubbish at coordinates X=\" + newPoint.getX() + \", Y=\" + newPoint.getY());\n\t\tsolutionRepresentation.add(newPoint);\n\t}",
"public void drawPoint(DrawPanelModel drawPanelModel);",
"@Override\n public void execute()\n {\n measurementPoint = new MeasurementPoint(position);\n // Add marker to map and get the position of the marker on the map\n markerPositionOnMap = mapCanvas.addMarker(position, layer.getLayerName(), \"\", layer.getColor());\n // Add marker position to measurementPoint\n measurementPoint.setMarkerPositionOnMap(markerPositionOnMap);\n // Add measurementPoint to layerManager\n layer.addMeasurementPoint(measurementPoint);\n }",
"public void addPoint(double x, double y, double z);",
"private void addGraphicObject(GraphicObject g_obj, int x, int y) {\n\t\tg_obj.setFillColor(this.currentFillColor);\n g_obj.setStroke(this.currentStrokeColor, this.currentStrokeSize.getValue());\n\n\t\tthis.canvas.add(g_obj, x, y);\n\t}",
"void add(Point point) {\n\t\tpoints[posit]=point;\n\t\tposit++;\n\t\t//if method add is applied, size should also change\n\t\tsize++;\n\t}",
"private void addPoint(PointF p) {\n final long t = System.currentTimeMillis();\n final int size;\n synchronized (lastSegment) {\n size = lastSegment.size();\n final PointF sheetPoint = sheet.toSheet(p);\n lastSegment.add(sheetPoint);\n lastSegmentTimes.add(t);\n lastSegmentCurve.setThickness(currentThickness);\n lastSegmentCurve.addPoint(sheetPoint);\n }\n if (size >= maxPoints - 1) {\n finishSegment();\n mode = IDLE_MODE;\n }\n }",
"private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }",
"@Generated\n @Selector(\"setTransform:atTime:\")\n public native void setTransformAtTime(@ByValue CGAffineTransform transform, @ByValue CMTime time);",
"private void addPoint(View view) {\n\n if( null == imgNode1 || null == imgNode2)\n {\n\n Toast.makeText(MainActivity.this, \"Scan the references\", Toast.LENGTH_SHORT).show();\n return;\n\n }\n\n Toast.makeText(MainActivity.this, \"Added point\", Toast.LENGTH_SHORT).show();\n\n\n\n Node n1 = new Node();\n n1.setRenderable(model);\n\n\n n1.setWorldPosition(new Vector3(0,0,0));\n arSceneView.getScene().addChild(n1);\n\n Description p = new Description();\n p.setNode(n1);\n //The position of the new point is the difference between point reference and marker position. This helps to update the position whether the origin marker is changed\n p.setPos(Vector3.subtract(mov2imgNode,imgNode1.getWorldPosition()));\n listElements.add(p);\n if(listElements.size()>1) {\n Description last = listElements.get(listElements.size()-1);\n Vector3 ori = imgNode1.getWorldPosition();\n Description penultimate = listElements.get(listElements.size()-2);\n last.setBefore_pos(penultimate.getPos());\n last.setDistance(distanceTwoPoints(Vector3.add(ori, last.getPos()), Vector3.add(ori, penultimate.getPos())));\n last.setDir(directionTwoPoints(Vector3.add(ori, penultimate.getPos()), Vector3.add(ori, last.getPos())));\n drawLine(Vector3.add(ori, penultimate.getPos()), Vector3.add(ori, last.getPos()), last.getNode());\n ViewRenderable.builder().setSizer(new DpToMetersViewSizer(this.labelsSize))\n .setView(arSceneView.getContext(), R.layout.controls)\n .build()\n .thenAccept(viewRenderable -> addNodeToScene( last.getNode(),viewRenderable,last.getDistance()))\n .exceptionally(throwable -> {\n Toast.makeText(arSceneView.getContext(), \"Error:\" + throwable.getMessage(), Toast.LENGTH_LONG).show();\n return null;\n }\n\n );\n }\n }",
"public void setPoint( Float point ) {\n this.point = point;\n }",
"public boolean add(PointF point)\n {\n flushCache();\n return points.add(Geometry.clone(point));\n }",
"@Override\n public void translate(double x, double y) {\n graphicsEnvironmentImpl.translate(canvas, x, y);\n }",
"void moveToPoint(float x, float y) {\n _x = x;\n _y = y;\n }",
"public void paint(MapCanvas canvas, Point insertPoint) {\n Graphics2D graphics = null;\n if ((this.text != null) && (insertPoint != null) && (canvas != null) && \n ((graphics = canvas.graphics) != null)) {\n Font curFont = graphics.getFont();\n Color curColor = graphics.getColor();\n AffineTransform curTransForm = graphics.getTransform();\n try {\n TextStyle style = this.getTextStyle();\n FontMetrics fontMetrics = this.textFont.setCanvas(canvas);\n int textHeight = fontMetrics.getHeight();\n int x = insertPoint.x;\n int y = insertPoint.y;\n int textWidth = fontMetrics.stringWidth(this.text);\n// if ((style.orientation == TextStyle.Orientation.VerticalDn) || \n// (style.orientation == TextStyle.Orientation.VerticalUp)) {\n// if (style.hAlign == TextStyle.Horizontal.Center) {\n// y -= textWidth/2;\n// } else if (style.hAlign == TextStyle.Horizontal.Right) {\n// y -= textWidth;\n// }\n//\n// if (style.vAlign == TextStyle.Vertical.Middle) {\n// x += textHeight/2;\n// } else if (style.vAlign == TextStyle.Vertical.Top) {\n// x += textHeight;\n// }\n// } else {\n if (style.hAlign == TextStyle.Horizontal.Center) {\n x -= textWidth/2;\n } else if (style.hAlign == TextStyle.Horizontal.Right) {\n x -= textWidth;\n }\n\n if (style.vAlign == TextStyle.Vertical.Middle) {\n y += textHeight/2;\n } else if (style.vAlign == TextStyle.Vertical.Top) {\n y += textHeight;\n }\n //} \n float rotate = style.orientation.rotate;\n if (rotate != 0.0f) {\n AffineTransform transform = new AffineTransform();\n transform.translate(0.0d, 0.0d);\n transform.rotate(rotate, insertPoint.x, insertPoint.y);\n graphics.transform(transform);\n }\n \n graphics.drawString(this.text, x, y - fontMetrics.getDescent());\n } catch (Exception exp) {\n LOGGER.log(Level.WARNING, \"{0}.paint Error:\\n {1}\",\n new Object[]{this.getClass().getSimpleName(), exp.getMessage()});\n } finally {\n if (curFont != null) {\n graphics.setFont(curFont);\n }\n if (curColor != null) {\n graphics.setColor(curColor);\n }\n if (curTransForm != null) {\n graphics.setTransform(curTransForm);\n }\n }\n }\n }",
"@Override\n public void move() {\n this.point.x += vector.x * getCurrentSpeed();\n this.point.y += vector.y * getCurrentSpeed();\n }",
"public static Vector2f transformPoint(Transform t, Vector2f p) {\n\t\treturn t.transformPoint(p);\n\t}",
"public CanvasAWT(Graphics2D graphic){\r\n\t\ttarget = graphic;\r\n\t}",
"public final void addPoint(final Position loc) {\n points.add(new Position(loc));\n }",
"@Override\n public void mousePressed(MouseEvent e) {\n // this.getVision().getCare().set(this.getVision().getSoul().newMemento());\n if (e.getButton() != MouseEvent.BUTTON1) {\n return;\n }\n if (getVerticallyPointOnGraph(e.getX(), e.getY()) != null) {\n setCurrentPoint(getVerticallyPointOnGraph(e.getX(), e.getY()));\n } else {\n setCurrentPoint(null);\n }\n \n if (getCurrentPoint() != null) {\n double toy = Math.min(Math.max(tCanvasPadding, e.getY()), getHeight() - bCanvasPadding);\n // System.out.println(\"moving to [\"+tox+\",\"+toy+\"]\");\n adapter.moveImagePoint(getCurrentPoint(), c2gy(toy));\n // getCurrentPoint().movePoint(getCurrentPoint(),\n // c2gx(tox),c2gy(toy,getCurrentPoint().getDataSet()));\n }\n // System.out.println(\"Current point is \"+currentPoint);\n }",
"public void addPosition(Point3d point3d){\n positions.add(point3d);\n }",
"public void translate() {\r\n this.x += dx;\r\n this.y += dy;\r\n }",
"public synchronized void addComponent(DrawableVector draw) {\n instructions.add(draw);\n }",
"public void refreshPosition() {\n\n this.setTransform(getTransform());\n }",
"public void addPoint(float x, float y) {\n Vector2 point = new Vector2(x, y);\n points.add(point);\n }",
"public final void setAnchorPoint(Vector anchorPoint) {\n\t\ttransform.setAnchorPoint(anchorPoint);\n\t}",
"public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }",
"public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }",
"public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }",
"public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }",
"public void add(int index, PointF point)\n {\n flushCache();\n points.add(index, Geometry.clone(point));\n }",
"public void addPoint(Point point){\n\t\tif (point.getX() < minPoint.getX()){\n\t\t\tminPoint.setX(point.getX());\n\t\t}\n\t\tif (point.getY() < minPoint.getY()){\n\t\t\tminPoint.setY(point.getY());\n\t\t}\n\t\tif (point.getX() > maxPoint.getX()){\n\t\t\tmaxPoint.setX(point.getX());\n\t\t}\n\t\tif (point.getY() > maxPoint.getY()){\n\t\t\tmaxPoint.setY(point.getY());\n\t\t}\n\t}",
"public void draw() {\r\n /* DO NOT MODIFY */\r\n StdDraw.point(x, y);\r\n }",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\tpoints.add(new Point(e.getX(),e.getY()));\r\n\t\trepaint();\r\n\t}",
"protected void addPoint(Point a) throws InvalidArgumentException {\n\t\tif (a == null)\n\t\t\tthrow new InvalidArgumentException(\n\t\t\t\t\t\"Editor.java - addPoint(Point): Invalid Argument.\");\n\t\telse {\n\t\t\tif (selectedCurves.size() == 0)\n\t\t\t\t// Er is nog geen geselecteerde curve -> ééntje aanmaken.\n\t\t\t\tstartNewCurve();\n\n\t\t\tfor (int i = 0; i < selectedCurves.size(); ++i) {\n\t\t\t\tif (i == 0)\n\t\t\t\t\tpush();\n\n\t\t\t\tCurve c = selectedCurves.elementAt(i);\n\n\t\t\t\tc.addInput(a); // Punt toevoegen.\n\t\t\t\tAlgorithm temp = getAlgorithm(c.getType());\n\n\t\t\t\t// Bij Hermite ( type == 'H' ) is het 2de ingegeven punt\n\t\t\t\t// telkens de tangens. Dus er moet niet getekend worden voordat\n\t\t\t\t// deze is ingegeven.\n\t\t\t\tif (temp != null && c.getType() != 'H'\n\t\t\t\t\t\t|| c.getInput().size() % 2 == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tselectionTool.deleteCurve(c);\n\t\t\t\t\t\ttemp.calculate(c);\n\t\t\t\t\t\tselectionTool.addCurve(c);\n\t\t\t\t\t} catch (InvalidArgumentException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (i == selectedCurves.size() - 1)\n\t\t\t\t\tpushNew();\n\t\t\t}\n\t\t}\n\t}",
"public Point(Point point) {\n super(point.getReferenceX(), point.getReferenceY());\n this.x = point.x;\n this.y = point.y;\n this.setHeight(point.getHeight());\n }",
"void drawMyPoint(double x, double y, MapContent map, String nombre) { \n// SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();\n// builder.setName(\"MyFeatureType\");\n// builder.setCRS( DefaultGeographicCRS.WGS84 ); // set crs \n// builder.add(\"location\", Point.class); // add geometry\n//\n// // build the type\n// SimpleFeatureType TYPE = builder.buildFeatureType();\n//\n// // create features using the type defined\n// SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE);\n// org.locationtech.jts.geom.GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();\n// org.locationtech.jts.geom.Point point = geometryFactory.createPoint(new Coordinate(x, y));\n// //\n// \n// //\n// featureBuilder.add(point);\n// SimpleFeature feature = featureBuilder.buildFeature(\"FeaturePoint\");\n// DefaultFeatureCollection featureCollection = new DefaultFeatureCollection(\"internal\", TYPE);\n// featureCollection.add(feature); // Add feature 1, 2, 3, etc\n//\n// Style style = SLD.createPointStyle(\"Star\", Color.BLUE, Color.BLUE, 0.3f, 200);\n// Layer layer = new FeatureLayer(featureCollection, style);\n// layer.setTitle(\"NewPointLayer\");\n// map.addLayer(layer);\n// //mapFrame.getMapPane().repaint();// MapPane.repaint();\n//}\n\tSimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();\n builder.setName(\"MyFeatureType\"); // \n builder.setCRS( DefaultGeographicCRS.WGS84 ); // set crs // Definimos las caracteristicas de tipo del punto q vamos a crear\n builder.add(\"location\", Point.class); // add geometry //\n org.locationtech.jts.geom.GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); //objeto q usaremos para crear el punto\n Coordinate coord = new Coordinate( x,y ); //creamos la coordenada con los puntos pasados como parametros\n org.locationtech.jts.geom.Point point = geometryFactory.createPoint(coord); // Creamos el punto geometrico\n\nSimpleFeatureType pointtype = null; //definimos el typo de punto que necesitamos apra agregarlo a la capa del mapa\n try {\n pointtype = DataUtilities.createType(\"POINT\", \"geom:Point,name:String\");\n } catch (SchemaException ex) {\n Logger.getLogger(SelectionLab.class.getName()).log(Level.SEVERE, null, ex);\n }\nSimpleFeatureBuilder featureBuilderPoints = new SimpleFeatureBuilder(pointtype); //creamos el constructor de lo que agregaremos\nDefaultFeatureCollection collectionPoints = new DefaultFeatureCollection(\"internal\", pointtype); //creamos el contenedor donde pondremos lo que agregaremos\n//PointString Point=builder.createPointString(Point);\n//LineString Point = builder.createLineString(Point);\nfeatureBuilderPoints.add(point); //agregamos el punto en el constructor\nSimpleFeature featureLine = featureBuilderPoints.buildFeature(null); \n((DefaultFeatureCollection)collectionPoints).add(featureLine); \nStyle PointStyle = SLD.createPointStyle(\"circle\", Color.RED, Color.RED,(float) 0.5,(float) 10); //definimos el estilo del punto (icono, color contorno, color, opacidad y tamaño)\n//Obserervacion: el dibujo del punto siempre se mantiene del mismo tamaño por mas que se use el zoom\nmap.addLayer(new FeatureLayer(collectionPoints, PointStyle)); //agregamos el punto a la capa\n\nguardarCoordenadas(nombre,x,y);\n}",
"@Override\n public void onNewFrame(HeadTransform headTransform) {\n float[] mtx = new float[16];\n GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);\n surface.updateTexImage();\n surface.getTransformMatrix(mtx);\n }",
"public void moveToPoint(double x, double y, double z);",
"public void addPoint( final double x, final double y ){\n points.add(new Point2d(x,y));\n\n dirty = true;\n }",
"void touch_move_draw(float event_x, float event_y) {\n path.lineTo(event_x,event_y);\n cur_x = event_x;\n cur_y = event_y;\n\n // Add point to list\n addPoint();\n }",
"public void pointToMouse() {\n pointToXY(p.mouseX,p.mouseY);\n }",
"public Point applyToPoint(Point p) {\r\n return new Point(p.getX() + this.dx, p.getY() + this.dy);\r\n }",
"@Override\r\n\t\tpublic void translate(Point3D vec) {\r\n\t\t\t// TODO Auto-generated method stub \r\n\t\t\tMyCoords mc= new MyCoords();\r\n\t\t\tPoint3D p=new Point3D(vec);\r\n\t\t\tPoint3D newPoint=mc.add(p, vec);\r\n\t\t\tthis.point=newPoint;\r\n\t\t}",
"@Override\n public void moveTo(double x, double y) {\n graphicsEnvironmentImpl.moveTo(canvas, x, y);\n }",
"static void setViewPointRelevantTo(Point point) {\n point.translate(-1 * viewPoint.x, -1 * viewPoint.y);\n point.x /= Map.zoom;\n point.y /= Map.zoom;\n point.translate(viewPoint.x, viewPoint.y);\n viewPoint.setLocation(point.x - GAME_WIDTH / 2, point.y - GAME_HEIGHT / 2);\n verifyViewPoint();\n }",
"public void addPoint(Integer x, Float y, String showValue) {\n\t\tCoordinate coordinate = new Coordinate(x, y);\n\t\tcoordinate.setShowValue(showValue);\n\t\tcoordinates.add(coordinate);\n\t}",
"Point add (double x, double y);",
"public void addPoint(double[] point);"
] | [
"0.61995685",
"0.6117262",
"0.60099167",
"0.5945552",
"0.58801657",
"0.58075714",
"0.5783421",
"0.57598406",
"0.56946534",
"0.56847304",
"0.5668545",
"0.56626356",
"0.56494397",
"0.563147",
"0.5623555",
"0.5622149",
"0.5614935",
"0.55835974",
"0.55376613",
"0.55005836",
"0.54981595",
"0.54965395",
"0.54735315",
"0.547225",
"0.5450334",
"0.5449461",
"0.5421491",
"0.5419914",
"0.5416942",
"0.539324",
"0.53837633",
"0.53591996",
"0.53495646",
"0.53444606",
"0.53408843",
"0.5312096",
"0.53115773",
"0.53103083",
"0.53025484",
"0.5270356",
"0.52537686",
"0.5220412",
"0.5187359",
"0.51765025",
"0.51649046",
"0.51635826",
"0.51559335",
"0.5155508",
"0.51405513",
"0.51384175",
"0.5135635",
"0.5131376",
"0.51290005",
"0.5114347",
"0.51119334",
"0.511036",
"0.51006633",
"0.5095657",
"0.5085512",
"0.5083537",
"0.50797266",
"0.5076824",
"0.5072192",
"0.50596046",
"0.50591326",
"0.5059108",
"0.5054518",
"0.504003",
"0.5036585",
"0.5030446",
"0.5021128",
"0.5012854",
"0.5010537",
"0.5004698",
"0.50024974",
"0.5002007",
"0.49877033",
"0.49875227",
"0.49875227",
"0.49875227",
"0.49875227",
"0.4985817",
"0.49835008",
"0.49645582",
"0.4964295",
"0.49641278",
"0.49613386",
"0.4953039",
"0.49423507",
"0.49415782",
"0.49339932",
"0.493272",
"0.49307063",
"0.49219316",
"0.49132845",
"0.49068412",
"0.49047533",
"0.49040547",
"0.49035063",
"0.48986822"
] | 0.7191331 | 0 |
This method creates the Transform Points of a Graphic object given a Rectangle representing it's boundaries | private void createTransformPoints(Rectangle bnds, GraphicObject curr) {
double degreesAngle, radiansAngle;
Rectangle novo = bnds;
this.transformPoints = new VirtualGroup();
degreesAngle = curr.getRotation();
/** If the object is rotated, we need to rotate i back to the angle 0 in order to get valid boundaries. Tatami doesn't rotates the object's bounds, instead it gives wrong bounds so we need to perform this operation and rotate the bounds on our side. */
if(degreesAngle != 0.0) {
curr.uRotate((float) (degreesAngle * -1.0));
novo = curr.getBounds();
}
radiansAngle = (degreesAngle * (2.0*Math.PI))/360.0;
addTransformPoint(novo.getCenterX(), novo.getY()+novo.getHeight()+(novo.getHeight()/4), 0, curr, radiansAngle);
addTransformPoint(novo.getX(), novo.getY(), 1, curr, radiansAngle);
addTransformPoint(novo.getCenterX(), novo.getY(), 2, curr, radiansAngle);
addTransformPoint(novo.getX() + novo.getWidth(), novo.getY(), 3, curr, radiansAngle);
addTransformPoint(novo.getX(), novo.getCenterY(), 4, curr, radiansAngle);
addTransformPoint(novo.getX() + novo.getWidth(), novo.getCenterY(), 5, curr, radiansAngle);
addTransformPoint(novo.getX(), novo.getY() + novo.getHeight(), 6, curr, radiansAngle);
addTransformPoint(novo.getCenterX(), novo.getY() + novo.getHeight(), 7, curr, radiansAngle);
addTransformPoint(novo.getX() + novo.getWidth(), novo.getY() + novo.getHeight(), 8, curr, radiansAngle);
/** This creates the line between the rotation point and the object */
Line aux2 = new Line((int)(this.transformPointers[Action.SOUTH].getX()+2), (int)(this.transformPointers[Action.SOUTH].getY()+2), (int)(this.transformPointers[Action.ROTATE].getX()), (int)(this.transformPointers[Action.ROTATE].getY()));
aux2.setStroke( Color.GRAY, 1);
this.transformPoints.add(aux2);
this.canvas.add(this.transformPoints, 0, 0);
this.transformPointers[Action.SOUTH].moveToFront();
this.transformPointers[Action.ROTATE].moveToFront();
if(degreesAngle != 0.0) {
curr.uRotate((float)degreesAngle);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void createRectangles();",
"private void transformPoints() {\r\n\r\n\t\t// angle between x-axis and the line between start and goal\r\n//\t\tthis.angle = inverse_tan (slope)\r\n\t\tthis.angle = (int) Math.toDegrees(Math.atan2(goal.getY()-robot.getY(), goal.getX()-robot.getX()));\r\n\r\n\t\t// deviation of start point's x-axis from (0,0)\r\n\t\tthis.deviation = this.robot;\r\n\r\n\t\tthis.robot = new Robot(GA_PathPlanning.Transform(robot, -deviation.x, -deviation.y));\r\n\t\tthis.robot = new Robot(Rotate(robot, -angle));\r\n\t\t \r\n\t\tthis.goal = GA_PathPlanning.Transform(goal, -deviation.x, -deviation.y);\r\n\t\tthis.goal = GA_PathPlanning.Rotate(goal, -angle);\r\n\t\t\r\n\t\tfor(int i=0;i<obstacles.length;i++)\r\n\t\t{\r\n\t\t\tthis.obstacles[i]= new Obstacle(GA_PathPlanning.Transform(obstacles[i], -deviation.x, -deviation.y));\r\n\t\t\tthis.obstacles[i]= new Obstacle(GA_PathPlanning.Rotate(obstacles[i], -angle));\r\n\t\t}\r\n\t\t// make start point as (0,0)\r\n\t\t// transform xy-axis to axis of the straight line between start and goal\r\n\t\t\r\n\t\t\r\n\t}",
"private void transformObject(int x, int y) {\n double sx, sy, l, r, nx, ny, tx, ty, alpha, origCX = 0, origCY = 0;\n Rectangle bnds;\n\n if(curr_obj == transformPointers[Action.ROTATE]) {\n /* the mouse vector 1 */\n GeoVector mouseVector = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n /* the rotation vector. i.e. the fixed vector that will be used as origin composed by the subtraction of the object center with the rotation point */\n GeoVector rotationVector = new GeoVector(this.lastPosition[0], this.lastPosition[1], this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseVector.normalize();\n rotationVector.normalize();\n\n alpha = mouseVector.getAngleWith(rotationVector.getX(), rotationVector.getY());\n\n /** After passing the 180 degrees, the atan2 function returns a negative angle from 0 to PI. So this will convert the final gobal angle to 0-2PI */\n if(alpha < 0 ) {\n alpha = (2 * Math.PI) + alpha; \n }\n\n alpha -= this.currRotation;\n this.currRotation += alpha;\n\n Point c = new Point(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.aux_obj.uRotate((float)(-1.0*(alpha*(180/Math.PI))), c);\n \n } else {\n alpha = this.aux_obj.getRotation();\n\n /** Here we rotate the selected Graphic Object, it's tranformation points and the mouse coordinates back to the zero angle, to permit a correct object scalling. */\n if(alpha != 0.0) {\n origCX = this.aux_obj.getCenterX();\n origCY = this.aux_obj.getCenterY();\n this.aux_obj.uRotate((float)(alpha*-1.0), this.aux_obj.getCenter());\n rotateTransformPoints(alpha);\n GeoVector mouseCoord = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseCoord.rotate( ((alpha*-1.0) * (2.0*Math.PI))/360 );\n mouseCoord.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n x = (int)mouseCoord.getX();\n y = (int)mouseCoord.getY();\n\n }\n\n /** Tatami rotates the object from it's x and y point to the edges. So this means that sometimes we need to translate the object a few pixels to asure that it's upper left corner is on the same position. */\n if(curr_obj == transformPointers[Action.NORTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)-tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.NORTH]) {\n if(y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate(0, (int)-ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTH];\n }\n } else if(curr_obj == transformPointers[Action.NORTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHEAST];\n }\n\n } else if(curr_obj == transformPointers[Action.WEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n aux_obj.uTranslate((int)-tx, 0);\n aux_obj.scale( (float)sx, 1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.WEST];\n }\n } else if(curr_obj == transformPointers[Action.EAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n aux_obj.uTranslate((int)tx, 0);\n aux_obj.scale( (float)sx, (float)1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.EAST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)-tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTH]) {\n if(y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate(0, (int)ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTH];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHEAST];\n }\n }\n\n\n }\n \n }",
"public Rectangle(Point point1, Point point2){\n super(4);\n if(point1.getX() == point2.getX() || point1.getY() == point2.getY())\n throw new IllegalArgumentException(\"Input points are not opposite to each other.\");\n int point1X = point1.getX(); //stores the x of the first point\n int point1Y = point1.getY(); //stores the y of the first point\n int point2X = point2.getX(); //stores the x of the second point\n int point2Y = point2.getY(); //stores the y of the second point\n \n if(point1X < point2X){\n width = point2X - point1X;\n if(point1Y < point2Y){\n height = point2Y - point1Y;\n topLine = new Line(point1X, point1Y, point2X, point1Y);\n rightLine = new Line(point2X, point1Y, point2X, point2Y);\n bottomLine = new Line(point2X, point2Y, point1X, point2Y);\n leftLine = new Line(point1X, point2Y, point1X, point1Y);\n }\n if(point1Y > point2Y){\n height = point1Y - point2Y;\n topLine = new Line(point1X, point2Y, point2X, point2Y);\n rightLine = new Line(point2X, point2Y, point2X, point1Y);\n bottomLine = new Line(point2X, point1Y, point1X, point1Y);\n leftLine = new Line(point1X, point1Y, point1X, point2Y);\n }\n }\n if(point1X > point2X){\n width = point1X - point2X;\n if(point1Y > point2Y){\n height = point1Y - point2Y;\n bottomLine = new Line(point1X, point1Y, point2X, point1Y);\n leftLine = new Line(point2X, point1Y, point2X, point2Y);\n topLine = new Line(point2X, point2Y, point1X, point2Y);\n rightLine = new Line(point1X, point2Y, point1X, point1Y);\n }\n if(point1Y < point2Y){\n height = point2Y - point1Y;\n leftLine = new Line(point2X, point2Y, point2X, point1Y);\n topLine = new Line(point2X, point1Y, point1X, point1Y);\n rightLine = new Line(point1X, point1Y, point1X, point2Y);\n bottomLine = new Line(point1X, point2Y, point2X, point2Y);\n }\n }\n referencePoint = topLine.getFirstPoint();\n }",
"public abstract Transformation updateTransform(Rectangle selectionBox);",
"public void drawArea(Graphics2D g, int width, int height, double minX,\n double minY, double maxX, double maxY) {\n upperX = maxX;\n lowerX = minX;\n\n upperY = maxY;\n lowerY = minY;\n //debug, drawLine bounds\n// g.drawLine(XOffSet, YOffSet, width, YOffSet);\n// g.drawLine(XOffSet, height, width, height); //X\n//\n// g.drawLine(XOffSet, YOffSet, XOffSet, height);\n// g.drawLine(width, YOffSet, width, height); //Y\n\n double Xscale = GetXScale(width);\n double Yscale = GetYScale(height);\n int centerX = getCenterX(width);\n int centerY = getCenterY(height);\n\n //drawGrid(g, width, height, minX, minY, maxX, maxY);\n\n //create a polygon for every area between two zeros\n g.setColor(LineColor);\n //ArrayList<Polygon> p = new ArrayList<>();\n Polygon p = new Polygon();\n //p.add(new Polygon());\n g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,\n Opacity));\n //p.get(0).addPoint(XOffSet, getCenterY(height));\n p.addPoint(XOffSet, getCenterY(height));\n for (int i = 0; i <= PointArray.length - 2; i += 2) {\n double x = ((PointArray[i] * Xscale) + centerX);\n double y = ((centerY) - (PointArray[i + 1]) * Yscale);\n if (x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {\n continue;\n }\n if (y == Double.POSITIVE_INFINITY || y == Double.NEGATIVE_INFINITY) {\n y = height - YOffSet;\n }\n //p.get(p.size() - 1).addPoint((int) x, (int) y);\n p.addPoint((int) x, (int) y);\n }\n //p.get(p.size() - 1).addPoint(width, getCenterY(height));\n p.addPoint(width, getCenterY(height));\n //for (int i = 0; i <= p.size() - 1; i++) {\n g.fill(p);//.get(i));\n //}\n g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1));\n drawLine(g, width, height, minX, minY, maxX, maxY);\n }",
"public Rectangle2D translateRectangle( Figure f, Rectangle2D r, Point2D dir);",
"protected void createRect()\r\n\t{\r\n\t\trect = new Rectangle(getX(),getY(),width,height);\r\n\t}",
"public abstract Shape create(Point2D press, Point2D release);",
"private Geometry createRectangle(double x, double y, double w, double h) {\n Coordinate[] coords = {\n new Coordinate(x, y), new Coordinate(x, y + h),\n new Coordinate(x + w, y + h), new Coordinate(x + w, y),\n new Coordinate(x, y)\n };\n LinearRing lr = geometry.getFactory().createLinearRing(coords);\n\n return geometry.getFactory().createPolygon(lr, null);\n }",
"protected void applyTransformations(Graphics2D g2d) {\n\t\tg2d.translate(position.x,position.y);\n\t\tg2d.translate(pivotPoint.x, pivotPoint.y);\n\t\t//Would still like to rotate around scaled pivot point maybe\n\t\tg2d.rotate(rotation);\n\t\tg2d.scale(scaleX, scaleY);\n\t\tg2d.translate(-pivotPoint.x, -pivotPoint.y);\n\t\tpointTransform = g2d.getTransform();\n\t}",
"public abstract Polygon4D project();",
"private void createGraphics() {\n\n Graphic graphic;\n // create spatial reference for the points\n SpatialReference spatialReference = SpatialReference.create(4326);\n\n // create points to place markers\n List<Point> points = new ArrayList<>();\n points.add(new Point(-2.641, 56.077, spatialReference));\n points.add(new Point(-2.669, 56.058, spatialReference));\n points.add(new Point(-2.718, 56.060, spatialReference));\n points.add(new Point(-2.720, 56.073, spatialReference));\n\n // create simple marker symbols for the points\n markers = new ArrayList<>();\n markers.add(new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, RED, 10));\n markers.add(new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.TRIANGLE, PURPLE, 10));\n markers.add(new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CROSS, GREEN, 10));\n markers.add(new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.DIAMOND, BLUE, 10));\n\n // create a list of names for graphics\n List<String> names = new ArrayList<>();\n names.add(\"LAMB\");\n names.add(\"CANTY BAY\");\n names.add(\"NORTH BERWICK\");\n names.add(\"FIDRA\");\n\n // create a list of descriptions for graphics\n List<String> descriptions = new ArrayList<>();\n descriptions.add(\"Just opposite of Bass Rock.\");\n descriptions.add(\"100m long and 50m wide.\");\n descriptions.add(\"Lighthouse in northern section.\");\n descriptions.add(\"Also known as Barley Farmstead.\");\n\n // create four graphics with attributes and add to graphics overlay\n for (int i = 0; i < 4; i++) {\n graphic = new Graphic(points.get(i), markers.get(i));\n graphic.getAttributes().put(\"NAME\", names.get(i));\n graphic.getAttributes().put(\"DESCRIPTION\", descriptions.get(i));\n graphicsOverlay.getGraphics().add(graphic);\n }\n }",
"public abstract PaintObject[][] separate(Rectangle _r);",
"@Override\n\t//THIS IS THE BULLET HITBOX@@@!\n\tpublic void compile() {\n\t\thitBox = new Polygon();\n\t\thitBox.addPoint((int)getX(), (int)getY());\n\t\thitBox.addPoint((int) getX() + 10, (int) getY());\n\t\thitBox.addPoint((int) getX() + 10, (int) getY() + 10);\n\t\thitBox.addPoint((int) getX(), (int) getY() + 10);\n\t\trotateHitBox(vector.getRadians());\n\t}",
"private void generateBoxGeom()\n {\n // textures all share the same array, so process separately.\n textureBuffer = createBuffer(BOX_TEX_COORDS.length);\n textureBuffer.put(BOX_TEX_COORDS);\n textureBuffer.rewind();\n\n vertexBuffer = new FloatBuffer[6];\n normalBuffer = new FloatBuffer[6];\n\n for(int i = 0; i < 6; i++)\n {\n vertexBuffer[i] = createBuffer(12);\n normalBuffer[i] = createBuffer(12);\n }\n\n vertexBuffer[POSITIVE_X].put(RIGHT_BOX_COORDS);\n normalBuffer[POSITIVE_X].put(RIGHT_BOX_NORMALS);\n\n vertexBuffer[NEGATIVE_X].put(LEFT_BOX_COORDS);\n normalBuffer[NEGATIVE_X].put(LEFT_BOX_NORMALS);\n\n vertexBuffer[POSITIVE_Y].put(TOP_BOX_COORDS);\n normalBuffer[POSITIVE_Y].put(TOP_BOX_NORMALS);\n\n vertexBuffer[NEGATIVE_Y].put(BOTTOM_BOX_COORDS);\n normalBuffer[NEGATIVE_Y].put(BOTTOM_BOX_NORMALS);\n\n vertexBuffer[POSITIVE_Z].put(BACK_BOX_COORDS);\n normalBuffer[POSITIVE_Z].put(BACK_BOX_NORMALS);\n\n vertexBuffer[NEGATIVE_Z].put(FRONT_BOX_COORDS);\n normalBuffer[NEGATIVE_Z].put(FRONT_BOX_NORMALS);\n\n for(int i = 0; i < 6; i++)\n {\n vertexBuffer[i].rewind();\n normalBuffer[i].rewind();\n }\n }",
"private void addTransformPoint(double x, double y, int index, GraphicObject curr, double radiansAngle) {\n /** If the object is rotated, the transform point also has to be rotated.\n * Here we calculate the new coordinates acording to the rotation angle. */\n if(radiansAngle != 0.0) {\n GeoVector vect = new GeoVector(x, y, curr.getCenterX(), curr.getCenterY());\n vect.rotate(radiansAngle);\n vect.addPoint(curr.getCenterX(), curr.getCenterY());\n x = vect.getX();\n y = vect.getY();\n }\n /** If it's the rotation point, then it creates a green circle */\n if(index==0) {\n Circle aux = new Circle(2);\n aux.setFillColor(Color.GREEN);\n aux.setStroke(Color.GRAY, 1);\n\n this.transformPoints.add(aux);\n\t\t this.transformPointers[index] = aux;\n\t\t aux.translate((int)x, (int)y);\n /** Otherwise it just creates a normal white rectangle */\n } else {\n Rect aux = new Rect(4,4);\n aux.setFillColor(Color.WHITE);\n aux.setStroke(Color.GRAY, 1);\n\n this.transformPoints.add(aux);\n\t\t this.transformPointers[index] = aux;\n\t\t aux.translate((int)x-2, (int)y-2);\n }\n\t}",
"private ArrowPoint create(double xBeg, double yBeg, double xEnd, double yEnd){\n ArrowPoint b = new ArrowPoint(xBeg, yBeg);\n ArrowPoint e = new ArrowPoint(xEnd, yEnd);\n ArrowLine l = new ArrowLine(b, e);\n e.rotateProperty().bind(l.rotateProperty());\n a.addLine(b, e, l);\n return e;\n }",
"@Override\n PickShape transform(Transform3D t3d) {\n\t// If the bounds is a BoundingBox, then the transformed bounds will\n\t// get bigger. So this is a potential bug, and we'll have to deal with\n\t// if there is a complain.\n\tBounds newBds = (Bounds)bounds.clone();\n\tnewBds.transform(t3d);\n\tPickBounds newPB = new PickBounds(newBds);\n\n\treturn newPB;\n }",
"private PolygonEditor(String f, float boxHeight)\n {\n super();\n this.boxHeight = boxHeight;\n System.out.println(\"height = \" + boxHeight);\n powerOf10 = 1;\n while (powerOf10*boxHeight < 300) {\n powerOf10 *= 10;\n }\n\n if (f != null) icon = new ImageIcon(f);\n if (icon == null) {\n pixelScale = SCALE;\n bitmapWidth = WIDTH/SCALE;\n bitmapHeight = HEIGHT/SCALE;\n } else {\n Image image = icon.getImage();\n int w = icon.getIconWidth();\n int h = icon.getIconHeight();\n pixelScale = Math.min(WIDTH/w, HEIGHT/h);\n bitmapWidth = w;\n bitmapHeight = h;\n image = image.getScaledInstance((int)(w * pixelScale), -1, Image.SCALE_DEFAULT);\n icon.setImage(image);\n }\n canvasWidth = (bitmapWidth * pixelScale);\n canvasHeight = (bitmapHeight * pixelScale);\n centreX = canvasWidth/2.0f;\n centreY = canvasHeight/2.0f;\n scale = boxHeight / canvasHeight;\n setPreferredSize(new java.awt.Dimension((int)canvasWidth, (int)canvasHeight));\n\n points = new ArrayList<Point2D.Float>();\n addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent e) {\n Point2D.Float p = toGridPoint(e.getX(), e.getY());\n currentVertex = findVertex(p);\n if (currentVertex < 0) {\n currentVertex = points.size();\n points.add(p);\n } else {\n points.set(currentVertex, p);\n }\n repaint();\n }\n\n public void mouseReleased(MouseEvent e) {\n String mods = e.getMouseModifiersText(e.getModifiers());\n if (!mods.equals(\"Button1\")) {\n points.remove(currentVertex);\n }\n currentVertex = -1;\n updateView();\n }\n });\n addMouseMotionListener(new MouseMotionAdapter() {\n public void mouseDragged(MouseEvent e) {\n Point2D.Float p = toGridPoint(e.getX(), e.getY());\n points.set(currentVertex, p);\n repaint();\n }\n });\n }",
"public abstract Vector getDrawPosition(Rectangle selectionBox);",
"public void init(Map<String, String> attributes) {\r\n\r\n\t\tif (attributes.containsKey(\"p0\"))\r\n\t\t\tp0 = new Vec(attributes.get(\"p0\"));\r\n\t\tif (attributes.containsKey(\"p1\"))\r\n\t\t\tp1 = new Vec(attributes.get(\"p1\"));\r\n\t\tif (attributes.containsKey(\"p2\"))\r\n\t\t\tp2 = new Vec(attributes.get(\"p2\"));\r\n\t\tif (attributes.containsKey(\"p3\"))\r\n\t\t\tp3 = new Vec(attributes.get(\"p3\"));\r\n\r\n\t\tp4 = Vec.add(Vec.add(Vec.sub(p1, p0), Vec.sub(p3, p0)), p0);\r\n\t\tp5 = Vec.add(Vec.add(Vec.sub(p2, p0), Vec.sub(p3, p0)), p0);\r\n\t\tp6 = Vec.add(Vec.add(Vec.sub(p5, p3), Vec.sub(p4, p3)), p3);\r\n\r\n\t\tbase = new Rectangle(p0, p1, p3, attributes);\r\n\t\tfacep0p2p1 = new Rectangle(p0, p2, p1, attributes);\r\n\t\tfacep0p2p3 = new Rectangle(p0, p2, p3, attributes);\r\n\t\tfacep3p4p5 = new Rectangle(p3, p5, p4, attributes);\r\n\t\tfacep4p1p6 = new Rectangle(p4, p1, p6, attributes);\r\n\t\ttop = new Rectangle(p5, p2, p6, attributes);\r\n\r\n\t\tsuper.init(attributes);\r\n\t}",
"public abstract Vector getAnchorPoint(Rectangle selectionBox);",
"public PDRectangle createRetranslatedRectangle()\n {\n PDRectangle retval = new PDRectangle();\n retval.setUpperRightX( getWidth() );\n retval.setUpperRightY( getHeight() );\n return retval;\n }",
"private void createRectangles() {\r\n rectangles.clear();\r\n for (int i = 0; i < gridSize * gridSize; i++) {\r\n Rectangle r = new Rectangle(rectangleSize, rectangleSize, Color.BLUE);\r\n r.setStroke(Color.BLACK);\r\n rectangles.add(r);\r\n }\r\n }",
"AREA createAREA();",
"public VectorGraphics2D createGraphics(Rectangle clipRect) {\n\t\tVectorGraphics2D g = createGraphics();\n\t\tg.clipRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);\n\t\treturn g;\n\t}",
"public void fillRectangle(RectangleShape rectangle);",
"@Override\n\tprotected AbstractFigure createFigure(Point p) {\n\t\treturn new Rect(p.x, p.y, 0,0);\n\t}",
"public void setTransform(Rectangle view, Rectangle2D limits) {\n this.view = view;\n\t\tRectangle2D.Double lim = (Rectangle2D.Double)limits.clone();\n xUnit = (view.width/(lim.width - lim.x));\n yUnit = (view.height/(lim.height - lim.y));\n \n if (xUnit > yUnit){\n\t\t\txUnit = yUnit;\n\t\t\tlim.width = ((view.width/xUnit) + lim.x);\n }else{\n\t\t\tyUnit = xUnit;\n\t\t\tlim.height = ((view.height/yUnit) + lim.y);\n }\n\t\t\n aux.setToIdentity();\n transform.setToIdentity();\n aux.translate(lim.x, lim.y);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.scale(1/xUnit, -1/yUnit);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.translate(0, (-1) * (view.height - 1));\n transform.concatenate(aux);\n try {\n inverse = transform.createInverse();\n \t}catch (Exception e){\n\t\t\tSystem.out.println(\"Unable to create inverse trasform\");\n\t\t}\n\t\t\n this.limits = limits;\n\t\t\n }",
"private void render() {\n if (drawingArea != null) {\n //get graphics of the image where coordinate and function will be drawn\n Graphics g = drawingArea.getGraphics();\n\n //draw the x-axis and y-axis\n g.drawLine(0, originY, width, originY);\n g.drawLine(originX, 0, originX, height);\n\n //print numbers on the x-axis and y-axis, based on the scale\n for (int i = 0; i < lengthX; i++) {\n g.drawString(Integer.toString(i), (int) (originX + (i * scaleX)), originY);\n g.drawString(Integer.toString(-1 * i), (int) (originX + (-i * scaleX)), originY);\n }\n for (int i = 0; i < lengthY; i++) {\n g.drawString(Integer.toString(-1 * i), originX, (int) (originY + (i * scaleY)));\n g.drawString(Integer.toString(i), originX, (int) (originY + (-i * scaleY)));\n }\n\n // draw the lines\n for (int i = 0; i < points1.size() - 1; i++) {\n g.setColor(Color.BLACK);\n g.drawLine((int) (originX + points1.get(i).x * scaleX), (int) (originY - points1.get(i).y * scaleY),\n (int) (originX + points1.get(i + 1).x * scaleX), (int) (originY - points1.get(i + 1).y * scaleY));\n g.setColor(Color.RED);\n g.drawLine((int) (originX + points2.get(i).x * scaleX), (int) (originY - points2.get(i).y * scaleY),\n (int) (originX + points2.get(i + 1).x * scaleX), (int) (originY - points2.get(i + 1).y * scaleY));\n }\n }\n }",
"private AffineTransform createTransform() {\n Dimension size = getSize();\n Rectangle2D.Float panelRect = new Rectangle2D.Float(\n BORDER,\n BORDER,\n size.width - BORDER - BORDER,\n size.height - BORDER - BORDER);\n AffineTransform tr = AffineTransform.getTranslateInstance(panelRect.getCenterX(), panelRect.getCenterY());\n double sx = panelRect.getWidth() / mapBounds.getWidth();\n double sy = panelRect.getHeight() / mapBounds.getHeight();\n double scale = min(sx, sy);\n tr.scale(scale, -scale);\n tr.translate(-mapBounds.getCenterX(), -mapBounds.getCenterY());\n return tr;\n }",
"private void createRegions() {\n\t\t// create pitch regions\n\t\tfor (int column = 0; column < REGION_COLUMNS; column++) {\n\t\t\tfor (int row = 0; row < REGION_ROWS; row++) {\n\t\t\t\tthis.regions.add(new Rectangle(column * REGION_WIDTH_IN_PX, row * REGION_HEIGHT_IN_PX,\n\t\t\t\t\t\t REGION_WIDTH_IN_PX, REGION_HEIGHT_IN_PX));\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public ArrayList<Point> points(Rectangle inRectangle) {\n // if the node's rect and the given rect don't intersect, return an empty array,\n // because there can't be any points that lie the node's (or its children's) rect and\n // in the given rect\n if (!this.rectangle.intersects(inRectangle)) {\n return new ArrayList<Point>();\n }\n\n ArrayList<Point> result = new ArrayList<Point>();\n\n // collect the node's points that lie in the rect\n for (Point point : points) {\n if (inRectangle.contains(point)) {\n result.add(point);\n }\n }\n\n if (hasChildren) {\n // recursively add children's points that lie in the rect\n for (QuadtreeNode node : children) {\n result.addAll(node.points(inRectangle));\n }\n }\n\n return result;\n }",
"public void createMinimap() {\n if (gameField.getFields().size() == 1024) {\n rootSize = 32;\n blockSize = 8;\n } else { //if size == 64^2 == 4096\n rootSize = 64;\n blockSize = 4;\n }\n int magnification = gameFieldController.getMagnification();\n if (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene() != null) {\n positionBoxSizeX = blockSize *\n (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene().getWidth() / (rootSize * magnification));\n\n positionBoxSizeY = blockSize *\n (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene().getHeight() / (rootSize * magnification));\n } else {\n //for offline test\n positionBoxSizeX = (blockSize * 1920) / (rootSize * magnification);\n positionBoxSizeY = (blockSize * 1080) / (rootSize * magnification);\n }\n\n for (int i = 0; i < rootSize; ++i) {\n for (int j = 0; j < rootSize; ++j) {\n Field currentField = gameField.getFields().get(i * rootSize + j);\n Rectangle rectangle = new Rectangle(blockSize, blockSize);\n if (!currentField.getType().equals(\"Grass\")) {\n if (currentField.getType().equals(\"Water\")) {\n rectangle.setFill(Color.rgb(11, 89, 139));\n } else if (currentField.getType().equals(\"Forest\")) {\n rectangle.setFill(Color.rgb(38, 106, 0));\n } else { //if currentField equals Mountain\n rectangle.setFill(Color.rgb(95, 111, 54));\n }\n rectangle.relocate((i * blockSize) + 1, (j * blockSize) + 1);\n drawPane.getChildren().add(rectangle);\n }\n }\n }\n Rectangle rect = new Rectangle(positionBoxSizeX, positionBoxSizeY);\n Rectangle clip = new Rectangle(1, 1, positionBoxSizeX - 2, positionBoxSizeY - 2);\n positionBox = Shape.subtract(rect, clip);\n positionBox.setFill(Color.WHITE);\n drawPane.getChildren().add(positionBox);\n isCreated = true;\n }",
"void setRectHitbox(float w, float h) {\n _hitbox = new PVector[]{\n new PVector(-w/2, h/2),\n new PVector(-w/2, -h/2),\n new PVector(w/2, -h/2),\n new PVector(w/2, h/2)\n };\n }",
"@Override\n public void setRectangle() {\n switch (direction){\n case 0:\n rectangle.setLocation((int)x+5,(int)y+8);\n break;\n case 2:\n rectangle.setLocation((int)x+5,(int)y+8);\n break;\n case 1:\n rectangle.setLocation((int)x+13,(int)y+8);\n break;\n case 3:\n rectangle.setLocation((int)x+2,(int)y+8);\n break;\n }\n\n }",
"public void mousePressed(GraphicObject graphicObject, Event event) {\n\t\tint x, y;\n\t\t\n\t\tx = DOM.eventGetClientX(event) - canvas.getAbsoluteLeft() + Window.getScrollLeft();\n\t\ty = DOM.eventGetClientY(event) - canvas.getAbsoluteTop() + Window.getScrollTop(); \n\t\t\n\t\tif(!action.isSelect() && !action.isPolyline() && !action.isTextBox() && !action.isPencil()) {\n\n switch(action.getAction()) {\n\n\t\t\t\n\t\t\t\tcase Action.LINE:\n\t\t\t\t\t/* Starts to draw a line */\n\t\t\t\t\tcurr_obj = new Line(0, 0, 1, 1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Action.RECTANGLE:\n\t\t\t\t\t/* Starts to draw a rectangle */\n\t\t\t\t\tcurr_obj = new Rect(1, 1);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase Action.CIRCLE:\n\t\t\t\t\t/* Starts to draw a circle */\n\t\t\t\t\tcurr_obj = new Circle(1);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase Action.ELLIPSE:\n\t\t\t\t\t/* Starts to draw a Ellipse */\n\t\t\t\t\tcurr_obj = new Ellipse(1, 1);\n\t\t\t\t\tbreak;\n\n }\n\t\t\t\n\t\t\tlastPosition[0] = x;\n\t\t\tlastPosition[1] = y;\n\t\t\t\n\t\t\tobjPosition[0] = x;\n\t\t\tobjPosition[1] = y;\n\t\t\t\n\t\t\taddGraphicObject( curr_obj, x, y);\n\t\t\t\n\t\t/* Selects a object */\n\t\t} else if(action.isSelect() && (graphicObject != null)) {\n /** If there was another object previously selected, unselect it. */\n if(curr_obj != null && graphicObject != curr_obj && graphicObject.getGroup() != transformPoints) {\n unSelect();\n }\n\n /** If we didn't click on any Transform Point, then we select the object. */\n if((graphicObject.getGroup() != transformPoints)) {\n\n if(curr_obj == null) {\n Rectangle bnds = graphicObject.getBounds();\n if(bnds != null) {\n /** This may seem strange but for some object types, mainly Paths and Ellipses, Tatami's method getBounds() will return null until the object is translated. */\n graphicObject.translate(1, 1);\n graphicObject.translate(-1, -1);\n if(bnds.getHeight() == 0 && bnds.getWidth() == 0) {\n bnds = graphicObject.getBounds();\n }\n\n this.backupStyle();\n\n fillOpacity.setValue(graphicObject.uGetFillColor().getAlpha());\n strokeOpacity.setValue(graphicObject.getStrokeColor().getAlpha());\n\n currentFillColor = graphicObject.uGetFillColor();\n DOM.setStyleAttribute(fill.getElement(), \"backgroundColor\",currentFillColor.toCss(false));\n currentFillColor.setAlpha(graphicObject.uGetFillColor().getAlpha());\n\n currentStrokeColor = graphicObject.getStrokeColor();\n DOM.setStyleAttribute(stroke.getElement(), \"backgroundColor\",currentStrokeColor.toCss(false));\n this.currentStrokeSize.setValue(graphicObject.getStrokeWidth());\n //chooseStrokeSize(graphicObject.getStrokeWidth()-1, graphicObject.getStrokeWidth());\n createTransformPoints(bnds, graphicObject);\n }\n\n curr_obj = graphicObject;\n }\n lastPosition[0] = x;\n lastPosition[1] = y;\n objPosition[0] = x;\n objPosition[1] = y;\n isMovable = true;\n\n /** if the user clicked on a transform point, this settles the variables for the object tranformation. */\n } else {\n lastPosition[0] = x;\n lastPosition[1] = y;\n isTransformable = true;\n aux_obj = curr_obj;\n\t\t\t\tcurr_obj = graphicObject;\n currRotation = 0.0;\n if(curr_obj == transformPointers[Action.ROTATE]) {\n canvas.remove(transformPoints);\n transformPoints.clear();\n }\n }\n\n /** Starts to draw a TextBox.\n * To add usability, a Text object is allways composed by a Text object and a TextBox. The TextBox is simillar to a Rectangle but it's alpha values are set to 0(it's transparent) and has the size of the text's bounds.\n * This allows the user to select a Text object more easily because now he has a rectangle with the size of the Text's boundaries to click on. The TextBox contains a link to the Text (and also the Text to the TextBox) so when a user click on it, we know which Text Object is selected and perform the given actions on it as well.\n * Note: This weren't supported by Tatami, i had to implement it.\n * */\n } else if(this.action.isTextBox()) {\n\n this.curr_obj = new com.objetdirect.tatami.client.gfx.TextBox(1.0, 1.0, null);\n this.lastPosition[0] = x;\n\t\t\tthis.lastPosition[1] = y;\n\n\t\t\tthis.objPosition[0] = x;\n\t\t\tthis.objPosition[1] = y;\n\n\t\t\tthis.addTextBox( this.curr_obj, x, y);\n } else if(this.action.isPencil()) {\n /* Starts to draw with the pencil */\n curr_obj = new Path();\n ((Path)curr_obj).moveTo(x, y);\n Color fill = new Color(this.currentFillColor.getRed(), this.currentFillColor.getGreen(), this.currentFillColor.getBlue(), 0);\n\n objPosition[0] = x;\n\t\t\tobjPosition[1] = y;\n\n curr_obj.setFillColor(fill);\n curr_obj.setStroke(currentStrokeColor, currentStrokeSize.getValue());\n canvas.add(curr_obj, 0, 0);\n /* Otherwise it adds a new point in the Polyline */\n } else if(this.action.isPolyline() && curr_obj != null) {\n this.lastPosition[0] = x;\n this.lastPosition[1] = y;\n }\n\t}",
"private Rectangle(Point position, Map<String, Double> properties, Color color, Color fillColor) {\n super(position, color, fillColor);\n this.properties = properties;\n }",
"private void rotateTransformPoints(double angle) {\n int i;\n for(i=1; i<9;i++) {\n GeoVector vec = new GeoVector(this.transformPointers[i].getX(), this.transformPointers[i].getY(), this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n vec.rotate(((angle*-1.0) * (2.0*Math.PI))/360);\n vec.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.transformPointers[i].translate( (int)(vec.getX() - this.transformPointers[i].getX()), (int)(vec.getY() - this.transformPointers[i].getY()));\n }\n\n }",
"public abstract Shape transform(Transformation t);",
"@FXML\r\n private void crearTriangulo(ActionEvent event) {\n \r\n double x[] = {100, 150, 50};\r\n double y[] = {100, 210, 210, 50};\r\n \r\n g.setFill(Color.GOLD);\r\n g.fillPolygon(x, y, 3);\r\n }",
"private void paintCourbePoints() {\n\t\tfloat x, y;\n\t\tint i, j;\n\t\t\n\t\tfor(x=xMin; x<=xMax; x++) {\n\t\t\ty = parent.getY(x);\n\t\t\t\n\t\t\tif(y>yMin && y<yMax) {\n\t\t\t\ti = convertX(x);\n\t\t\t\tj = convertY(y);\n\t\t\t\t\n\t\t\t\t//Utilisation d'un carre/losange pour simuler un point \n\t\t\t\t//de taille superieur a un pixel car celui-ci est peu visible.\n\t\t\t\tpaintPointInColor(i-2, j);\n\t\t\t\tpaintPointInColor(i-1, j-1);\t\t\t\t\n\t\t\t\tpaintPointInColor(i-1, j);\n\t\t\t\tpaintPointInColor(i-1, j+1);\n\t\t\t\tpaintPointInColor(i, j-2);\t//\t *\n\t\t\t\tpaintPointInColor(i, j-1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j);\t//\t* * * * *\n\t\t\t\tpaintPointInColor(i, j+1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j+2);\t//\t *\n\t\t\t\tpaintPointInColor(i+1, j-1);\n\t\t\t\tpaintPointInColor(i+1, j);\n\t\t\t\tpaintPointInColor(i+1, j+1);\n\t\t\t\tpaintPointInColor(i+2, j);\n\t\t\t}\n\t\t}\t\t\n\t}",
"public Polygon()\n {\n points = new ArrayList<PointF>();\n }",
"public void afficherPoints(){\n for(Point point : pointArrayList){\n getMapPane().getChildren().add(point.getImageView());\n visualObjects.add(point);\n }\n }",
"public Iterable<Point2D> range(RectHV rect) \n\t {\n\t\t if(rect==null)\n\t\t\t throw new java.lang.NullPointerException();\n\t\t LinkedQueue<Point2D> insidePoints = new LinkedQueue<Point2D>();\n\t\t range(root,rect.xmin(),rect.ymin(),rect.xmax(),rect.ymax(),insidePoints,true);\n\t\t return insidePoints;\n\t }",
"Point createPoint();",
"public Rectangle(Point upperLeft, double width, double height) {\n this.upperLeft = upperLeft;\n this.width = width;\n this.height = height;\n }",
"public Rectangle(Point center, int length){\n super(4);\n if(length <= 0)\n throw new IllegalArgumentException(\"Length cannot be negative or zero.\");\n width = length; \n height = length; \n int centerX = center.getX(); //stores the x of the center point\n int centerY = center.getY(); //stores the y of the center point\n int distanceFromCenter = length / 2; //stores the distance from the center point each line will be\n topLine = new Line(centerX - distanceFromCenter, centerY - distanceFromCenter, centerX + distanceFromCenter, centerY - distanceFromCenter);\n rightLine = new Line(centerX + distanceFromCenter, centerY - distanceFromCenter, centerX + distanceFromCenter, centerY + distanceFromCenter);\n bottomLine = new Line(centerX + distanceFromCenter, centerY + distanceFromCenter, centerX - distanceFromCenter, centerY + distanceFromCenter);\n leftLine = new Line(centerX - distanceFromCenter, centerY + distanceFromCenter, centerX - distanceFromCenter, centerY - distanceFromCenter);\n referencePoint = topLine.getFirstPoint();\n }",
"public void computeBoundingBox() {\n\taveragePosition = new Point3(center);\n tMat.rightMultiply(averagePosition);\n \n minBound = new Point3(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);\n maxBound = new Point3(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);\n // Initialize\n Point3[] v = new Point3[8];\n for (int i = 0; i < 8; i++)\n \tv[i] = new Point3(center);\n // Vertices of the box\n v[0].add(new Vector3(-radius, -radius, -height/2.0));\n v[1].add(new Vector3(-radius, radius, -height/2.0));\n v[2].add(new Vector3(radius, -radius, -height/2.0));\n v[3].add(new Vector3(radius, radius, -height/2.0));\n v[4].add(new Vector3(-radius, -radius, height/2.0));\n v[5].add(new Vector3(-radius, radius, height/2.0));\n v[6].add(new Vector3(radius, -radius, height/2.0));\n v[7].add(new Vector3(radius, radius, height/2.0));\n // Update minBound and maxBound\n for (int i = 0; i < 8; i++)\n {\n \ttMat.rightMultiply(v[i]);\n \tif (v[i].x < minBound.x)\n \t\tminBound.x = v[i].x;\n \tif (v[i].x > maxBound.x)\n \t\tmaxBound.x = v[i].x;\n \tif (v[i].y < minBound.y)\n \t\tminBound.y = v[i].y;\n \tif (v[i].y > maxBound.y)\n \t\tmaxBound.y = v[i].y;\n \tif (v[i].z < minBound.z)\n \t\tminBound.z = v[i].z;\n \tif (v[i].z > maxBound.z)\n \t\tmaxBound.z = v[i].z;\n }\n \n }",
"private void definePoints(){\n defineLinePoints(x1, y1, x2, y2);\n defineLinePoints(x1,y1, x3, y3);\n defineLinePoints(x2,y2, x3, y3);\n }",
"public RMRect convertedRectToShape(RMRect aRect, RMShape aShape)\n{\n return convertRectToShape(new RMRect(aRect), aShape);\n}",
"PVector[] _getPoints() {\n PVector cen = _getCenter();\n \n PVector[] points = new PVector[_hitbox.length];\n float angle = _rotVector.heading();\n for(int i = 0; i < _hitbox.length; i++) {\n points[i] = new PVector(_hitbox[i].x, _hitbox[i].y);\n points[i].rotate(angle);\n points[i].x += cen.x;\n points[i].y += cen.y;\n }\n return points;\n }",
"public void setBounds(Rectangle2D aRect)\n{\n setBounds(aRect.getX(), aRect.getY(), aRect.getWidth(), aRect.getHeight());\n}",
"public void drawPolygon (int xC, int yC, int xP, int yP,int ribs, Graphics g){\r\n \r\n \tint n = ribs; \r\n \t//delta keep the the original delta , this size of delta will increase in delta size each time.\r\n \tdouble delta = (2* Math.PI)/ n;\r\n \tdouble deltaTemp = delta;\r\n \t//List of Points that I keep during n rotation.\r\n \tList <Point> points; \r\n \tfloat x,y,newX,newY;\r\n \t//First Sliding\r\n \tx = xP - xC;\r\n \ty = yP - yC;\r\n \tnewX = x; \t\r\n \tnewY = y; \t\r\n \tList <Point> vertexs = new ArrayList();\r\n \t//Follow delta angle rotation n times and write a list of vertices to vertexs list.\r\n \tfor (int i = 0; i < n ; i++)\r\n \t{\r\n \t\tnewX = (int) ((x*Math.cos(delta) - y*Math.sin(delta)));\r\n \t\tnewY = (int) ((x*Math.sin(delta) + y*Math.cos(delta))); \r\n \t\tvertexs.add(new Point(Math.round(newX),Math.round(newY))); \t\r\n \t\tSystem.out.println(vertexs.get(i).x+\",\"+vertexs.get(i).y);\r\n \t\tdelta = delta + deltaTemp;\r\n \t}\r\n \t//Sliding back\r\n \tfor (int i = 0; i < vertexs.size(); i++ ){\r\n \t\tvertexs.get(i).x = (int) (vertexs.get(i).getX() + xC);\r\n \t\tvertexs.get(i).y = (int) (vertexs.get(i).getY() + yC);\r\n \t\tg.drawRect(vertexs.get(i).x, vertexs.get(i).y ,1,1);\r\n \t}\r\n \t//draw line between the list of the points we got.\r\n \tfor (int z = 0 ; z < vertexs.size(); z++){\r\n \t\tif (z == vertexs.size()-1)\r\n \t\t\tdrawLine((int) Math.round(vertexs.get(z).getX()), (int)(vertexs.get(z).getY()),(int)(vertexs.get(0).getX()), (int)(vertexs.get(0).getY()),g);\r\n \t\telse\r\n \t\t\tdrawLine((int)(vertexs.get(z).getX()), (int)(vertexs.get(z).getY()),(int)(vertexs.get(z+1).getX()), (int)(vertexs.get(z+1).getY()),g);\r\n\r\n \t\t}\r\n \t\r\n }",
"public abstract void constructHull();",
"public RMPoint convertedPointToShape(RMPoint aPoint, RMShape aShape)\n{\n return convertPointToShape(new RMPoint(aPoint), aShape);\n}",
"public void onBoundsResolved()\n {\n updateTransform();\n }",
"public CustomRectangle() { }",
"private static Vector2f transform(Rect2f srcRc, Rect2f dstRc, BaseVector2f pt) {\n\n // TODO: move this to a better place\n\n float x = (pt.getX() - srcRc.minX()) / srcRc.width();\n float y = (pt.getY() - srcRc.minY()) / srcRc.height();\n\n x = dstRc.minX() + x * dstRc.width();\n y = dstRc.minY() + y * dstRc.height();\n\n return new Vector2f(x, y);\n }",
"public PaintContext createContext(ColorModel paramColorModel, Rectangle paramRectangle, Rectangle2D paramRectangle2D, AffineTransform paramAffineTransform, RenderingHints paramRenderingHints) {\n/* 129 */ if (paramAffineTransform == null) {\n/* 130 */ paramAffineTransform = new AffineTransform();\n/* */ } else {\n/* 132 */ paramAffineTransform = (AffineTransform)paramAffineTransform.clone();\n/* */ } \n/* 134 */ paramAffineTransform.translate(this.tx, this.ty);\n/* 135 */ paramAffineTransform.scale(this.sx, this.sy);\n/* */ \n/* 137 */ return TexturePaintContext.getContext(this.bufImg, paramAffineTransform, paramRenderingHints, paramRectangle);\n/* */ }",
"@Test\n public void pipeDrawerValidPoints() {\n Point2D[] waypoints = {\n new Point2D(1, 1),\n new Point2D(1, 2),\n new Point2D(2, 2)\n };\n Pipe pipe = new Pipe(1f, 1, (byte) 1);\n\n new PipeDrawer(waypoints, pipe, 1);\n }",
"Punto(){\r\n x=0;\r\n y=0;\r\n }",
"public abstract void draw(PGraphics graphics, float maxX, float maxY);",
"public RMPoint convertedPointFromShape(RMPoint aPoint, RMShape aShape)\n{\n return convertPointFromShape(new RMPoint(aPoint), aShape);\n}",
"void dragPolygon() {\n\t\t// calculate the offsetP made by mouseDrag -- subtract beginOffsetP from\n\t\t// P\n\t\toffsetP = PVector.sub(P, beginOffsetP);\n\n\t\tfor (int i = 0; i < amount; i++)\n\t\t\tpoint[i].position = PVector.add(point[i].beginPosition, offsetP);\n\t}",
"@Override\r\n\tpublic void transformComponent(AffineTransform transform, Set<JVGShape> locked) {\n\t}",
"public static native GPolyline create(JavaScriptObject points)/*-{\r\n\t\treturn new $wnd.GPolyline(points);\r\n\t}-*/;",
"private void updateBoundary() {\n //pos = _newPos ;\n heading = myRoute.getCurrentHeading() ;\n //System.out.println(\"heading=\"+heading);\n Point vertex = new Point(0,0) ;\n vertex.x = length/2 ;\n vertex.y = width/2 ;\n boundary[0] = transform(vertex) ;\n \n vertex.x = -length/2 ;\n vertex.y = width/2 ;\n boundary[1] = transform(vertex) ;\n \n vertex.x = -length/2 ;\n vertex.y = -width/2 ;\n boundary[2] = transform(vertex) ;\n \n vertex.x = length/2 ;\n vertex.y = -width/2 ;\n boundary[3] = transform(vertex) ;\n for (int i=0; i<4; i++) {\n xpoints[i] = boundary[i].x ;\n ypoints[i] = boundary[i].y ;\n }\n }",
"public void startDragging(Rectangle selectionBox) {\n\t\tVector position = getPosition(selectionBox);\n\t\t\n\t\ttransform.setFromPoint(position);\n\t\ttransform.setToPoint(position);\n\t\ttransform.setAnchorPoint(getAnchorPoint(selectionBox));\n\t}",
"private void drawT(int[] xPoints,int[] yPoints,boolean condition){\r\n if(condition)\r\n g.setColor(Color.red); \r\n else\r\n g.setColor(Color.gray); \r\n g.fillPolygon(xPoints,yPoints,3);\r\n g.setColor(Color.black);\r\n g.drawPolygon(xPoints,yPoints,3); \r\n }",
"void storeObject(RectangleLatLng rectangle, String id);",
"@Override\r\n public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {\n GL2 gl = drawable.getGL().getGL2();\r\n\r\n //evita a divisão por zero\r\n if (height == 0) {\r\n height = 1;\r\n }\r\n //calcula a proporção da janela (aspect ratio) da nova janela\r\n float aspect = (float) width / height;\r\n\r\n //seta o viewport para abranger a janela inteira\r\n gl.glViewport(0, 0, width, height);\r\n\r\n //ativa a matriz de projeção\r\n gl.glMatrixMode(GL2.GL_PROJECTION);\r\n gl.glLoadIdentity(); //lê a matriz identidade\r\n\r\n //Projeção ortogonal\r\n //true: aspect >= 1 configura a altura de -1 para 1 : com largura maior\r\n //false: aspect < 1 configura a largura de -1 para 1 : com altura maior\r\n if (width >= height) {\r\n gl.glOrtho(xMin * aspect, xMax * aspect, yMin, yMax, zMin, zMax);\r\n } else {\r\n gl.glOrtho(xMin, xMax, yMin / aspect, yMax / aspect, zMin, zMax);\r\n }\r\n\r\n //ativa a matriz de modelagem\r\n gl.glMatrixMode(GL2.GL_MODELVIEW);\r\n gl.glLoadIdentity(); //lê a matriz identidade\r\n System.out.println(\"Reshape: \" + width + \", \" + height);\r\n }",
"public Iterable<Point2D> range(RectHV rect) {\n\n if (rect == null)\n throw new IllegalArgumentException(\"Got null object in range()\");\n \n Queue<Point2D> pointsInside = new Queue<>();\n \n for (Point2D p : point2DSET) {\n \n double x = p.x();\n double y = p.y();\n if (x >= rect.xmin() && x <= rect.xmax() &&\n y >= rect.ymin() && y <= rect.ymax())\n pointsInside.enqueue(p);\n \n }\n \n return pointsInside;\n }",
"public Piste(int x, int y, int ala_x, int ala_y, int yla_x, int yla_y){\n\t\tthis.x=x;\n\t\tthis.y=y;\n\t\tthis.minX=ala_x;\n\t\tthis.minY=ala_y;\n\t\tthis.maxX=yla_x;\n\t\tthis.maxY=yla_y;\n\t}",
"Viewpoint createViewpoint();",
"public CustomRectangle(int x1, int y1, int x2, int y2) {\n this.x1 = Integer.toString(x1);\n this.y1 = Integer.toString(y1);\n this.x2 = Integer.toString(x2);\n this.y2 = Integer.toString(y2);\n }",
"@Test\n public void testReproject() throws FactoryException, TransformException{\n\n final GeometryFactory GF = org.geotoolkit.geometry.jts.JTS.getFactory();\n\n final LinearRing ring = GF.createLinearRing(new Coordinate[]{\n new Coordinate(29.5314900850289,67.6621244561062),\n new Coordinate(29.5314900850289,80.8837216369139),\n new Coordinate(42.7530872658366,80.8837216369139),\n new Coordinate(42.7530872658366,67.6621244561062),\n new Coordinate(29.5314900850289,67.6621244561062)\n });\n final Polygon poly = GF.createPolygon(ring, new LinearRing[0]);\n\n final CoordinateReferenceSystem crs1 = CommonCRS.WGS84.normalizedGeographic();\n final CoordinateReferenceSystem crs2 = getLocalLambertCRS(10, 60);\n\n final MathTransform mt = CRS.findOperation(crs1,crs2, null).getMathTransform();\n final CoordinateSequenceTransformer cst = new CoordinateSequenceMathTransformer(mt);\n final GeometryCSTransformer trs = new GeometryCSTransformer(cst);\n\n trs.transform(poly);\n\n }",
"void buildRectangles(){\n background(255);\n for(int i=0;i<arr.length;i++){\n noStroke();\n Rect r=new Rect(40+i*80,400,75,-arr[i]*20,color1);\n createRectangle(r,color1);\n }\n }",
"public Iterable<Point2D> range(RectHV rect) {\n checkNull(rect);\n LinkedList<Point2D> pointList = new LinkedList<Point2D>();\n\n range(rect, root, pointList);\n\n return pointList;\n }",
"public abstract List<Point2D> getInterpolatedPoints();",
"void render(Rectangle borders);",
"public RMRect convertedRectFromShape(RMRect aRect, RMShape aShape)\n{\n return convertRectFromShape(new RMRect(aRect), aShape);\n}",
"private void generatePrism() {\n\t\tdouble halfAltitude = Math.sin(Math.PI / 3); // The cross-section is an equilateral triangle with sides of length 2 units. The altitude is the height of the triangle with one edge horizontal\n\t\tverts = new Vector[] {new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3)};\n\t\tverts[0].setElements(new double[] {-1, -halfAltitude, -1});\n\t\tverts[1].setElements(new double[] {0, halfAltitude, -1});\n\t\tverts[2].setElements(new double[] {1, -halfAltitude, -1});\n\t\t// Use the same triangle of vertices but offset by 2 units along the z-axis\n\t\tverts[3].setElements(verts[0]);\n\t\tverts[4].setElements(verts[1]);\n\t\tverts[5].setElements(verts[2]);\n\t\tverts[3].setElement(2, 1);\n\t\tverts[4].setElement(2, 1);\n\t\tverts[5].setElement(2, 1);\n\t\t\n\t\tfaces = new int[][] {{0, 1, 2}, {0, 5, 3}, {0, 2, 5}, {0, 3, 4}, {0, 4, 1}, {1, 4, 5}, {1, 5, 2}, {3, 5, 4}};\n\t}",
"private Point transform(Point pt1) {\n Point pt2 = new Point(0,0) ;\n pt2.x = pos.x + new Double(pt1.x*Math.cos(heading)+pt1.y*Math.sin(heading)).intValue() ;\n pt2.y = pos.y + new Double(-pt1.x*Math.sin(heading)+pt1.y*Math.cos(heading)).intValue() ;\n return pt2 ;\n }",
"public void draw(){\n\t\t int startRX = 100;\r\n\t\t int startRY = 100;\r\n\t\t int widthR = 300;\r\n\t\t int hightR = 300;\r\n\t\t \r\n\t\t \r\n\t\t // start points on Rectangle, from the startRX and startRY\r\n\t\t int x1 = 0;\r\n\t\t int y1 = 100;\r\n\t\t int x2 = 200;\r\n\t\t int y2 = hightR;\r\n\t\t \r\n //direction L - false or R - true\r\n\t\t \r\n\t\t boolean direction = true;\r\n\t\t \t\r\n\t\t\r\n\t\t //size of shape\r\n\t\t int dotD = 15;\r\n\t\t //distance between shapes\r\n\t int distance = 30;\r\n\t\t \r\n\t rect(startRX, startRY, widthR, hightR);\r\n\t \r\n\t drawStripesInRectangle ( startRX, startRY, widthR, hightR,\r\n\t \t\t x1, y1, x2, y2, dotD, distance, direction) ;\r\n\t\t \r\n\t\t super.draw();\r\n\t\t}",
"public Pencil(double x, double y, double width, double height)\n {\n\n\t//outline of the pencil\n GeneralPath body = new GeneralPath();\n\t\n body.moveTo(200,400);\n body.lineTo(150,350);\n\tbody.lineTo(200,300);\n\tbody.lineTo(600,300);\n\tbody.lineTo(600,400);\n\tbody.lineTo(200,400);\n\tbody.closePath();\n\n\t//vertical line that outlines the lead tip of the pencil\n\tGeneralPath leadLine = new GeneralPath();\n\n\tleadLine.moveTo(162, 362);\n\tleadLine.lineTo(162, 338);\n\n\t//vertical line that separates the tip of the pencil from the rest of the body\n\tGeneralPath tipLine = new GeneralPath();\n\ttipLine.moveTo(200, 400);\n\ttipLine.lineTo(200, 300);\n\t\n\t//vertical line that outlines the eraser\n\tShape eraser = ShapeTransforms.translatedCopyOf(tipLine, 350, 0.0);\n \n // now we put the whole thing together ino a single path.\n GeneralPath wholePencil = new GeneralPath ();\n wholePencil.append(body, false);\n\twholePencil.append(leadLine, false);\n wholePencil.append(tipLine, false);\n\twholePencil.append(eraser, false);\n \n // translate to the origin by subtracting the original upper left x and y\n // then translate to (x,y) by adding x and y\n \n Shape s = ShapeTransforms.translatedCopyOf(wholePencil, -ORIG_ULX + x, -ORIG_ULY + y);\n \n\t// scale to correct height and width\n s = ShapeTransforms.scaledCopyOf(s,\n\t\t\t\t\t width/ORIG_WIDTH,\n\t\t\t\t\t height/ORIG_HEIGHT) ;\n\t \n\t// Use the GeneralPath constructor that takes a shape and returns\n\t// it as a general path to set our instance variable cup\n \n\tthis.set(new GeneralPath(s));\n \n }",
"public Vector2D toRect()\n {\n return new Vector2D(this.x * Math.cos(this.y), this.x * Math.sin(this.y));\n }",
"public PointSetOverlay createPointSetOverlay();",
"private void updatePointsPosition() {\n\t\tfor (DataFromPointInfo dataFromPointInfo : fromPoints) {\n\t\t\tDataFromPoint fromPoint = dataFromPointInfo.fromPoint;\n\t\t\tfromPoint.setX((int) (getX() + this.getBounds().getWidth()\n\t\t\t\t\t+ HORIZONTAL_OFFSET));\n\t\t\tfromPoint.setY((int) (getY() + this.getRowHeight() / 2\n\t\t\t\t\t+ this.getRowHeight() * dataFromPointInfo.yShift));\n\t\t}\n\t\tfor (DataToPointInfo dataToPointInfo : toPoints) {\n\t\t\tDataToPoint toPoint = dataToPointInfo.toPoint;\n\t\t\ttoPoint.setX((int) (getX() - HORIZONTAL_OFFSET));\n\t\t\ttoPoint.setY((int) (getY() + this.getRowHeight() / 2\n\t\t\t\t\t+ this.getRowHeight() * dataToPointInfo.yShift));\n\t\t}\n\t}",
"private Geometry rectangleToGeometry(Rectangle2D r) {\n return createRectangle(r.getMinX(), r.getMinY(), r.getWidth(),\n r.getHeight());\n }",
"public Shape(RectF bounds)\n {\n this.zIndex = 0;\n this.bounds = GeometryUtils.copy(bounds);\n this.visible = true;\n this.color = Color.white;\n this.positionAnchor = new PointF(0, 0);\n }",
"public void setTransform(float a11, float a12, float a21, float a22, float x, float y);",
"public void draw(Rectangle selectionBox, Transformation t) {\n\t\tif (t != null)\n\t\t\tdraw((Vector) getDrawPosition(selectionBox).getTransformed(t));\n\t\telse\n\t\t\tdraw(getDrawPosition(selectionBox));\n\t}",
"@Test public void setAllPoints()\n\t{\n\n\t\t{\n\t\t\tPolygon p = new Polygon(new Vector2f(0, 0),\n\t\t\t\t\t\tnew Vector2f(1, 1));\n\n\t\t\tp.setFirstPositionAndShiftAll(3, 3);\n\n\t\t\tVector2fTest.assertVectorsAreEqual(p.pts()[0], 3, 3);\n\t\t\tVector2fTest.assertVectorsAreEqual(p.pts()[1], 4, 4);\n\t\t}\n\n\t\t{\n\t\t\tPolygon p = new Polygon(new Vector2f(4, 4),\n\t\t\t\t\t\tnew Vector2f(1, 1));\n\n\t\t\tp.setFirstPositionAndShiftAll(3, 3);\n\n\t\t\tVector2fTest.assertVectorsAreEqual(p.pts()[0], 3, 3);\n\t\t\tVector2fTest.assertVectorsAreEqual(p.pts()[1], 0, 0);\n\t\t}\n\n\t\t{\n\t\t\tPolygon p = new Polygon(new Vector2f(-4, -4),\n\t\t\t\t\t\tnew Vector2f(1, 1));\n\n\t\t\tp.setFirstPositionAndShiftAll(3, 3);\n\n\t\t\tVector2fTest.assertVectorsAreEqual(p.pts()[0], 3, 3);\n\t\t\tVector2fTest.assertVectorsAreEqual(p.pts()[1], 8, 8);\n\t\t}\n\t}",
"public List<Point> generatePointList(){\r\n\t\t//Can move up to 3 squares horizontally or vertically, but cannot move diagonally.\r\n List<Point> pointList = new ArrayList<>();\r\n int pointCount = 0;\r\n int px = (int)getCoordinate().getX();\r\n int py = (int)getCoordinate().getY();\r\n\r\n for (int i=px-3;i<=px+3;i++){\r\n for(int j=py-3;j<=py+3;j++){\r\n if((i>=0) && (i<9) && (j>=0) && (j<9) && ((i!=px)||(j!=py))){\r\n if ((i==px)||(j==py)){\r\n pointList.add(pointCount, new Point(i,j));\r\n pointCount+=1;\r\n } \r\n }\r\n }\r\n }\r\n return pointList;\r\n }",
"void setBounds(Rectangle rectangle);",
"void pointScaleFree() {\n\t\t// offsetP = PVector.sub(P, beginOffsetP); // get the offset (because\n\t\t// mouse isnt' exatly at the pressed point, there a little offset)\n\t\toffset = PVector.sub(P, beginOffset); // calculate the offset made by\n\t\t\t\t\t\t\t\t\t\t\t\t// mouseDrag -- subtract\n\t\t\t\t\t\t\t\t\t\t\t\t// beginOffset from P\n\t\toffsetP = PVector.add(beginOffsetP, offset); // reposition point A based\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the offset made\n\n\t\tleftOppositeLine.detectX(offsetP); // update X (dot product magic)\n\t\t\t\t\t\t\t\t\t\t\t// constantly\n\t\trightOppositeLine.detectX(offsetP); // update X (dot product magic)\n\t\t\t\t\t\t\t\t\t\t\t// constantly\n\n\t\tfloat scaleFactorRight, scaleFactorLeft;\n\t\tscaleFactorRight = rightOppositeLine.X.dist(offsetP) / rightOppositeLine.beginX.dist(beginOffsetP);\n\t\tscaleFactorLeft = leftOppositeLine.X.dist(offsetP) / leftOppositeLine.beginX.dist(beginOffsetP);\n\n\t\t// needs exaplainin drawing\n\t\tPVector tmpR = new PVector();\n\t\tPVector tmpL = new PVector();\n\n\t\tif (rightOppositeLine.isOnThisSideOfLine == rightOppositeLine.checkLineSide(offsetP)) {\n\t\t\tif (leftOppositeLine.isOnThisSideOfLine == leftOppositeLine.checkLineSide(offsetP)) {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginStart, rightOppositeLine.beginEnd);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginStart, leftOppositeLine.beginEnd);\n\t\t\t} else {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginEnd, rightOppositeLine.beginStart);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginStart, leftOppositeLine.beginEnd);\n\t\t\t}\n\t\t} else {\n\t\t\tif (leftOppositeLine.isOnThisSideOfLine == leftOppositeLine.checkLineSide(offsetP)) {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginStart, rightOppositeLine.beginEnd);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginEnd, leftOppositeLine.beginStart);\n\t\t\t} else {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginEnd, rightOppositeLine.beginStart);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginEnd, leftOppositeLine.beginStart);\n\t\t\t}\n\t\t}\n\n\t\t// needs exaplainin drawing\n\n\t\ttmpL.mult(scaleFactorRight);\n\t\ttmpL.add(leftOppositeLine.end);\n\n\t\ttmpR.mult(scaleFactorLeft);\n\t\ttmpR.add(rightOppositeLine.end);\n\n\t\t// set left neigbor point\n\t\tpoint[neighbor(selectedPoint)[0]].position.set(tmpL);\n\n\t\t// set right neighbor point\n\t\tpoint[neighbor(selectedPoint)[1]].position.set(tmpR);\n\t\tpoint[selectedPoint].position.set(offsetP);\n\t\tselectedLine = -1; // disable line focus\n\t\tupdateGlobalLines();\n\t}",
"private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }",
"void setupPointScaleFree() {\n\t\tbeginOffsetP.set(P);\n\n\t\tleftOppositeLine = neighborOppositeLinesFromPoint(selectedPoint)[0];\n\t\trightOppositeLine = neighborOppositeLinesFromPoint(selectedPoint)[1];\n\t\tleftOppositeLine.resetLockPoints(P);\n\t\trightOppositeLine.resetLockPoints(P);\n\t\tbeginP.set(P);\n\t\tbeginOffsetP.set(P);\n\n\t\tbeginOffset.set(P); // lock the beginning position of the\n\t\t\t\t\t\t\t// offset vector\n\t\tbeginOffsetP.set(point[selectedPoint].position); // lock the beginning\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of the vector to\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// be transformed\n\n\t\tleftOppositeLine.isOnThisSideOfLine = leftOppositeLine.checkLineSide(P); // check\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// on\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// which\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// side\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// mirror\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// we\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// are\n\t\trightOppositeLine.isOnThisSideOfLine = rightOppositeLine.checkLineSide(P);\n\t}"
] | [
"0.63904124",
"0.58125234",
"0.57964903",
"0.5588739",
"0.5407223",
"0.5330032",
"0.52736825",
"0.52316463",
"0.5224817",
"0.5217516",
"0.51677525",
"0.5167019",
"0.5086784",
"0.5086419",
"0.5062496",
"0.5046911",
"0.503505",
"0.50321066",
"0.50297856",
"0.5025725",
"0.50195074",
"0.5010845",
"0.49827012",
"0.49798107",
"0.49733174",
"0.49730274",
"0.49695984",
"0.49663842",
"0.4939916",
"0.49390796",
"0.49369195",
"0.4927576",
"0.49183184",
"0.49169353",
"0.49082816",
"0.48970246",
"0.4893971",
"0.48879272",
"0.48818526",
"0.48751807",
"0.48639482",
"0.48564935",
"0.48489058",
"0.48435006",
"0.48347747",
"0.48326847",
"0.48252833",
"0.4825088",
"0.4822272",
"0.4817366",
"0.48138788",
"0.48131135",
"0.481301",
"0.4809237",
"0.48064837",
"0.4805205",
"0.48018083",
"0.47976613",
"0.4795645",
"0.47885007",
"0.47800937",
"0.47796878",
"0.47768858",
"0.47700843",
"0.47699386",
"0.4751664",
"0.47468054",
"0.47466922",
"0.47448877",
"0.474096",
"0.47408104",
"0.47280166",
"0.47274685",
"0.47259653",
"0.47090006",
"0.4708488",
"0.47063208",
"0.47048834",
"0.47042534",
"0.46982685",
"0.46941844",
"0.46892494",
"0.46823308",
"0.46820894",
"0.4680421",
"0.46790415",
"0.46762022",
"0.46756276",
"0.4670354",
"0.46670863",
"0.46652776",
"0.4661299",
"0.46491468",
"0.46455774",
"0.46428466",
"0.4640259",
"0.46360213",
"0.46335042",
"0.4631799",
"0.46266958"
] | 0.690181 | 0 |
In this method, we rotate the all the transformation points but the rotation one by "angle" degrees, around the GraphicObject's center. This is needed to implement scalling when the object is rotated | private void rotateTransformPoints(double angle) {
int i;
for(i=1; i<9;i++) {
GeoVector vec = new GeoVector(this.transformPointers[i].getX(), this.transformPointers[i].getY(), this.aux_obj.getCenterX(), this.aux_obj.getCenterY());
vec.rotate(((angle*-1.0) * (2.0*Math.PI))/360);
vec.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());
this.transformPointers[i].translate( (int)(vec.getX() - this.transformPointers[i].getX()), (int)(vec.getY() - this.transformPointers[i].getY()));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void transformObject(int x, int y) {\n double sx, sy, l, r, nx, ny, tx, ty, alpha, origCX = 0, origCY = 0;\n Rectangle bnds;\n\n if(curr_obj == transformPointers[Action.ROTATE]) {\n /* the mouse vector 1 */\n GeoVector mouseVector = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n /* the rotation vector. i.e. the fixed vector that will be used as origin composed by the subtraction of the object center with the rotation point */\n GeoVector rotationVector = new GeoVector(this.lastPosition[0], this.lastPosition[1], this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseVector.normalize();\n rotationVector.normalize();\n\n alpha = mouseVector.getAngleWith(rotationVector.getX(), rotationVector.getY());\n\n /** After passing the 180 degrees, the atan2 function returns a negative angle from 0 to PI. So this will convert the final gobal angle to 0-2PI */\n if(alpha < 0 ) {\n alpha = (2 * Math.PI) + alpha; \n }\n\n alpha -= this.currRotation;\n this.currRotation += alpha;\n\n Point c = new Point(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.aux_obj.uRotate((float)(-1.0*(alpha*(180/Math.PI))), c);\n \n } else {\n alpha = this.aux_obj.getRotation();\n\n /** Here we rotate the selected Graphic Object, it's tranformation points and the mouse coordinates back to the zero angle, to permit a correct object scalling. */\n if(alpha != 0.0) {\n origCX = this.aux_obj.getCenterX();\n origCY = this.aux_obj.getCenterY();\n this.aux_obj.uRotate((float)(alpha*-1.0), this.aux_obj.getCenter());\n rotateTransformPoints(alpha);\n GeoVector mouseCoord = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseCoord.rotate( ((alpha*-1.0) * (2.0*Math.PI))/360 );\n mouseCoord.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n x = (int)mouseCoord.getX();\n y = (int)mouseCoord.getY();\n\n }\n\n /** Tatami rotates the object from it's x and y point to the edges. So this means that sometimes we need to translate the object a few pixels to asure that it's upper left corner is on the same position. */\n if(curr_obj == transformPointers[Action.NORTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)-tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.NORTH]) {\n if(y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate(0, (int)-ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTH];\n }\n } else if(curr_obj == transformPointers[Action.NORTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHEAST];\n }\n\n } else if(curr_obj == transformPointers[Action.WEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n aux_obj.uTranslate((int)-tx, 0);\n aux_obj.scale( (float)sx, 1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.WEST];\n }\n } else if(curr_obj == transformPointers[Action.EAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n aux_obj.uTranslate((int)tx, 0);\n aux_obj.scale( (float)sx, (float)1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.EAST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)-tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTH]) {\n if(y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate(0, (int)ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTH];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHEAST];\n }\n }\n\n\n }\n \n }",
"@Override\n public void rotate(double angle) {\n graphicsEnvironmentImpl.rotate(canvas, angle);\n }",
"@Override\n\tfinal public void rotate(double angle, Axis axis)\n\t{\n\t\t//center.setDirection(angle);\n\t}",
"void rotatePolygon() {\n\t\tfor (int i = 0; i < amount; i++)\n\t\t\tpoint[i].rotate();\n\t}",
"public void setRotate() {\r\n\t\tint npoints = xpoints.length;\r\n\t\tdouble[] tempxpoints = new double[xpoints.length];\r\n\t\tdouble[] tempypoints = new double[xpoints.length];\r\n\t\tdouble radians = Math.toRadians(angle%360);\r\n\t\tdouble y = pivotY;\r\n\t\tdouble x = pivotX;\r\n\t\tfor(int i = 0; i<xpoints.length; i++) {\r\n\t\t\ttempxpoints[i] = (Math.cos(radians)*(xpoints[i]-x)-Math.sin(radians)*(ypoints[i]-y)+x);\r\n\t\t\ttempypoints[i] = (Math.sin(radians)*(xpoints[i]-x)+Math.cos(radians)*(ypoints[i]-y)+y);\r\n\t\t}\r\n\t\txpoints = tempxpoints;\r\n\t\typoints = tempypoints;\r\n\t\tangle = 0;\r\n\t}",
"public void rotate(){\n\t\t\n\t\tfor(Vertex v : vertices){\n\n\t\t\tMatrix m = ViewSettings.getRotationMatrix4().multiply(v);\n\n\t\t\tv.setX(m.getValue(0, 0));\n\t\t\tv.setY(m.getValue(1, 0));\n\t\t\tv.setZ(m.getValue(2, 0));\n\t\t\tv.setW(m.getValue(3, 0));\n\t\t}\n\t}",
"public void rotate(double angle) {\t\t\n\t\t// precompute values\n\t\tVector t = new Vector(this.a14, this.a24, this.a34);\n\t\tif (t.length() > 0) t = t.norm();\n\t\t\n\t\tdouble x = t.x();\n\t\tdouble y = t.y();\n\t\tdouble z = t.z();\n\t\t\n\t\tdouble s = Math.sin(angle);\n\t\tdouble c = Math.cos(angle);\n\t\tdouble d = 1 - c;\n\t\t\n\t\t// precompute to avoid double computations\n\t\tdouble dxy = d*x*y;\n\t\tdouble dxz = d*x*z;\n\t\tdouble dyz = d*y*z;\n\t\tdouble xs = x*s;\n\t\tdouble ys = y*s;\n\t\tdouble zs = z*s;\n\t\t\n\t\t// update matrix\n\t\ta11 = d*x*x+c; a12 = dxy-zs; a13 = dxz+ys;\n\t\ta21 = dxy+zs; a22 = d*y*y+c; a23 = dyz-xs;\n\t\ta31 = dxz-ys; a32 = dyz+xs; a33 = d*z*z+c;\n\t}",
"public void setRotation(double angle)\n\t{\n\t\tdouble cos = Math.cos(angle);\n\t\tdouble sin = Math.sin(angle);\n\t\tmatrix[0].x=cos;\n\t\tmatrix[0].y=sin;\n\t\tmatrix[1].x=-sin;\n\t\tmatrix[1].y=cos;\n\t}",
"private void rotate(final MouseEvent event) {\r\n\r\n\t\t// reset transform3D\r\n\t\tthis.rotation.rotY(0);\r\n\r\n\t\t// rotate around y-axis\r\n\t\tif (super.x_last - event.getPoint().x > 0) {\r\n\t\t\t// rotate leftwards\r\n\t\t\tthis.rotation.rotY(this.angle);\r\n\t\t} else {\r\n\t\t\t// rotate rightwards\r\n\t\t\tthis.rotation.rotY(-this.angle);\r\n\t\t}\r\n\r\n\t\t// apply rotation\r\n\t\tsuper.transformGroup.getTransform(this.transform);\r\n\t\tthis.transform.mul(this.rotation);\r\n\t\tsuper.transformGroup.setTransform(this.transform);\r\n\t}",
"public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }",
"void setupPolygonRotate() {\n\t\trotationLockedToMouse = true;\n\t\t// polygonLockedToMouse = true;\n\t\tlockAnchor.set(anchor);\n\t\tfor (int i = 0; i < amount; i++)\n\t\t\tpoint[i].startRotating();\n\t}",
"Point rotate (double angle);",
"public void rotate(float angle);",
"public void calculateRotation() {\r\n float x = this.getX();\r\n float y = this.getY();\r\n\r\n float mouseX = ((float) Mouse.getX() - 960) / (400.0f / 26.0f);\r\n float mouseY = ((float) Mouse.getY() - 540) / (400.0f / 23.0f);\r\n\r\n float b = mouseX - x;\r\n float a = mouseY - y;\r\n\r\n rotationZ = (float) Math.toDegrees(Math.atan2(a, b)) + 90;\r\n\r\n forwardX = (float) Math.sin(Math.toRadians(rotationZ));\r\n forwardY = (float) -Math.cos(Math.toRadians(rotationZ));\r\n }",
"public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}",
"private static void rotate(GraphicsContext gc, double angle, double px, double py) {\n Rotate r = new Rotate(angle, px, py);\n gc.setTransform(r.getMxx(), r.getMyx(), r.getMxy(), r.getMyy(), r.getTx(), r.getTy());\n }",
"public void rotate(Point P, int rotation) {\n\n\n }",
"public void rotation(){\n\n double x=Double.parseDouble(rotationx.getText());\n double y=Double.parseDouble(rotationy.getText());\n double z=Double.parseDouble(rotationz.getText());\n if (checkbox.isSelected()){\n cls_zahnrad.rotieren(x,y,z);\n return;\n }\n Triangle[] dreiecke = t1.getFlaechen();\n x=2*Math.PI/360*x;\n y=2*Math.PI/360*y;\n z=2*Math.PI/360*z;\n double[] A,B,C;\n\n double pktx=0,pkty=0,pktz=0;\n\n if (radio12.isSelected()){\n pktx = Double.parseDouble(rotationpktx.getText());\n pkty = Double.parseDouble(rotationpkty.getText());\n pktz = Double.parseDouble(rotationpktz.getText());\n }\n\n for (Triangle i :dreiecke){\n for (int j=0; j<3;j++){\n double xtemp,ytemp,ztemp;\n xtemp=i.getTriangle()[j].getPoint()[0]-pktx;\n ytemp=i.getTriangle()[j].getPoint()[1]-pkty;\n ztemp=i.getTriangle()[j].getPoint()[2]-pktz;\n i.getTriangle()[j].setPoint(xtemp,ytemp,ztemp);\n }\n }\n\n for (Triangle t1 : dreiecke){\n A=t1.getTriangle()[0].getPoint();\n B=t1.getTriangle()[1].getPoint();\n C=t1.getTriangle()[2].getPoint();\n double[][]punkte={A,B,C};\n\n for (int i=0; i<punkte.length; i++){\n double temp0,temp1,temp2;\n\n //Rotation um Parallele der X-Achse durch das Rotationszentrum\n if (x!=0){\n temp1=punkte[i][1]*Math.cos(x)-punkte[i][2]*Math.sin(x);\n temp2=punkte[i][1]*Math.sin(x)+punkte[i][2]*Math.cos(x);\n punkte[i][1]=temp1;\n punkte[i][2]=temp2;\n }\n\n //Rotation um Parallele der Y-Achse durch das Rotationszentrum\n if (y!=0){\n temp0=punkte[i][0]*Math.cos(y)+punkte[i][2]*Math.sin(y);\n temp2=-punkte[i][0]*Math.sin(y)+punkte[i][2]*Math.cos(y);\n punkte[i][0]=temp0;\n punkte[i][2]=temp2;\n }\n\n //Rotation um Parallele der Z-Achse durch das Rotationszentrum\n if (z!=0){\n temp0=punkte[i][0]*Math.cos(z)-punkte[i][1]*Math.sin(z);\n temp1=punkte[i][0]*Math.sin(z)+punkte[i][1]*Math.cos(z);\n punkte[i][0]=temp0;\n punkte[i][1]=temp1;\n }\n }\n A=punkte[0];\n B=punkte[1];\n C=punkte[2];\n t1.getTriangle()[0].setPoint(A[0],A[1],A[2]);\n t1.getTriangle()[1].setPoint(B[0],B[1],B[2]);\n t1.getTriangle()[2].setPoint(C[0],C[1],C[2]);\n }\n for (Triangle i :dreiecke){\n for (int j=0; j<3;j++){\n double xtemp,ytemp,ztemp;\n xtemp=i.getTriangle()[j].getPoint()[0]+pktx;\n ytemp=i.getTriangle()[j].getPoint()[1]+pkty;\n ztemp=i.getTriangle()[j].getPoint()[2]+pktz;\n i.getTriangle()[j].setPoint(xtemp,ytemp,ztemp);\n }\n }\n redraw();\n /*\n System.out.println(\"A \"+Arrays.toString(t1.getTetraeder()[0].getPoint()));\n System.out.println(\"B \"+Arrays.toString(t1.getTetraeder()[1].getPoint()));\n System.out.println(\"C \"+Arrays.toString(t1.getTetraeder()[2].getPoint()));\n System.out.println(\"D \"+Arrays.toString(t1.getTetraeder()[3].getPoint()));\n System.out.println(Arrays.toString(Mittelpunkt));\n */\n }",
"public void rotate(double deg) {\n deg = deg % 360;\n// System.out.println(\"Stopni:\" + deg);\n double e = 0;\n double f = 0;\n\n// for(int i = 0; i < pixels.length; i++) {\n// for(int j = 0; j < pixels[i].length; j++) {\n// e += pixels[i][j].getX();\n// f += pixels[i][j].getY();\n// }\n// }\n //e = e / (pixels.length * 2);\n //f = f / (pixels[0].length * 2);\n e = pixels.length / 2;\n f = pixels[0].length / 2;\n System.out.println(e);\n System.out.println(f);\n\n// System.out.println(e + \":\" + f);\n Matrix affineTransform;\n Matrix translateMinus = Matrix.translateRotate(-e, -f);\n Matrix translatePlus = Matrix.translateRotate(e, f);\n Matrix movedTransform = Matrix.multiply(translateMinus, Matrix.rotate(deg));\n //movedTransform.display();\n affineTransform = Matrix.multiply(movedTransform, translatePlus);\n //affineTransform.display();\n\n for(int i = 0; i < pixels.length; i++) {\n for(int j = 0; j < pixels[i].length; j++) {\n double[][] posMatrix1 = {{pixels[i][j].getX()}, {pixels[i][j].getY()}, {1}};\n Matrix m1 = new Matrix(posMatrix1);\n Matrix result1;\n result1 = Matrix.multiply(Matrix.transpose(affineTransform.v), m1);\n\n pixels[i][j].setX(Math.round(result1.v[0][0]));\n pixels[i][j].setY(Math.round(result1.v[1][0]));\n }\n }\n\n\n }",
"@Override\r\n\tpublic void rotate() {\n\t\t\r\n\t}",
"public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}",
"public void rotateSelection(double degrees) {\n RenderContext myrc = (RenderContext) rc; if (myrc == null) return;\n double radians = (2*Math.PI)/(360/degrees);\n Set<String> sel = myrc.filterEntities(getRTParent().getSelectedEntities());\n if (sel != null && sel.size() > 0) {\n Iterator<String> it = sel.iterator();\n\twhile (it.hasNext()) { \n\t String ent = it.next(); Point2D point = entity_to_wxy.get(ent);\n\t double px = point.getX(), py = point.getY();\n double dist = Math.sqrt((px - m_wx)*(px - m_wx) + (py - m_wy)*(py - m_wy));\n\t double angle = Utils.direction(px - m_wx, py - m_wy);\n double nx = m_wx + dist * Math.cos(angle + radians),\n\t ny = m_wy + dist * Math.sin(angle + radians);\n\t entity_to_wxy.put(ent, new Point2D.Double(nx,ny));\n\t transform(ent); \n\t}\n getRTComponent().render();\n }\n }",
"public final void rotX(float angle) {\n\tdouble c = Math.cos(angle);\n\tdouble s = Math.sin(angle);\n\tm00 = 1.0f; m01 = 0.0f; m02 = 0.0f;\n\tm10 = 0.0f; m11 = (float)c; m12 = (float)-s;\n\tm20 = 0.0f; m21 = (float)s; m22 = (float)c;\n }",
"public void rotate2D(Point3D center, double angle) {\n _x = _x - center.x();\n _y = _y - center.y();\n double a = Math.atan2(_y,_x);\n //\tSystem.out.println(\"Angle: \"+a);\n double radius = Math.sqrt((_x*_x) + (_y*_y));\n _x = (center.x() + radius * Math.cos(a+angle));\n _y = (center.y() + radius * Math.sin(a+angle));\n }",
"@Override\n \t\t\t\tpublic void doRotateX() {\n \n \t\t\t\t}",
"public void rotateBy(float angleDelta)\n {\n this.rotation += angleDelta;\n \n updateTransform();\n notifyParentOfPositionChange();\n conditionallyRepaint();\n }",
"public void setRotationAngle(float mAngle) {\n mPolygonShapeSpec.setRotation(mAngle);\n rebuildPolygon();\n invalidate();\n }",
"public void xRotate() {\n\t\t\n\t}",
"private void rotatePath(GeneralPath basePath, double angle)\n {\n AffineTransform af = new AffineTransform();\n af.rotate(angle);\n basePath.transform(af);\n }",
"@Override\n\tpublic void rotate() {\n\t}",
"public void displayRotated(float angleInDegrees) {\n pushMatrix();\n rotate(radians(angleInDegrees));\n shape(fullCar);\n popMatrix();\n }",
"private void rotateShape(double degree) {\n takeModuleOfShape(index);\n\n shiftMemento(index);\n draw.setMementos(mementos);\n\n mementos[mementoIndex - 1].setDegree(mementos[mementoIndex - 1].getDegree() + degree);\n\n shapes.get(shapes.size() - 1).draw(mementos[mementoIndex - 1].getRectangle(), mementos[mementoIndex - 1].getDegree());\n\n mementos = draw.getMementos();\n\n draw.revalidate();\n draw.repaint();\n gui.arrayPanel[1].repaintPanel();\n flagCopy = true;\n draw.setFlag(false);\n }",
"private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }",
"public void setRotation(double rotation)\r\n\t{\r\n\t\t// AutoCAD's angle of rotation is opposite to SVG so\r\n\t\t// we have to convert it.\r\n\t\t// AutoCAD's angles are in radians and turn in the opposite\r\n\t\t// direction to SVG's.\r\n\r\n\t\tRotation = svgUtility.trimDouble(-rotation % 360.0);\r\n\t}",
"public void rotateShip(){\n if (this.orientation == false){\n this.orientation = true;\n }else\n orientation = false;\n \n return;\n }",
"void rotate();",
"private void setupTransformationMatrix(ShapeRenderer renderer){\n\t\trenderer.identity();\n\t\trenderer.translate(cx, cy, 0);\n\t\trenderer.rotate(0, 0, 1, angle); \n\t\trenderer.translate(-cx, -cy, 0);\n\t}",
"@Override\r\n\tpublic void rotateAboutAxis(final double angle, final double p1x,\r\n\t\t\tfinal double p1y, final double p1z, final double p2x,\r\n\t\t\tfinal double p2y, final double p2z) {\r\n\r\n\t\tfinal WB_Transform raa = new WB_Transform();\r\n\t\traa.addRotateAboutAxis(angle, new WB_Point3d(p1x, p1y, p1z),\r\n\t\t\t\tnew WB_Normal3d(p2x - p1x, p2y - p1y, p2z - p1z));\r\n\t\traa.applySelf(this);\r\n\t}",
"public abstract Vector4fc rotateAbout(float angle, float x, float y, float z);",
"public void setRotation(float angle) {\n\t\tthis.rotate(this.rotation - angle);\n\t\trotation -= angle;\n\t}",
"public void rotate()\r\n\t{\r\n\t\tdouble degree = Math.PI/2;\r\n\t\tdouble sin = Math.sin(degree);\r\n\r\n\t\tAffineTransform tx = new AffineTransform();\r\n\t\ttx.rotate(degree, this.bufferedImage.getWidth() / (double)2, this.bufferedImage.getHeight() / (double)2);\r\n\t\tAffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);\r\n\r\n\t\tRectangle rect = op.getBounds2D(this.bufferedImage).getBounds();\r\n\t\ttx.translate(sin * rect.getX(), -sin * rect.getY());\r\n\t\top = new AffineTransformOp(tx,AffineTransformOp.TYPE_BILINEAR);\r\n\t\tthis.bufferedImage = op.filter(this.bufferedImage, op.createCompatibleDestImage(this.bufferedImage, null) );\r\n\r\n\r\n\t\tthis.setBounds( getX(), getY(), this.bufferedImage.getWidth(), this.bufferedImage.getHeight() );\r\n\t\tthis.width = this.bufferedImage.getWidth();\r\n\t\tthis.height = this.bufferedImage.getHeight();\r\n\t\t\r\n\t}",
"private void setRotation()\n\t{\n\t\tGL11.glPushMatrix();\n\t\tGL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);\n\t}",
"public void rotateBy(float amountInDegrees) {\n internalGroup.rotateBy(amountInDegrees);\n dataTrait.rotation = internalGroup.getRotation();\n resetSprite();\n\n }",
"private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }",
"public void rotateStep(GearedObject other){}",
"public void setRotation(){\n\t\t\tfb5.accStop();\n\t\t\twt.turning = true;\n\t\t\tif(state == BotMove.RIGHT_15){\n\t\t\t\tfb5.turnRightBy(6);\n\t\t\t\tangle = (angle+360-20)%360;\n\t\t\t}\n\t\t\telse if(state == BotMove.RIGHT_10){\n\t\t\t\tfb5.turnRightBy(3);\n\t\t\t\tangle = (angle+360-10)%360;\n\t\t\t}\n\t\t\telse if(state == BotMove.LEFT_5){\n\t\t\t\tfb5.turnLeftBy(2);\n\t\t\t\tangle = (angle+360+5)%360;\n\t\t\t}\n\t\t}",
"public void setRotation(float angle) {\n \t\tthis.angle = angle;\n \t\tupdateTransform();\n \t\tfireEvent(new RotationEvent(angle));\n \t}",
"public abstract void rotate();",
"public void rotateToAngle(double angle) {\n controlState = ControlState.POSITION;\n outputPosition = -angle * TurretConstants.TICKS_PER_DEGREE;\n }",
"public void rotate(Point rotationPoint, double magnitude) {\n\t\tdouble translatedX = x - rotationPoint.getX();\r\n\t\tdouble translatedY = y - rotationPoint.getY();\r\n\t\t\r\n\t\t//do rotation at origin, then translate so that rotation is about rotation point\r\n\t\tdouble xprime = translatedX * Math.cos(Math.toRadians(magnitude)) - translatedY * Math.sin(Math.toRadians(magnitude));\r\n\t\tdouble yprime = translatedX * Math.sin(Math.toRadians(magnitude)) + translatedY * Math.cos(Math.toRadians(magnitude));\r\n\r\n\t\tsetAll(xprime + rotationPoint.getX(), yprime + rotationPoint.getY());\r\n\t}",
"@Override\n\tprotected void rotate(double steps)\n\t{\n\t\tif (currentAxisIsOrigin())\n\t\t\tsuper.rotate(steps);\n\t\t\n\t\t// Otherwise rotates the object around a specific axis\n\t\telse\n\t\t\trotateAroundRelativePoint(getRotation() * steps, \n\t\t\t\t\tthis.currentRotationAxis);\n\t}",
"public static Point PointRotate3D(final Point origin, final Point toRotate, final Vector rotationAxis, final float angle) { \n Vector axis = (rotationAxis.magnitude() == 1) ? rotationAxis : rotationAxis.normal();\n float dist = sqrt(sq(axis.y) + sq(axis.z)); \n Matrix T = new Matrix(new double[][]{\n new double[] {1, 0, 0, -origin.x},\n new double[] {0, 1, 0, -origin.y},\n new double[] {0, 0, 1, -origin.z},\n new double[] {0, 0, 0, 1},\n });\n Matrix TInv = T.inverse();\n\n float aZ = (axis.z == 0 && dist == 0) ? 0 : (axis.z / dist);\n float aY = (axis.y == 0 && dist == 0) ? 0 : (axis.y / dist);\n Matrix Rx = new Matrix(new double[][]{\n new double[] {1, 0, 0, 0},\n new double[] {0, aZ, -aY, 0},\n new double[] {0, aY, aZ, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix RxInv = new Matrix(new double[][]{\n new double[] {1, 0, 0, 0},\n new double[] {0, aZ, aY, 0},\n new double[] {0, -aY, aZ, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix Ry = new Matrix(new double[][]{\n new double[] {dist, 0, -axis.x, 0},\n new double[] {0, 1, 0, 0},\n new double[] {axis.x, 0, dist, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix RyInv = Ry.inverse();\n\n Matrix Rz = new Matrix(new double[][]{\n new double[] {cos(angle), -sin(angle), 0, 0},\n new double[] {sin(angle), cos(angle), 0, 0},\n new double[] {0, 0, 1, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix origSpace = new Matrix(new double[][] {\n new double[]{toRotate.x},\n new double[]{toRotate.y},\n new double[]{toRotate.z},\n new double[]{1}\n });\n Matrix rotated = TInv.times(RxInv).times(RyInv).times(Rz).times(Ry).times(Rx).times(T).times(origSpace);\n\n return new Point((float) rotated.get(0, 0), (float) rotated.get(1, 0), (float) rotated.get(2, 0));\n }",
"private void rotate(double angle, double px, double py) {\n Rotate r = new Rotate(angle, px, py);\n g.setTransform(r.getMxx(), r.getMyx(), r.getMxy(), r.getMyy(), r.getTx(), r.getTy());\n }",
"private void addTransformPoint(double x, double y, int index, GraphicObject curr, double radiansAngle) {\n /** If the object is rotated, the transform point also has to be rotated.\n * Here we calculate the new coordinates acording to the rotation angle. */\n if(radiansAngle != 0.0) {\n GeoVector vect = new GeoVector(x, y, curr.getCenterX(), curr.getCenterY());\n vect.rotate(radiansAngle);\n vect.addPoint(curr.getCenterX(), curr.getCenterY());\n x = vect.getX();\n y = vect.getY();\n }\n /** If it's the rotation point, then it creates a green circle */\n if(index==0) {\n Circle aux = new Circle(2);\n aux.setFillColor(Color.GREEN);\n aux.setStroke(Color.GRAY, 1);\n\n this.transformPoints.add(aux);\n\t\t this.transformPointers[index] = aux;\n\t\t aux.translate((int)x, (int)y);\n /** Otherwise it just creates a normal white rectangle */\n } else {\n Rect aux = new Rect(4,4);\n aux.setFillColor(Color.WHITE);\n aux.setStroke(Color.GRAY, 1);\n\n this.transformPoints.add(aux);\n\t\t this.transformPointers[index] = aux;\n\t\t aux.translate((int)x-2, (int)y-2);\n }\n\t}",
"void rotate () {\n final int rows = currentPiece.height;\n final int columns = currentPiece.width;\n int[][] rotated = new int[columns][rows];\n\n for (int i = 0; i < rows; i++)\n for (int j = 0; j < columns; j++)\n rotated[j][i] = currentPiece.blocks[i][columns - 1 - j];\n\n Piece rotatedPiece = new Piece(currentPiece.color, rotated);\n int kicks[][] = {\n {0, 0},\n {0, 1},\n {0, -1},\n //{0, -2},\n //{0, 2},\n {1, 0},\n //{-1, 0},\n {1, 1},\n //{-1, 1},\n {1, -1},\n //{-1, -1},\n };\n for (int kick[] : kicks) {\n if (canMove(currentRow + kick[0], currentColumn + kick[1], rotatedPiece)) {\n //System.out.println(\"Kicking \" + kick[0] + \", \" + kick[1]);\n currentPiece = rotatedPiece;\n currentRow += kick[0];\n currentColumn += kick[1];\n updateView();\n break;\n }\n }\n }",
"public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}",
"public void rotate() {\n \t// Parameters\n \tdouble z0 = angle;\n \tint n = numberIterations;\n \t\n \t// Get color of target and current vector for explanation texts\n \tColor vectorColor = (Color) angleVectorProperties.get(AnimationPropertiesKeys.COLOR_PROPERTY);\n \tColor goalColor = (Color) trueAngleVectorProperties.get(AnimationPropertiesKeys.COLOR_PROPERTY);\n \t\n \t// Animation title + frame (rectangle around title)\n\t\tTextProperties titleProps = new TextProperties();\n\t\ttitleProps.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.BLACK);\n\t\ttitleProps.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\"Monospaced\", \n\t\t\t Font.BOLD, 24));\n\t\t\n\t\tText title = lang.newText(new Coordinates(20, 30), \"CORDIC\", \"title\", null, titleProps);\n\t\tRect titleFrame = lang.newRect(new Offset(-5, -5, \"title\", AnimalScript.DIRECTION_NW), new Offset(5, 5, \"title\", AnimalScript.DIRECTION_SE), \"titleFrame\", null);\n\n\t\t// Animation background information\n\t\tInfoBox description = new InfoBox(lang, new Offset(0, 20, \"title\", AnimalScript.DIRECTION_SW), 20, \"Background Information\"); \n\t\tList<String> preText = Arrays.asList(\n\t\t\t\t\"CORDIC (COordinate Rotation DIgital Computer) is a numerical algorithm which efficiently calculates sine and cosine of\",\n\t\t\t\t\"a given angle in the circular rotation mode, which is shown here (other modes allow for different computations).\",\n\t\t\t\t\"It was designed to be written in hardware using only addition and shifts and has been used for example in calculators.\",\n\t\t\t\t\"However, today it is seldom used since memory is no longer an issue and one can store thousands of sine and cosine\",\n\t\t\t\t\"values and interpolate if the exact value is not available.\",\n\t\t\t\t\"In CORDIC sine and cosine of a given angle are calculated by reading their values from the vector (1, 0) that is rotated\",\n\t\t\t\t\"by the given angle. However, since only addition and shifts are available for the computation the rotation must be\",\n\t\t\t\t\"approximated through additions or subtractions of smaller, given angles that were calculated such that their tangent\",\n\t\t\t\t\"equals a power of 2 (and can thus be applied by shifting).\",\n\t\t\t\t\"Also, for convergence the given angle must be in the interval of [-1.7433, 1.7433] respectively [-99.88°, 99.88°]. Sine\",\n\t\t\t\t\"and cosine of values beyond this interval may be calculated using their symmetry properties.\");\n\t\tdescription.setText(preText);\n\t\t\n\t\tlang.nextStep(\"Introduction\");\n\n\t\t// More detailed animation background information\t\n\t\tdescription.hide();\n\t\tInfoBox formula = new InfoBox(lang, new Offset(0, 20, \"title\", AnimalScript.DIRECTION_SW), 20, \"Iteration Formula\"); \n\t\tList<String> formulaText = Arrays.asList(\n\t\t\t\t\" x[i+1] = x[i] - sigma[i]*2^(-i)*y[i]\",\n\t\t\t\t\" y[i+1] = sigma[i]*2^(-i)*x[i] + y[i]\",\n\t\t\t\t\" z[i+1] = z[i] - sigma[i]*alpha[i]\",\n\t\t\t\t\"with x[0] = 1*K, y[0] = 0 and z[0] = target angle, where\",\n\t\t\t\t\"- x and y are the cosine and sine values of the angle that the vector describes at the n-th step\",\n\t\t\t\t\"- z is the target angle minus all rotations of (i-1) steps (i.e. the difference of the current angle to the target angle)\",\n\t\t\t\t\"- sigma[i] is the direction of rotation (either -1 for clockwise or 1 for counterclockwise); it is derived from z[i] and\",\n\t\t\t\t\" multiplied with the current angle to adjust the rotation direction (which is a simple sign change in hardware)\",\n\t\t\t\t\"- alpha[i] is the current angle of rotation looked up from a table of precomputed angles with a tangent equal to a power\",\n\t\t\t\t\" of 2\",\n\t\t\t\t\"The tangent is used because instead of applying the common rotation matrix the pseudo rotation matrix\",\n\t\t\t\t\" 1 -tan(angle)\",\n\t\t\t\t\" tan(angle) 1\",\n\t\t\t\t\"is used. Multiplying the pseudo rotation matrix by a correction factor cos(angle) yields the common rotation matrix\",\n\t\t\t\t\" cos(angle) -sin(angle)\",\n\t\t\t\t\" sin(angle) cos(angle\",\n\t\t\t\t\"Since multiplication in hardware is costly and one is only interested in the sine and cosine values of x and y at step n\",\n\t\t\t\t\"of the iteration this correction factor is precomputed, looked up in a table and used for x[0], so the vector will have\",\n\t\t\t\t\"size 1 at the n-th step of the iteration. Thus\",\n\t\t\t\t\"- K = Product_i=0^n-1*cos(alpha[i])\");\n\t\tformula.setText(formulaText);\n\t\t\n\t\tlang.nextStep();\n\t\t\n\t\tformula.hide();\n\t\t\n\t\t// Function graph\n\t\tint offsetFromLeft = 20;\n\t\tint lengthOfXY = 150;\n\t\tPolyline y = lang.newPolyline(new Offset[]{(new Offset(offsetFromLeft+lengthOfXY, 55+lengthOfXY*2, \"title\", AnimalScript.DIRECTION_SW)), (new Offset(offsetFromLeft+lengthOfXY, 55, \"title\", AnimalScript.DIRECTION_SW))}, \"yArrow\", null, functionGraphProperties);\n\t\tPolyline x = lang.newPolyline(new Offset[]{(new Offset(-lengthOfXY, -lengthOfXY, \"yArrow\", AnimalScript.DIRECTION_SW)), (new Offset(lengthOfXY, -lengthOfXY, \"yArrow\", AnimalScript.DIRECTION_SW))}, \"xArrow\", null, functionGraphProperties);\n\t\t\n\t\t// Create legend (angles of vectors) with rectangle frame (hidden until vectors are created)\n\t\tTextProperties targetProperties = new TextProperties();\n\t\ttargetProperties.set(AnimationPropertiesKeys.COLOR_PROPERTY, goalColor);\n\t\ttargetProperties.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\"Monospaced\", Font.BOLD, 12));\n\t\tTextProperties vectorLegendProperties = new TextProperties();\n\t\tvectorLegendProperties.set(AnimationPropertiesKeys.COLOR_PROPERTY, vectorColor);\n\t\tvectorLegendProperties.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\"Monospaced\", Font.BOLD, 12));\n\t\t\n\t\tText legendVector = lang.newText(new Offset(50, -lengthOfXY, \"xArrow\", AnimalScript.DIRECTION_NE), \"Current Angle\", \"legendVector\", null, vectorLegendProperties);\n\t\tText legendTarget = lang.newText(new Offset(0, 10, \"legendVector\", AnimalScript.DIRECTION_SW), \"Target Angle = \" + Math.toDegrees(z0), \"legendTarget\", null, targetProperties);\n\t\t\n\t\tRect legendFrame = lang.newRect(new Offset(-15, -15, \"legendVector\", AnimalScript.DIRECTION_NW), new Offset(15, 15, \"legendTarget\", AnimalScript.DIRECTION_SE), \"legendFrame\", null, legendFrameProperties);\n\n\t\tlegendVector.hide();\n\t\tlegendTarget.hide();\n\t\tlegendFrame.hide();\n\t\t\n\t\t// Source code and frame placed to the right of the legend\n\t\tSourceCode code = lang.newSourceCode(new Offset(50, 100, \"legendFrame\", AnimalScript.DIRECTION_NE), \"code\", null, sourceCodeProperties);\n\t\tcode.addCodeLine(\"define cordic(angle, numberIterations) //rotation mode\", \"definition\", 0, null);\n\t\tcode.addCodeLine(\"x[0] = K // get K from table\", \"xdef\", 2, null);\n\t\tcode.addCodeLine(\"y[0] = 0\", \"ydef\", 2, null);\n\t\tcode.addCodeLine(\"for i=0 to numberIterations-1 do\", \"for\", 2, null);\n\t\tcode.addCodeLine(\"if z[i] > 0\", \"if\", 4, null);\n\t\tcode.addCodeLine(\"sigma_i = 1\", \"posSigma\", 6, null);\n\t\tcode.addCodeLine(\"else\", \"else\", 4, null);\n\t\tcode.addCodeLine(\"sigma_i = -1\", \"negSigma\", 6, null);\n\t\tcode.addCodeLine(\"x[i+1] = x[i] - sigma_i*2^(-i)*y[i]\", \"xi\", 4, null);\n\t\tcode.addCodeLine(\"y[i+1] = sigma_i*2^(-i)*x[i] + y[i]\", \"yi\", 4, null);\n\t\tcode.addCodeLine(\"z[i+1] = z[i] - sigma_i*alpha_i // get alpha_i from table\", \"zi\", 4, null);\n\t\tcode.addCodeLine(\"return (x[numberIterations], y[numberIterations])\", \"return\", 2, null);\n\t\t\n\t\tRect codeFrame = lang.newRect(new Offset(-5, -5, \"code\", AnimalScript.DIRECTION_NW), new Offset(5, 5, \"code\", AnimalScript.DIRECTION_SE), \"codeFrame\", null, codeFrameProperties);\n\t\t\n\t\tlang.nextStep();\n\t\t\n\t\tcode.highlight(0);\n\t\t\n\t\t// Target vector\n\t\tPolyline goal = lang.newPolyline(new Offset[]{(new Offset(-lengthOfXY, 0, \"xArrow\", AnimalScript.DIRECTION_NE)), (new Offset(0, 0, \"xArrow\", AnimalScript.DIRECTION_NE))}, \"goalVector\", null, trueAngleVectorProperties);\n\t\tgoal.rotate(new Offset(-lengthOfXY, 0, \"xArrow\", AnimalScript.DIRECTION_NE), (int)Math.toDegrees(z0), null, null);\n\t\t\n\t\t// Show legend\n\t\tlegendVector.show();\n\t\tlegendTarget.show();\n\t\tlegendFrame.show();\n\t\t\n\t\t// Create number counter of iterations\n\t\tText nText = lang.newText(new Offset(0, 10, \"legendFrame\", AnimalScript.DIRECTION_SW), \"Iteration = 0\", \"nText\", null);\n\t\tnText.hide();\n\t\t// Create display text for z_i\n\t\tText ziText = lang.newText(new Offset(0, 8, \"nText\", AnimalScript.DIRECTION_SW), \"z_0 = \" + z0, \"ziText\", null);\n\t\tziText.hide();\n\t\t\n\t\tlang.nextStep(\"Initialization\");\n\t\t\n\t\tcode.unhighlight(0);\n\t\t\n\t\t// Call algorithm for CORDIC circular rotation and get the result for x[n] and y[n]\n\t\tdouble result[] = algorithmRotation(z0, n, lengthOfXY, code, legendVector, nText, ziText);\n\t\t\n\t\tcode.highlight(11);\n\n\t\t// Show marker for final sine and cosine values\n\t\tint xOffset = (int)(result[0]*lengthOfXY+lengthOfXY);\n\t\tint yOffset = (int)(result[1]*lengthOfXY+lengthOfXY);\n\t\tPolyline sin = lang.newPolyline(new Offset[]{(new Offset(6, -yOffset, \"yArrow\", AnimalScript.DIRECTION_SW)), (new Offset(-6, -yOffset, \"yArrow\", AnimalScript.DIRECTION_SW))}, \"sine\", null);\n\t\tPolyline cos = lang.newPolyline(new Offset[]{(new Offset(xOffset, 6, \"xArrow\", AnimalScript.DIRECTION_NW)), (new Offset(xOffset, -6, \"xArrow\", AnimalScript.DIRECTION_NW))}, \"cosine\", null);\n\t\t\n\t\t// Show final values of CORDIC and values of target angle\n\t\tText sinText = lang.newText(new Offset(-50, -35, \"yArrow\", AnimalScript.DIRECTION_N), \"sine = \" + result[1], \"sineText\", null, vectorLegendProperties);\n\t\tText cosText = lang.newText(new Offset(0, 0, \"xArrow\", AnimalScript.DIRECTION_SE), \"cosine = \" + result[0], \"cosineText\", null, vectorLegendProperties);\n\t\t\n\t\tText trueSinText = lang.newText(new Offset(0, 5, \"sineText\", AnimalScript.DIRECTION_SW), \"sine = \" + Math.sin(z0), \"sineText\", null, targetProperties);\n\t\tText trueCosText = lang.newText(new Offset(0, 5, \"cosineText\", AnimalScript.DIRECTION_SW), \"cosine = \" + Math.cos(z0), \"cosineText\", null, targetProperties);\n\t\t\n\t\tnText.hide();\n\t\tziText.hide();\n\t\t\n\t\tlang.nextStep(\"Leave Algorithm\");\n\t\t\n\t\t// HideAllPrimitivesExcept does not seem to work with\n\t\t// lang.hideAllPrimitivesExcept(Arrays.asList(title, titleFrame));\n\t\tlang.hideAllPrimitives();\n\t\t\n\t\ttitle.show();\n\t\ttitleFrame.show();\n\t\t\n\t\t// Final remark\n\t\tInfoBox outlook = new InfoBox(lang, new Offset(0, 20, \"title\", AnimalScript.DIRECTION_SW), 20, \"Final Remark\"); \n\t\tList<String> postText = Arrays.asList(\n\t\t\t\t\"This animation displayed the so called circular rotation mode of CORDIC for calculating sine and cosine of a given angle.\",\n\t\t\t\t\"The circular mode of CORDIC includes another so called vector mode which is the reverse of the rotation mode and provides\",\n\t\t\t\t\"the absolute of a vector and its angle. The changes necessary to apply this mode is to set z[0] = 0 and let the user\",\n\t\t\t\t\"define x[0] and y[0] (though the absolute value x[n] must be divided by K to obtain the real absolute value). Also, sigma[i]\",\n\t\t\t\t\"is evaluated using y[i-1] instead of z[i-1] (the basic idea is to try to rotate until y is zero instead of until the\",\n\t\t\t\t\"difference between the target and current angle is zero).\",\n\t\t\t\t\"Beyond that, even more modes exist which calculate for example the hyperbolical functions. These modes require different\",\n\t\t\t\t\"values for the variables than the circular mode and an additional one to generalize the algorithm.\");\n\t\toutlook.setText(postText);\n\t\t\n\t\tlang.nextStep(\"Final Remark\");\n\t}",
"Point rotate (double angle, Point result);",
"public void rotate(Rotation rotation)\r\n\t{\r\n\t\tthis.currentDirection=this.currentDirection.rotate(rotation);\r\n\t}",
"public void displayRotAboutPoint(int px, int py, float angleDegrees)\n { \n pushMatrix();\n translate(px, py);\n rotate(radians(angleDegrees));\n shape(fullCar);\n popMatrix();\n }",
"void calculateRotationMatrix() {\n R[0][0] = (float) (Math.cos(angle[0]) * Math.cos(angle[1]));\n R[1][0] = (float) (Math.sin(angle[0]) * Math.cos(angle[1]));\n R[0][1] = (float) (Math.cos(angle[0]) * Math.sin(angle[1]) * Math.sin(angle[2]) - Math.sin(angle[0]) * Math.cos(angle[2]));\n R[1][1] = (float) (Math.sin(angle[0]) * Math.sin(angle[1]) * Math.sin(angle[2]) + Math.cos(angle[0]) * Math.cos(angle[2]));\n R[0][2] = (float) (Math.cos(angle[0]) * Math.sin(angle[1]) * Math.cos(angle[2]) + Math.sin(angle[0]) * Math.sin(angle[2]));\n R[1][2] = (float) (Math.sin(angle[0]) * Math.sin(angle[1]) * Math.cos(angle[2]) - Math.cos(angle[0]) * Math.sin(angle[2]));\n R[2][0] = (float) - Math.sin(angle[1]);\n R[2][1] = (float) (Math.cos(angle[1]) * Math.sin(angle[2]));\n R[2][2] = (float) (Math.cos(angle[1]) * Math.cos(angle[2]));\n }",
"private void updateRotated() {\r\n\r\n\tfor (int n = 0; n < npoints * 3; n += 3) {\r\n\r\n\t // take the linear sum of local co-ords with local\r\n\t // unit vectors and then translate by adding the local\r\n\t // origin's co-ords\r\n\t ps[n] = locals[n] * i[0] + locals[n + 1] * j[0] + locals[n + 2] * k[0];\r\n\t ps[n + 1] = locals[n] * i[1] + locals[n + 1] * j[1] + locals[n + 2] * k[1];\r\n\t ps[n + 2] = locals[n] * i[2] + locals[n + 1] * j[2] + locals[n + 2] * k[2];\r\n\r\n\t ps[n] += p[0];\r\n\t ps[n + 1] += p[1];\r\n\t ps[n + 2] += p[2];\r\n\t}\r\n\r\n\t// reset bounding box and clear dirty flags\r\n\tbox.setBB();\r\n\tdirtyR = false;\r\n\tdirtyT = false;\r\n\r\n\t// normals must be reset\r\n\tthis.setNormals();\r\n\r\n\t// finally\r\n\t_p[0] = p[0];\r\n\t_p[1] = p[1];\r\n\t_p[2] = p[2];\r\n\t_roll = roll;\r\n }",
"public void setRotationAngles(float parTime, float parSwingSuppress, float par3, float parHeadAngleY, float parHeadAngleX, float par6, EntityElephant parEntity)\n {\n \t// return rotation point in case there was previous rearing animation\n \thead.setRotationPoint(headRotPointXDefault, headRotPointYDefault, headRotPointZDefault);\n body.setRotationPoint(bodyRotPointXDefault, bodyRotPointYDefault, bodyRotPointZDefault);\n legFrontRight.setRotationPoint(legFrontRightRotPointXDefault, legFrontRightRotPointYDefault, legFrontRightRotPointZDefault);\n legFrontLeft.setRotationPoint(legFrontLeftRotPointXDefault, legFrontLeftRotPointYDefault, legFrontLeftRotPointZDefault);\n childHead.setRotationPoint(childHeadRotPointXDefault, childHeadRotPointYDefault, childHeadRotPointZDefault);\n\n head.rotateAngleX = degToRad(parHeadAngleX);\n head.rotateAngleY = degToRad(parHeadAngleY);\n childHead.rotateAngleX = degToRad(parHeadAngleX);\n childHead.rotateAngleY = degToRad(parHeadAngleY);\n body.rotateAngleX = ((float)Math.PI / 2F);\n // swingSuppress goes to 0 when still so gates the movement\n legRearRight.rotateAngleX = MathHelper.cos(parTime * 0.6662F) * 1.4F * parSwingSuppress;\n legRearLeft.rotateAngleX = MathHelper.cos(parTime * 0.6662F + (float)Math.PI) * 1.4F * parSwingSuppress;\n legFrontRight.rotateAngleX = MathHelper.cos(parTime * 0.6662F + (float)Math.PI) * 1.4F * parSwingSuppress;\n legFrontLeft.rotateAngleX = MathHelper.cos(parTime * 0.6662F) * 1.4F * parSwingSuppress;\n trunk1.rotateAngleX = MathHelper.cos(degToRad(parEntity.ticksExisted*7)) * degToRad(15);\n childTrunk1.rotateAngleX = MathHelper.cos(degToRad(parEntity.ticksExisted*7)) * degToRad(15);\n trunk2.rotateAngleX = trunk1.rotateAngleX * 3;\n\n // flick ears\n ear1.rotateAngleY = (float) Math.pow(MathHelper.cos(degToRad(parEntity.ticksExisted*3)), 6) * degToRad(15);\n ear2.rotateAngleY = (float) Math.pow(MathHelper.cos(degToRad(parEntity.ticksExisted*3)), 6) * degToRad(-15);\n childEar1.rotateAngleY = (float) Math.pow(MathHelper.cos(degToRad(parEntity.ticksExisted*3)), 6) * degToRad(15);\n childEar2.rotateAngleY = (float) Math.pow(MathHelper.cos(degToRad(parEntity.ticksExisted*3)), 6) * degToRad(-15);\n\n // raise trunk if in water \n if (parEntity.isInWater())\n {\n \ttrunk1.rotateAngleX = degToRad(-150);\n \ttrunk2.rotateAngleX = degToRad(-20);\n \tchildTrunk1.rotateAngleX = degToRad(-150);\n }\n \n // perform rearing animation if appropriate\n if (parEntity.isRearing())\n {\n \tint rearingCounter = parEntity.getRearingCounter();\n// \t// DEBUG\n// \tSystem.out.println(\"ModelElephant entity is rearing with rearing counter = \"+rearingCounter);\n \t\n \t// move retain connection between body parts, hind legs stay where they were\n \thead.setRotationPoint(headRotPointXDefault, headRotPointYDefault+rearingOffsetCycle[rearingCounter][0], headRotPointZDefault+rearingOffsetCycle[rearingCounter][1]);\n body.setRotationPoint(bodyRotPointXDefault, bodyRotPointYDefault+rearingOffsetCycle[rearingCounter][2], bodyRotPointZDefault+rearingOffsetCycle[rearingCounter][3]);\n legFrontRight.setRotationPoint(legFrontRightRotPointXDefault, legFrontRightRotPointYDefault+rearingOffsetCycle[rearingCounter][4], legFrontRightRotPointZDefault+rearingOffsetCycle[rearingCounter][5]);\n legFrontLeft.setRotationPoint(legFrontLeftRotPointXDefault, legFrontLeftRotPointYDefault+rearingOffsetCycle[rearingCounter][6], legFrontLeftRotPointZDefault+rearingOffsetCycle[rearingCounter][7]);\n childHead.setRotationPoint(childHeadRotPointXDefault, childHeadRotPointYDefault+rearingOffsetCycle[rearingCounter][8], childHeadRotPointZDefault+rearingOffsetCycle[rearingCounter][9]);\n \n // rotate for rearing\n \tbody.rotateAngleX += degToRad(rearingAngleCycle[rearingCounter][0]);\n head.rotateAngleX += degToRad(rearingAngleCycle[rearingCounter][0]);\n \tchildHead.rotateAngleX += degToRad(rearingAngleCycle[rearingCounter][0]);\n \ttrunk1.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][1]);\n \ttrunk2.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][2]);\n \tchildTrunk1.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][1]);\n \tlegFrontRight.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][0]);\n \tlegFrontLeft.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][0]);\n }\n }",
"public void RotateActionPerformed(java.awt.event.ActionEvent evt) { \r\n degree = degree + 90;\r\n drawingPanel.setDegree(degree); \r\n }",
"public void setAngle(float angle) {\n this.angle = angle;\n float cos = (float) Math.cos(angle);\n float sin = (float) Math.sin(angle);\n m00 = cos;\n m01 = sin;\n m10 = -sin;\n m11 = cos;\n }",
"private void resetAngles() {\n \ttorso_front.rotateAngleX = 0;\n \tleg_front_left.rotateAngleX = leg_front_right.rotateAngleX = 0;\n \tleg_front_left.rotateAngleY = leg_front_right.rotateAngleY = 0;\n \tleg_front_left.rotateAngleZ = leg_front_right.rotateAngleZ = 0;\n \tleg_back_left.rotateAngleX = leg_front_left.rotateAngleX;\n \tleg_back_right.rotateAngleX = leg_front_right.rotateAngleX;\n \tleg_back_right.rotateAngleY = leg_back_left.rotateAngleY = 0;\n \tleg_back_right.rotateAngleZ = leg_back_left.rotateAngleZ = 0;\n\t\tknee_front_left.rotateAngleX = knee_front_right.rotateAngleX = 0;\n\t\tknee_back_left.rotateAngleX = knee_back_right.rotateAngleX = 0;\n\t\ttail_stub.rotateAngleX = -1.05f;\n\t\ttail_segment_1.rotateAngleX = 1.1f;\n\t\ttail_segment_2.rotateAngleX = tail_segment_3.rotateAngleX = 0;\n\t\tneck.rotateAngleX = 0.17453292519943295f;\n }",
"public void rotate(float angle, float x, float y, float z) {\n Matrix.rotateM(mModelMatrix, 0, angle, x, y, z);\n }",
"DMatrix3C getRotation();",
"void setRotation(int objIndex,Quaternion rot){\n look[objIndex].setRotationQuaternion(rot);\n usedRot.set(objIndex);\n }",
"protected void rotateHitBox(double mag) {\n\t\tint cX = (int) (getX() + centerX);\t\t//Returns the center of object \n\t\tint cY = (int) (getY() + centerY);\t\t//on the map, rather than the relative\n\t\t\t\t\t\t\t\t\t\t\t\t//centerX and centerY\n\t\tfor(int index = 0; index < hitBox.npoints; index++) {\n\t\t\tint x = hitBox.xpoints[index];\n\t\t\tint y = hitBox.ypoints[index];\n\t\t\t\n\t\t\thitBox.xpoints[index] = (int) (cX + (x - cX) * Math.cos(mag) - (y - cY) * Math.sin(mag));\n\t\t\thitBox.ypoints[index] = (int) (cY + (x - cX) * Math.sin(mag) + (y - cY) * Math.cos(mag));\n\t\t}\n\t}",
"public void setRotation(int rotation) {\r\n\t\tthis.rotation = rotation;\r\n\t}",
"public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6)\n {\n float f = par3 * (float)Math.PI * -0.1F;\n\n for (int i = 0; i < 4; i++)\n {\n field_78106_a[i].rotationPointY = -2F + MathHelper.cos(((float)(i * 2) + par3) * 0.25F);\n field_78106_a[i].rotationPointX = MathHelper.cos(f) * 9F;\n field_78106_a[i].rotationPointZ = MathHelper.sin(f) * 9F;\n f += ((float)Math.PI / 2F);\n }\n\n f = ((float)Math.PI / 4F) + par3 * (float)Math.PI * 0.03F;\n\n for (int j = 4; j < 8; j++)\n {\n field_78106_a[j].rotationPointY = 2.0F + MathHelper.cos(((float)(j * 2) + par3) * 0.25F);\n field_78106_a[j].rotationPointX = MathHelper.cos(f) * 7F;\n field_78106_a[j].rotationPointZ = MathHelper.sin(f) * 7F;\n f += ((float)Math.PI / 2F);\n }\n\n f = 0.4712389F + par3 * (float)Math.PI * -0.05F;\n\n for (int k = 8; k < 12; k++)\n {\n field_78106_a[k].rotationPointY = 11F + MathHelper.cos(((float)k * 1.5F + par3) * 0.5F);\n field_78106_a[k].rotationPointX = MathHelper.cos(f) * 5F;\n field_78106_a[k].rotationPointZ = MathHelper.sin(f) * 5F;\n f += ((float)Math.PI / 2F);\n }\n\n field_78105_b.rotateAngleY = par4 / (180F / (float)Math.PI);\n field_78105_b.rotateAngleX = par5 / (180F / (float)Math.PI);\n }",
"@Override\n\tpublic void rotation(double rx, double ry, double rz) {\n\t\tint i;\n\t\t\n\t\tfor (i = 0; i<6; i++) {\n\t\t\tthis.plans.get(i).rotation(rx, ry, rz);\n\t\t}\n\t\t//Ca me parait un peu foireux comme methode faudra voir apres ave l'interface graphique si\n\t\t//�a marche comme �a.\n\t}",
"@Override\n public void reAngle() {\n }",
"void rotate(float x, float y, float z) {\n target_angle[0] += x;\n target_angle[1] += y;\n target_angle[2] += z;\n postSetAngle();\n }",
"public void rotate(int rotation) {\n rotateCO(rotation);\n rotateCP(rotation);\n rotateEO(rotation);\n rotateEP(rotation);\n }",
"public void rotate(double angle, E3DVector3F upVec, E3DVector3F translatedAmt)\r\n\t{\r\n\t\tE3DVector3F vec = null;\r\n\r\n\t\t//Normal first in case it was null\r\n\t\tvec = getNormal();\r\n\t\tvec.rotateEqual(angle, upVec);\r\n\t\tvec.normaliseEqual();\r\n\r\n\t\t//Go through each vertex, get the vector from it to the position, rotate it, add position back to it\r\n\t\tfor(int a = 0; a<3; a++)\r\n\t\t{\r\n\t\t\tvec = vertices[a].getVertexPos();\r\n\t\t\t//These operations should modify the vec itself, so it doesn't need to be re-set\r\n\t\t\tvec.subtractEqual(translatedAmt);\r\n\t\t\tvec.rotateEqual(angle, upVec);\r\n\t\t\tvec.addEqual(translatedAmt);\r\n\t\t}\r\n\t\t\r\n needNormalRecalc = true;\r\n\t\tneedPlaneEquationRecalc = true;\r\n\t}",
"public void rotate( Vector3f axis, float angle )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new AxisAngle4f( axis, angle ) );\n\t\tmat.mul( opMat );\n\t}",
"@Override\r\n\tpublic void rotateAboutAxis(final double angle, final WB_Point3d p1,\r\n\t\t\tfinal WB_Point3d p2) {\r\n\r\n\t\tfinal WB_Transform raa = new WB_Transform();\r\n\t\traa.addRotateAboutAxis(angle, p1, p2.subToVector(p1));\r\n\r\n\t\traa.applySelf(this);\r\n\r\n\t}",
"public Point rotate(Point origin,double angle) {\n\t\t\n\t\t// Optimisations\n\t\tif (origin==null) return(this);\t\t// origin not set so don't rotate\n\t\t\n\t\tif (angle==0) return(this);\t\t\t// don't bother to rotate if angle = 0\n\t\t\n\t\t// else, get the new point after rotation using rotation matrix\n\t\tfloat newX = (float) (origin.getX() + (this.x-origin.getX())*Math.cos(angle) - (this.y-origin.getY())*Math.sin(angle));\n\t\tfloat newY = (float) (origin.getY() + (this.x-origin.getX())*Math.sin(angle) + (this.y-origin.getY())*Math.cos(angle));\n\t\t\n\t\t// return the new point after rotation\n\t\treturn new Point(newX,newY);\n\t}",
"public void applyRotation(final float rotation)\n\t{\n\t\tfor (final FeatureElement element : featureElements)\n\t\t{\n\t\t\tif (element instanceof RelativeFeatureElement)\n\t\t\t{\n\t\t\t\tfinal RelativeFeatureElement rel = (RelativeFeatureElement) element;\n\t\t\t\tfinal TFloatArrayList steps = rel.walk().steps();\n\t\t\t\tif (steps.size() > 0)\n\t\t\t\t{\n\t\t\t\t\tsteps.setQuick(0, steps.getQuick(0) + rotation);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void rotate( float x, float y, float z, float angle )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new AxisAngle4f( x, y, z, angle ) );\n\t\tmat.mul( opMat );\n\t}",
"public void rotateX(int angle) {\n\t\tint sin = Model.sin[angle];\n\t\tint cos = Model.cos[angle];\n\t\tfor (int v = 0; v < vertexCount; v++) {\n\t\t\tint y_ = ((vertexY[v] * cos) - (vertexZ[v] * sin)) >> 16;\n\t\t\tvertexZ[v] = ((vertexY[v] * sin) + (vertexZ[v] * cos)) >> 16;\n\t\t\tvertexY[v] = y_;\n\t\t}\n\t}",
"void applyRotationMatrix() {\n for (int i = 0; i < coors.length; i++) {\n for (int j = 0; j < coors[i].length; j++) {\n newCoors[i][j] = coors[i][0] * R[j][0] + coors[i][1] * R[j][1] + coors[i][2] * R[j][2];\n }\n // add perspective\n float scale = map(Math.abs(newCoors[i][2]), 0, (float) (halfSize * Math.sqrt(3)), 1, 1.5f);\n if (newCoors[i][2] < 0) {\n scale = 2f - scale;\n }\n for (int j = 0; j < 2; j++) {\n newCoors[i][j] *= scale;\n }\n }\n // to R2\n // just dont use Z\n setPathAndAlpha();\n }",
"public void calculateAngleAndRotate(){\n\t\tdouble cumarea = 0;\n\t\tdouble sina = 0;\n\t\tdouble cosa = 0;\n\t\tdouble area, angle;\n\t\tfor (int n = 0; n < rt.size();n++) {\n\t\t\tarea = rt.getValueAsDouble(rt.getColumnIndex(\"Area\"),n);\n\t\t\tangle = 2*rt.getValueAsDouble(rt.getColumnIndex(\"Angle\"),n);\n\t\t\tsina = sina + area*Math.sin(angle*Math.PI/180);\n\t\t\tcosa = cosa + area*Math.cos(angle*Math.PI/180);\n\t\t\tcumarea = cumarea+area;\n\t\t}\n\t\taverageangle = Math.abs(0.5*(180/Math.PI)*Math.atan2(sina/cumarea,cosa/cumarea)); // this is the area weighted average angle\n\t\t// rotate the data \n\t\tIJ.run(ActiveImage,\"Select All\",\"\");\n\t\tActiveImageConverter.convertToGray32();\n\t\tIJ.run(ActiveImage,\"Macro...\", \"code=[v= x*sin(PI/180*\"+averageangle+\")+y*cos(PI/180*\"+averageangle+\")]\");\n\t\treturn;\n\t}",
"public void rotate() {\n\t\tclearPiece();\n\t\trotateFirstBlock();\n\t\trotateSecondBlock();\n\t\trotateFourthBlock();\n\t\tsetPiece();\n\t\trepaint();\n\t}",
"public void setRotationAngle(double angle) {\n if (angle >= MIN_ROTATION_ANGLE && angle <= MAX_ROTATION_ANGLE) {\n rotationAngle = angle;\n }\n }",
"@Override\n\tpublic void rotate90() {\n\n\t\tint[][] rotate = new int[this.frame[0].length][this.frame.length];\n\n\t\tfor (int x = 0; x < rotate[0].length; x++) {\n\t\t\tfor (int y = 0; y < rotate.length; y++) {\n\t\t\t\trotate[y][x] = this.frame[this.frame.length - x - 1][y];\n\t\t\t}\n\t\t} \n\n\t\tthis.frame = rotate;\n\n\t}",
"private void rotateAround() {\n if (camPathAngle < Constants.FULL_ROTATION) {\n camPathAngle++;\n } else {\n swapCount++;\n camPathAngle = 0;\n }\n mPerspectiveCamera.position.set(xPosition, yPosition, zPosition);\n if (swapCount % 2 == 0) {\n mPerspectiveCamera.rotate(Vector3.Y, camPathAngle);\n } else {\n mPerspectiveCamera.rotate(Vector3.X, camPathAngle);\n }\n mPerspectiveCamera.lookAt(new Vector3(0, 0, 0));\n mPerspectiveCamera.update();\n }",
"public double getRotation();",
"public void zRotate() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rotar() {\n\r\n\t}",
"public void setRotationAngle(final double rotationAngle) {\n\t\t_rotationAngle = rotationAngle;\n\t\t_polylineDecoration.setRotation(Math.toRadians(_rotationAngle));\n\t}",
"public void displayTranslated(float x, float y, float angleDegrees) {\n /*\n pushMatrix();\n translate(x, y);\n popMatrix();\n xCord = (int)x;\n yCord = (int)y;\n pushMatrix();\n translate(x, y);\n rotate(radians(angleDegrees));\n popMatrix();\n shape(fullCar);\n */\n pushMatrix();\n translate(x, y);\n rotate(radians(angleDegrees));\n shape(fullCar);\n popMatrix();\n xCord = (int)x;\n yCord = (int)y;\n }",
"public void rotate(Vector3 rotationVector) {\n // setta la matrice lastRotation come matrice identità...\n Matrix.setIdentityM(lastRotation, 0);\n // ...gli applica la rotazione...\n Matrix.rotateM(lastRotation, 0, (float) rotationVector.x(), 1.0f, 0.0f, 0.0f);\n Matrix.rotateM(lastRotation, 0, (float) rotationVector.y(), 0.0f, 1.0f, 0.0f);\n Matrix.rotateM(lastRotation, 0, (float) rotationVector.z(), 0.0f, 0.0f, 1.0f);\n\n // ...applica questa nuova rotazione alla matrice di rotazione complessiva...\n Matrix.multiplyMM(rotationMatrix, 0, lastRotation, 0, accumulatedRotation, 0);\n\n // ...e salva questa nuova matrice di rotazione in accumulatedRotation che verrà usata nel rendering\n System.arraycopy(rotationMatrix, 0, accumulatedRotation, 0, 16);\n\n // come ultima cosa calcola i gradi che esprimono la rotazione attuale\n // convertendoli da radianti in gradi e poi cambiandone il segno\n angle.x(-Math.atan2(accumulatedRotation[9],accumulatedRotation[10])*180/Math.PI);\n angle.y(-Math.atan2(-accumulatedRotation[8],\n (float)Math.sqrt(accumulatedRotation[9]*accumulatedRotation[9]+accumulatedRotation[10]*accumulatedRotation[10]))*180/Math.PI);\n angle.z(-Math.atan2(accumulatedRotation[4],accumulatedRotation[0])*180/Math.PI);\n }",
"public void setRotation(Array<Body> objects) {\n this.state.setRotation(this, objects);\n }",
"private void rotate(int direction){\n\t\t//Gdx.app.debug(TAG, \"rotating, this.x: \" + this.x + \", this.y: \" + this.y);\n\t\tif (direction == 1 || direction == -1){\n\t\t\tthis.orientation = (this.orientation + (direction*-1) + 4) % 4;\n\t\t\t//this.orientation = (this.orientation + direction) % 4;\n\t\t} else{\n\t\t\tthrow new RuntimeException(\"Tile invalid direction\");\n\t\t}\n\t}",
"public void resetAngle() {\n\t\t//this.angle = (this.orientation % 4 + 4) * (90);\n\t\tthis.angle = this.orientation * 90*-1;\n\t\tthis.tweenAngle.setCurrentValue(this.angle);\n\t\tthis.tweenAngle.setTargetValue(this.angle);\n\t}",
"void rotate() {\n startAnimation(allSubCubes(), Axis.Y, Direction.CLOCKWISE);\n rotateCubeSwap();\n }",
"public void rotate(double theta, Point center) {\n\n\t\tfor (Point point: verts) {\n\n\t\t\tpoint.rotate(theta, center);\n\t\t}\n\n\t}"
] | [
"0.7404545",
"0.6943015",
"0.6793494",
"0.6664889",
"0.6660267",
"0.65898037",
"0.6564816",
"0.6553244",
"0.64036155",
"0.6387337",
"0.6386296",
"0.63740224",
"0.6370861",
"0.6361866",
"0.6351638",
"0.63175464",
"0.6250885",
"0.62396497",
"0.62314105",
"0.621019",
"0.61653495",
"0.61344296",
"0.611086",
"0.61087406",
"0.6102393",
"0.6101628",
"0.60606265",
"0.6060365",
"0.6042381",
"0.60378283",
"0.603532",
"0.6034516",
"0.6030761",
"0.6025009",
"0.601957",
"0.60046095",
"0.5988916",
"0.59868973",
"0.5983324",
"0.59734815",
"0.5971447",
"0.5947249",
"0.59461844",
"0.5896549",
"0.58926564",
"0.5869599",
"0.58647156",
"0.5859447",
"0.58248585",
"0.581878",
"0.58113146",
"0.5810226",
"0.58046746",
"0.577018",
"0.57622725",
"0.5760762",
"0.5758271",
"0.5745602",
"0.5744507",
"0.57412064",
"0.573447",
"0.5726009",
"0.57244843",
"0.57208467",
"0.56857985",
"0.5682812",
"0.56762344",
"0.5674439",
"0.56721973",
"0.56714296",
"0.5670406",
"0.5667777",
"0.56662226",
"0.5657475",
"0.5655461",
"0.5645294",
"0.56403255",
"0.5639942",
"0.5639392",
"0.56309783",
"0.56297565",
"0.5628356",
"0.56272006",
"0.56179875",
"0.5614897",
"0.56063503",
"0.5599342",
"0.5592455",
"0.5590481",
"0.55857253",
"0.558516",
"0.55807513",
"0.5572392",
"0.5570732",
"0.55677545",
"0.556378",
"0.55556756",
"0.5549499",
"0.5547286",
"0.55457234"
] | 0.76920164 | 0 |
This method unselect's the currently object so that the user can perform a new action. | private void unSelect() {
/** if we had some object selected we need to delete it's Transformation Points. */
if(this.action.isSelect() && this.curr_obj != null) {
this.canvas.remove(this.transformPoints);
this.transformPoints.clear();
this.curr_obj = null;
/** if we were in the middle of a text operation, we have to remove the TextBox and set the text to it's last version*/
} else if(this.action.isText()) {
int size = Integer.parseInt(currentFontSize.getItemText(currentFontSize.getSelectedIndex()));
curr_obj = new Text(editor.getText());
((Text)curr_obj).setFont(currFont);
addTextObject(curr_obj, (int)aux_obj.getX() + (int)((1.0/4.0)*size), (int)aux_obj.getY()+ (size) + (int)((1.0/4.0)*size));
aux_obj = null;
curr_obj = null;
apanel.remove(editor);
editor = null;
action.setAction(Action.TEXTBOX);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deselect();",
"@Override\n public void deselectGolem() {\n }",
"@Override\n\tpublic void unselect() {\n\t}",
"@Override\n protected void processUnselect() {\n \n }",
"public void deselect() {\n if (selection != null) {\n \t\tworld.destroyJoint(mouseJoint);\n \t selection = null;\n \t mouseJoint = null;\n\t }\n }",
"public void deselectObjects() {\n if (contextMenu != null) {\n contextMenu.hide();\n contextMenu = null;\n }\n\n // Deselect all objects\n objectsProperty.stream().forEach(ov -> ov.setSelected(false));\n hintsProperty.stream().forEach(hv -> hv.setSelected(false));\n }",
"public void resetCurrentlySelectedObject() {\n this.currentlySelectedObject.setTransparency(255);\n this.currentlySelectedObject = null;\n }",
"protected void removeSelection() {\n\t\tBEAN oldBean = getInternalValue();\n\t\tsetInternalValue(null);\n\t\ttextField.setValue(null);\n\t\tif (searchListener != null) {\n\t\t\tsearchListener.remove(oldBean);\n\t\t}\n\t}",
"public void clearSelection()\n\t{\n\t\tgetObject().clearSelection();\n\t\treturn;\n\t}",
"@VisibleForTesting\n void cancelProvisionalSelection() {\n mProvisionalSelection.clear();\n }",
"private void doSelect() {\n this.setVisible(false);\n }",
"public void removeSelection() {\n this.selection = null;\n }",
"void cancelSelectMode();",
"public void deselectAll() {\n\t\tselected.clear();\n\t}",
"public void cancelSelection() {\n\t\tsd.hideSelectRect();\n\t\tspectroFragment.disableCaptureButtonContainer();\n\t\tselecting = false;\n\t}",
"public void deselect(){\n\t\tPIN.reset();\n\t}",
"public void unSelectWidget(Widget w) {\n if (!w.isSelected()) return;\n w.unSelect();\n doSelectedCount(w);\n toolBar.setEditButtons(selectedCnt, selectedGroupCnt);\n }",
"public void deselect(T item) {\n getElement().deselect(SerDes.mirror(item));\n }",
"public void deselectNotify() {\n }",
"public void deselect() {\n\n // reset the pin value\n pin.reset();\n\n }",
"public void removeSelectedItem() {\r\n\t\tint i = getSelectedIndex();\r\n\t\tif(i != -1)\r\n\t\t\tlistModel.removeElementAt(i);\r\n\t}",
"public void deselect() {\n\t\tmSecureChannel.resetSecurity();\r\n\t}",
"@Override\n\tprotected void OnRelease() {\n\t\tsetSelected(false);\n\t}",
"public void clearAccessibleSelection() {\n // To be fully implemented in a future release\n }",
"public void resetSelectPresentation();",
"private void clearSelectionQuietly() {\n mRanger = null;\n\n if (!hasSelection()) {\n return;\n }\n\n Selection oldSelection = getSelection(new Selection());\n mSelection.clear();\n\n for (String id: oldSelection.getAll()) {\n notifyItemStateChanged(id, false);\n }\n }",
"public void deselectFocusedNode(){\r\n \tfocusOut();\r\n }",
"public void clearSelection() {\n clearSelectionQuietly();\n notifySelectionChanged();\n }",
"public void removeSelectedAction() {\n\t\tvar selectedItems = pairsListView.getSelectionModel().getSelectedItems();\n\t\tpairsListView.getItems().removeAll(selectedItems);\n\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tROOM.setSelectedItem(\"\");\n\t\t\t\ttxtrent.setText(\"\");\n\t\t\t\ttxtSeat.setText(\"\");\n\t\t\t\tgrp.clearSelection();\n\t\t\t}",
"public void unselect() {\n for (int i = 0; i < series.size(); i++) {\n series.setItemSliced(i, false, false, true);\n }\n }",
"public void evt_DeleteCurrentObject()\r\n {\r\n rh2EventPos.hoOiList.oilNumOfSelected -= 1;\t\t\t\t\t// Un de moins dans l'OiList\r\n if (rh2EventPrev != null)\r\n {\r\n rh2EventPrev.hoNextSelected = rh2EventPos.hoNextSelected;\r\n rh2EventPos = rh2EventPrev; // Car le courant est vire!\r\n }\r\n else\r\n {\r\n// rhPtr.rhOiList[rh2EventPosOiList].oilListSelected=rh2EventPos.hoNextSelected;\r\n rh2EventPrevOiList.oilListSelected = rh2EventPos.hoNextSelected;\r\n rh2EventPos = null;\r\n }\r\n }",
"public void removeSelected()\n {\n for (int i = shapes.size() - 1; i >= 0; i--)\n {\n SceneShape s = shapes.get(i);\n if (s.isSelected()) shapes.remove(i);\n }\n repaint();\n }",
"public void cancelSelectionMode() {\n if (null != mAdapter) {\n mAdapter.cancelSelectionMode();\n }\n }",
"public void deselect() {\n\t\tfor (int row = 0; row < field.getRowCount(); row++) {\n\t\t\tCheckBox cb = (CheckBox) field.getWidget(row, 3);\n\t\t\tcb.setValue(false);\n\t\t}\n\t}",
"public void clearSelection() {\n buttonGroup.clearSelection();\n }",
"protected void onDiscard() {\r\n this.setActive(false);\r\n }",
"private void deSelectCheckedState(){\n int noOfItems = navigationView.getMenu().size();\n for (int i=0; i<noOfItems;i++){\n navigationView.getMenu().getItem(i).setChecked(false);\n }\n }",
"public void deselectAll()\n {\n map.deselectAll();\n mapComponent.repaint();\n mapper.resetMenus();\n }",
"private void helperSwitchSelectOff()\r\n\t{\r\n\t\tImageIcon iconButton = FormUtils.getIconResource(FormStyle.RESOURCE_PATH_ICO_SELECT);\r\n\r\n\t\tmainFormLink.getComponentToolbar().getComponentButtonSelect().setIcon(iconButton);\r\n\r\n\t\tFormMainMouse.isSampleSelectOn = false;\r\n\t}",
"public void clearSelection() {\n grid.getSelectionModel().deselectAll();\n }",
"public void deselectPanel() {\n\t\tthis.displayNumberBlock.setBackground(dispNormal);\n\t}",
"public void deselectThem(short oil)\r\n {\r\n CObjInfo poil = rhPtr.rhOiList[oil];\t\t// Pointe la liste\r\n poil.oilEventCount = rh2EventCount;\r\n poil.oilListSelected = -1;\r\n poil.oilNumOfSelected = 0;\r\n }",
"public void deselectAll()\n {\n }",
"public void menuDeselected (MenuEvent event) {\n EventQueue.invokeLater(new Runnable() {\n public void run () {\n restoreActions();\n }\n });\n }",
"@Override\n public void onDestroyActionMode(ActionMode mode) {\n \tmSelection.clearSelection();\n }",
"public void deactivate()\n\t{\n\t\t_active = false;\n\t\t_leader.setObjectHandler(null);\n\t}",
"public void invertSelection () {\r\n\t\tif ( modeSelectAll){\r\n\t\t\tselectedDataIds.clear();\r\n\t\t\tif (! unselectedDataIds.isEmpty()){\r\n\t\t\t\tselectedDataIds.addAll(unselectedDataIds);\r\n\t\t\t\tunselectedDataIds.clear();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tunselectedDataIds.clear();\r\n\t\t\tif (!selectedDataIds.isEmpty()){\r\n\t\t\t\tunselectedDataIds.addAll(selectedDataIds);\r\n\t\t\t\tselectedDataIds.clear();\r\n\t\t\t}\r\n\t\t}\r\n\t\tmodeSelectAll=!modeSelectAll;\r\n\t\tfireSelectionChangeNotification();\r\n\t\t\r\n\t}",
"protected void desactiveBoat() {\n if (activeBoat!=null) {\n activeBoat.setActive(false);\n activeBoat.getBoatRectangle().setMouseTransparent(false);\n activeBoat.getBoatRectangle().setFill(activeBoat.getDisactiveColor());\n activeBoat=null;\n closeMsg();\n } \n }",
"public void clearSelection()\r\n {\r\n final ListSelectionModel selectionModel = jTable.getSelectionModel();\r\n selectionModel.clearSelection();\r\n }",
"void clearSelection();",
"public void clearChoiceSelect() {\n choiceSelect = -1;\n }",
"public native void deselectAll() /*-{\r\n var self = [email protected]::getOrCreateJsObj()();\r\n self.deselectAll();\r\n }-*/;",
"public void deactivate() {\n this.active = false;\n }",
"public void clearSelection() {\n getElement().clearSelection();\n }",
"@Override\n\tpublic void undoCommand() {\n\t\tselectionModel.removeAllFromSelectionList();\n\t\tmodel.removeElement(device);\n\t}",
"public void cabDeselectAll() {\n ListView lv = getListView();\n int vCnt = lv.getCount();\n \n for (int i = 0; i < vCnt; i++) {\n \tlv.setItemChecked(i, false);\n }\n \n selectedListItems.clear();\n redrawListView();\n }",
"private void deleteSelectedTransition()\n {\n Transition oppositeTransition = optionsPanel.getWorkspacePanel().findTransitionBetween(transition.getToState(), transition.getFromState());\n if (oppositeTransition != null)\n {\n oppositeTransition.setTangent(false);\n }\n optionsPanel.getWorkspacePanel().repaint();\n optionsPanel.getWorkspacePanel().getNFA().removeTransition(transition);\n optionsPanel.getWorkspacePanel().setTool(LMWorkspacePanel.SELECT_TOOL);\n optionsPanel.changeOptions(\"blank\");\n }",
"public void clearChoiceSelect() {\n choiceSelect = -1;\n }",
"@Override\r\n public void onDestroyActionMode(ActionMode mode) {\n adapter.removeSelection();\r\n }",
"void disableAgentSelectionControl();",
"public void resetSelection(IClientContext context) throws Exception;",
"@Override\n public void undo(){\n this.parent.getSelectedArea().clear();\n }",
"@Override\n\tprotected void cmdClearWidgetSelected() {\n\t\tclearMode();\n\n\t}",
"private void cancelAction() {\n\t\tparent.tabbedView.remove(this);\n\t\tparent.repaint();\n\t}",
"@Override\r\n\tpublic void cleanup() {\r\n\t\tlevelList.setSelectedIndex(0);\t\t\r\n\t}",
"@Action\n public void acCancel() {\n setChangeObj(false);\n }",
"@Action\n public void acCancel() {\n setChangeObj(false);\n }",
"public void filterOutSelection() {\n RenderContext myrc = (RenderContext) rc; if (myrc == null) return;\n Set<String> sel = myrc.filterEntities(getRTParent().getSelectedEntities());\n if (sel == null || sel.size() == 0) { getRTParent().pop(); repaint(); return; }\n Set<Bundle> new_bundles = new HashSet<Bundle>();\n if (sel != null && sel.size() > 0) {\n new_bundles.addAll(myrc.bs.bundleSet());\n Iterator<String> it = sel.iterator();\n\twhile (it.hasNext()) new_bundles.removeAll(myrc.entity_counter_context.getBundles(it.next()));\n getRTParent().setSelectedEntities(new HashSet<String>());\n\tgetRTParent().push(myrc.bs.subset(new_bundles));\n repaint();\n }\n }",
"public void endSelection()\n {\n\tisMultiSelection = false;\n\tsetMaxCheckCount(1);\n\tuncheckAll();\n }",
"public void discardUserAction() {\n\t\tshowAnimalList();\n\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tUser zws = alllist.getSelectedValue();\r\n\t\t\t\tam.removeElement(zws);\r\n\t\t\t\tall.remove(zws);\r\n\t\t\t\tvm.addElement(zws);\r\n\t\t\t\tverwalter.remove(zws);\r\n\t\t\t}",
"public void invSelected()\n {\n\t\t//informaPreUpdate();\n \tisSelected = !isSelected;\n\t\t//informaPostUpdate();\n }",
"public void removeMySelectionListener(EventListener l);",
"public void remove(Object selObj){\n\t\t_list.removeElement(selObj);\n\t}",
"public void deactivate();",
"public void deleteSelection() {\n deleteFurniture(Home.getFurnitureSubList(this.home.getSelectedItems())); \n }",
"public void unset(){\n\t\tcurrentInst = -1;\n\t}",
"public void onItemUnsetSelection(AdapterView<?> parent, View view, int position);",
"public void deactivate() {\n\t\tentity.deactivateInstance(this);\n\t}",
"public void clearComponentSelection(){\r\n ComponentSelectionTree.clearSelection();\r\n }",
"public void desactivarRecursos() {\n\r\n\t}",
"void deactivate() {\n\t\tanimalTemplate = null;\n\t\tscope=null;\n\t\ttriggerOnID=false;\n\t\tstate = null;\n\t\tlog.debug(bundleMarker, \"deactivating...\");\n\t}",
"public void removeAccessibleSelection(int i) {\n // To be fully implemented in a future release\n }",
"public void deactivate(){\n state = State.invisible;\n active = false;\n }",
"@Override\n\tpublic void deleteSelected() {\n\n\t}",
"private void removeSelection(RectangleButton button)\n\t{\n\t\tselectedUnits.remove(cancelButtons.indexOf(button));\n\t\tcancelButtons.remove(button);\n\t\tsetSelectionLocations();\n\t}",
"static void setNotSelected(){isSelected=false;}",
"@Override\r\n\tpublic void unexecute() {\n\t\t\r\n\t\tCollections.swap(model.getListOfShapes(), model.getListOfShapes().size()-1, i); \r\n\t\t\r\n\t\t/*if(print == true) {\r\n\t\t\t\r\n\t\t\tFrame.textArea.append(\"UNDO >>> Bring to back: \" + s +\"\\n\");\r\n\t\t}\r\n\t\t\r\n\t\tprint = true;*/\r\n\t\r\n\t\t\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic void onUnselectFeatures(ControllerEvent event) {\n\n\t\tMapViewer viewer = getViewer();\n\t\tMapContext context = viewer.getConfiguration().getContext();\n\n\t\tselectedFeatureId = null;\n\n\t\tfor (FeatureMapLayer layer : context.getFeatureLayers()) {\n\t\t\tlayer.setSelection(new ArrayList<String>(1));\n\t\t}\n\n\t\tList<String> ids = (List<String>) event.getParams().get(\"featureIds\");\n\t\tif (ids.size() > 0) {\n\t\t\tif (object.getProbleem() instanceof BordProbleem) {\n\t\t\t\t((BordProbleem) object.getProbleem()).setBord(null);\n\t\t\t}\n\n\t\t\tif (object.getProbleem() instanceof NetwerkAnderProbleem) {\n\t\t\t\tobject.setTraject(null);\n\t\t\t}\n\t\t}\n\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\treplaceSelection(\"\");\n\t\t}",
"@Override\n public void unInvoke() {\n final Environmental item = affected;\n if (item == null)\n return;\n final Room room = CMLib.map().roomLocation(item);\n if ((canBeUninvoked()) && (room != null))\n room.showHappens(CMMsg.MSG_OK_VISUAL, item, L(\"<S-YOUPOSS> flaming sword is consumed!\"));\n super.unInvoke();\n if ((canBeUninvoked()) && (room != null)) {\n room.recoverRoomStats();\n item.destroy();\n }\n }",
"public void deleteSelection() {\r\n /* Delete the node */\r\n try {\r\n deleteNode();\r\n } catch (NullPointerException e1) {\r\n }\r\n /* Delete the edge */\r\n try {\r\n deleteEdge();\r\n } catch (NullPointerException e2) {\r\n }\r\n /* Reload the scroll */\r\n scrollPane().doLayout();\r\n }",
"@Override\r\n public void onDestroyActionMode(ActionMode mode) {\r\n resetSelectedItems();\r\n mActionMode = null;\r\n }",
"@Override\n public void onValueDeselected() {\n }",
"void onDiscardChangesSelected();",
"@Override\n public void onValueDeselected() {\n\n }",
"@Override\n public void onValueDeselected() {\n\n }",
"@Override\n public void onValueDeselected() {\n\n }",
"@Override\n public void onValueDeselected() {\n\n }"
] | [
"0.78497463",
"0.77763116",
"0.777171",
"0.7347931",
"0.722314",
"0.70978624",
"0.7050964",
"0.6914047",
"0.691349",
"0.68844706",
"0.68755347",
"0.6855312",
"0.68281215",
"0.68277365",
"0.6753779",
"0.67219484",
"0.6713402",
"0.66578513",
"0.6633605",
"0.66237986",
"0.6616977",
"0.6549059",
"0.6515149",
"0.65070593",
"0.64840865",
"0.6462957",
"0.64607704",
"0.6451478",
"0.64373887",
"0.6405137",
"0.63847524",
"0.6377894",
"0.6364463",
"0.6351832",
"0.6349033",
"0.6347405",
"0.6295545",
"0.62876254",
"0.62783724",
"0.6259535",
"0.62537587",
"0.62429315",
"0.6234937",
"0.62257814",
"0.62254375",
"0.62211305",
"0.6220283",
"0.62188244",
"0.6208269",
"0.6203034",
"0.61922884",
"0.6189246",
"0.6181133",
"0.61803967",
"0.6179905",
"0.616084",
"0.61551833",
"0.61379063",
"0.61368585",
"0.6127314",
"0.6100142",
"0.6094656",
"0.6084612",
"0.6051109",
"0.60236955",
"0.6023448",
"0.60213315",
"0.60213315",
"0.6018159",
"0.59876037",
"0.59822166",
"0.5982135",
"0.59694463",
"0.5968658",
"0.59654605",
"0.5964122",
"0.595631",
"0.5954541",
"0.59446615",
"0.5943222",
"0.59342283",
"0.5928138",
"0.592462",
"0.592177",
"0.590915",
"0.59075665",
"0.59071213",
"0.5904638",
"0.58975524",
"0.5893723",
"0.58819556",
"0.5877329",
"0.5870443",
"0.5860422",
"0.5853256",
"0.58415186",
"0.58403456",
"0.58403456",
"0.58403456",
"0.58403456"
] | 0.76521766 | 3 |
This method updates the current Font with it's new properties | private void updateFont() {
this.currFont = new Font(this.currentFontFamily.getItemText(this.currentFontFamily.getSelectedIndex()),
Integer.parseInt(this.currentFontSize.getItemText(this.currentFontSize.getSelectedIndex())),
this.currentFontStyle.getItemText(this.currentFontStyle.getSelectedIndex()),
Font.NORMAL,
this.currentFontWeight.getItemText(this.currentFontWeight.getSelectedIndex()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setFont(Font newFont) {\r\n\t\tfont = newFont;\r\n\t}",
"private void setFont() {\n\t}",
"public void setFont(Font newFont) {\n\tfont = newFont;\n }",
"@Override\n public void setFont(Font f) {\n super.setFont(f);\n menuDirty = true;\n ResizeUtils.updateSize(this, actions);\n }",
"public void setTextFont(Font font);",
"public void setFont(Font f) {\n font = f;\n compute();\n }",
"public void setFont(Font value) {\r\n this.font = value;\r\n }",
"public void setFont(Font font) {\n this.font = font;\r\n repaint();\r\n }",
"private void setFont() {\n\t\tsessionTitle.setFont(FONT_TITLE);\n\t\tdetailedDescription.setFont(FONT_DESCRIPTION);\n\t\texitButton.setFont(FONT_BUTTON);\n\t}",
"public void updateText()\r\n\t{\r\n\t\tdouble smallest = Math.min(menu.getController().getWidth(), menu.getController().getHeight());\r\n\t\tdouble equivalent12 = smallest/55;//Equivalent of 12 point font on base dimensions\r\n\t\t\r\n\t\ttextRenderer = new TextRenderer(new Font(fontName, Font.PLAIN, (int)(equivalent12*size)), true, true);\r\n\t}",
"public void setFont(Font font)\n {\n this.font = font;\n }",
"public void updateFonts() {\n\t\tfor (int i = 0; i < this.getMenuCount(); i++) {\n\t\t\tJMenu m;\n\t\t\tif ((m = getMenu(i)) != null) {\n\n\t\t\t\t// old method\n\t\t\t\t// problem with keyboard shortcuts\n\t\t\t\t// setMenuFontRecursive(m, app.getPlainFont());\n\n\t\t\t\t// force rebuild next time menu is opened\n\t\t\t\t// see BaseMenu.menuSelected()\n\t\t\t\tm.removeAll();\n\n\t\t\t\t// update title (always visible)\n\t\t\t\tm.setFont(app.getPlainFont());\n\t\t\t}\n\t\t}\n\t}",
"public void saveFont()\r\n\t{\r\n\t\tsavedFont = g.getFont();\r\n\t}",
"public void setFont(Font font)\r\n\t{\r\n\t\t_g2.setFont(font);\r\n\t}",
"public void setTextFont(Font font)\n {\n setFont(font);\n }",
"private void setFont() {\n try {\n setFont(Font.loadFont(new FileInputStream(FONT_PATH), 23));\n } catch (FileNotFoundException e) {\n setFont(Font.font(\"Verdana\", 23));\n }\n }",
"private void initFontAndChange(Context context) {\n changeFont(context);\n }",
"public void setFont(Font font) {\n\tthis.font = font;\n }",
"private void updateFontSet() {\n if (!isBigFontSet()) {\n UIFontUtils.initFontDefaults(UIManager.getDefaults(), null);\n } else {\n// <snip> Install sscaled font\n FontPolicy windowsPolicy = FontPolicies.getDefaultWindowsPolicy();\n FontSet fontSet = windowsPolicy.getFontSet(null, UIManager\n .getLookAndFeelDefaults());\n WrapperFontSet scaled = new WrapperFontSet(fontSet, 5);\n UIFontUtils.initFontDefaults(UIManager.getDefaults(), scaled);\n// </snip>\n }\n updateLookAndFeel();\n }",
"public void setFont( Font font ) {\r\n this.font = font;\r\n }",
"@Override\n public void setFont(String font) {\n graphicsEnvironmentImpl.setFont(canvas, font);\n }",
"public native void setFont(Font value) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso.font = [email protected]::getJsObj()();\n }-*/;",
"public void setFont(RMFont aFont) { }",
"@Override\r\n public void actionPerformed(ActionEvent e) {\n Font currentFont = jshellLabGlobal.Interpreter.GlobalValues.globalEditorPane.getFont();\r\n Font newFont = new Font(currentFont.getFontName(), currentFont.getStyle(), currentFont.getSize()+1);\r\n jshellLabGlobal.Interpreter.GlobalValues.globalEditorPane.setFont(newFont);\r\n }",
"@Override\r\n public void setFont(Font font) {\r\n super.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\r\n }",
"public void setFont(AWTFont font) {\r\n\t\trenderer = createRendererFromAWTFont(font);\r\n\t\tthis.font = font;\r\n\t\tupdateValues();\r\n\t}",
"public void setLabelFont(Font f);",
"public void revertFont()\r\n\t{\r\n\t\tif (savedFont != null)\r\n\t\t{\r\n\t\t\tg.setFont(savedFont);\r\n\t\t}\r\n\t}",
"public static void setFont(Font font){\n\t\tGComponent.fGlobalFont = font;\n\t}",
"protected void applyFont() {\n\t\tif (fields != null) {\n\t\t\tIterator<FieldEditor> e = fields.iterator();\n\t\t\twhile (e.hasNext()) {\n\t\t\t\tFieldEditor pe = e.next();\n\t\t\t\t// pe.applyFont();\n\t\t\t}\n\t\t}\n\t}",
"void setFontFamily(ReaderFontSelection f);",
"public void update()\n\t{\n\t\tsetFont(attribs.getFont());\n\t\tTextMeshGenerator.generateTextVao(this.text, this.attribs, this.font, this.mesh);\n\t\tsize = new Vector2f(mesh.maxPoint.x(), mesh.maxPoint.y());\n\t}",
"public void setFont( Font font ) {\n\t\tgraphics.setFont( font );\n\t}",
"@FXML\r\n void fontAction() {\r\n // default css code for each characteristics of the text\r\n String textFont = \"-fx-font-family: \";\r\n String textSize = \"-fx-font-size: \";\r\n String textStyle = \"\";\r\n\r\n // Create and take the input from the Font dialog\r\n Dialog<Font> fontSelector = new FontSelectorDialog(null);\r\n Optional<Font> result = fontSelector.showAndWait();\r\n\r\n // add changes to the default CSS code above based on the users\r\n if (result.isPresent()) {\r\n Font newFont = result.get();\r\n textFont += \"\\\"\" + newFont.getFamily() + \"\\\";\";\r\n textSize += newFont.getSize() + \"px;\";\r\n\r\n // some basics CSS font characteristics\r\n String style = newFont.getStyle();\r\n String style_italic = \"-fx-font-style: italic;\";\r\n String style_regular = \"-fx-font-weight: normal ;\";\r\n String style_bold = \"-fx-font-weight: bold;\";\r\n switch (style) {\r\n case \"Bold Italic\":\r\n textStyle += style_bold + \"\\n\" + style_italic;\r\n case \"Italic\":\r\n textStyle += style_italic;\r\n case \"Regular\":\r\n textStyle += style_regular;\r\n case \"Regular Italic\":\r\n textStyle += style_italic;\r\n default:\r\n textStyle += style_bold;\r\n }\r\n\r\n // Add all characteristic to a single string\r\n String finalText = textFont + \"\\n\" + textSize;\r\n finalText += \"\\n\" + textStyle;\r\n // Display options and set that options to the text\r\n defOutput.setStyle(finalText);\r\n }\r\n }",
"public Font modify(Font font) {\n\t\tif (family == null) {\n\t\t\tif (style != null && size != null) {\n\t\t\t\treturn font.deriveFont(style, size);\n\t\t\t}\n\t\t\telse if (style != null) {\n\t\t\t\treturn font.deriveFont(style);\n\t\t\t}\n\t\t\treturn font.deriveFont((float) size);\n\t\t}\n\t\tint newStyle = style != null ? style : font.getStyle();\n\t\tint newSize = size != null ? size : font.getSize();\n\t\treturn new Font(family, newStyle, newSize);\n\t}",
"public void setFont(String property, Font font) {\r\n Font oldValue = calendarTable.getFont(property);\r\n if (font == oldValue) {\r\n return;\r\n }\r\n calendarTable.setFont(property, font);\r\n if (property.equals(FONT_PREFIX + \"Controls\")) {\r\n for(int i = 0, n = controlsPanel.getComponentCount(); i < n; i++) {\r\n controlsPanel.getComponent(i).setFont(font);\r\n }\r\n }\r\n firePropertyChange(\"Font.\" + property, oldValue, font);\r\n }",
"@Override\r\n public void setFont(Font font) {\r\n super.setFont(new Font(\"Arial\", Font.PLAIN, 11)); \r\n }",
"public void createFont()\n {\n my_font = new Font(\"Helvetica\", Font.BOLD, (int) (getWidth() * FONT_SIZE));\n }",
"public void setFont(Font newFont, Timing delay, Timing duration) {\r\n\t\tif (gen instanceof AdvancedTextGeneratorInterface)\r\n\t\t\t((AdvancedTextGeneratorInterface)gen).setFont(this, newFont, \r\n\t\t\t\t\tdelay, duration);\r\n\t\telse\r\n\t\t\tthrow new IllegalArgumentException(\"gen is not an AdvancedTextGeneratorInterface -- \" +gen);\r\n\r\n\t}",
"public void setModifierFont(String name, int type, int size, float tracking, Boolean kerning) \n {\n RendererSettings.getInstance().setLabelFont(name, type, size, kerning, tracking);\n _SPR.RefreshModifierFont();\n }",
"public void GetFont (){\n fontBol = false;\n fontBolS = true;\n fontBolA = true;\n fontBolW = true;\n }",
"public void setFont(String font)\n {\n getStateHelper().put(PropertyKeys.font, font);\n }",
"public void setFont(String fontname, int fontsize){\n\t\tint tw = textWidth;\n\t\tint fs = (int) localFont.getSize();\n\t\tlocalFont = GFont.getFont(winApp, fontname, fontsize);\n\t\tif(fontsize > fs)\n\t\t\theight += (fontsize - fs);\n\t\tsetText(text);\n\t\tif(textWidth > tw)\n\t\t\twidth += (textWidth - tw);\n\t\tArrayList<GOption> options = optGroup.getOptions();\n\t\tfor(int i = 0; i < options.size(); i++)\n\t\t\toptions.get(i).setWidth((int)width - 10);\n\t\tslider.setX((int)width - 10);\n\t}",
"private void setFontSize(float newFontSize) {\n\t\tfontSize = newFontSize;\n\t\tproperties.setProperty(\"fontSize\", Float.toString(newFontSize));\n\n\t\t// update all text-based components\n\t\tfor (Component c : components)\n\t\t\tc.setFont(c.getFont().deriveFont(newFontSize));\n\t\t\n\t\t// update machine graphics\n\t\tupdate(); \n\t}",
"public static void setFont(String fontName, int fontSize, int style){\n\t\tGComponent.fGlobalFont = new Font(fontName, fontSize, style);\n\t}",
"public PatchTextStyleProperties font(String font) {\n this.font = font;\n return this;\n }",
"private void setFont() {\n Typeface font = Typeface.createFromAsset(getContext().getAssets(), mFontPath);\n setTypeface(font, Typeface.NORMAL);\n }",
"public void setFontSize(float fs) {\n\t\tif (fs != fontSize) {\n\t\t\tfontSize = fs;\n\t\t\treload();\n\t\t}\n\t}",
"public void setFont(Font font)\n{\n\ttextArea().setFont(font);\n}",
"public void setFont(Font fnt) {\n\t\tborder.setTitleFont(fnt);\n\t}",
"public void setFont(BitmapFont font) {\n\t\tthis.font = font;\n\t\tthis.setLabel(this.label);\n\t}",
"public void setFont(String key, Font value) {\n\t\tif (value != null && !value.equals(getDefault(key)))\n\t\t\tinternal.setProperty(key, value.getName() + \" \" + value.getSize() + \" \" + value.getStyle());\n\t\telse\n\t\t\tinternal.remove(key);\n\t}",
"public void set_fonts(Graphics2D g2, float scale) {\n if ( XHSIPreferences.get_instance().get_bold_fonts() ) {\n this.font_statusbar = new Font(\"Verdana\", Font.PLAIN, 9);\n this.font_tiny = new Font( \"Verdana\", Font.BOLD, 10);\n this.font_small = new Font( \"Verdana\", Font.BOLD, 12);\n this.font_medium = new Font( \"Verdana\", Font.BOLD, 16);\n this.font_large = new Font( \"Verdana\", Font.PLAIN, 24);\n this.font_zl = new Font( \"Verdana\", Font.PLAIN, Math.round(64.0f * scale));\n this.font_yl = new Font( \"Verdana\", Font.PLAIN, Math.round(32.0f * scale));\n this.font_xxl = new Font( \"Verdana\", Font.BOLD, Math.round(24.0f * scale));\n this.font_xl = new Font( \"Verdana\", Font.BOLD, Math.round(21.0f * scale));\n this.font_l = new Font( \"Verdana\", Font.BOLD, Math.round(18.0f * scale));\n this.font_m = new Font( \"Verdana\", Font.BOLD, Math.round(16.0f * scale));\n this.font_s = new Font( \"Verdana\", Font.BOLD, Math.round(14.0f * scale));\n this.font_xs = new Font( \"Verdana\", Font.BOLD, Math.round(12.0f * scale));\n this.font_xxs = new Font( \"Verdana\", Font.BOLD, Math.round(10.0f * scale));\n this.font_normal = new Font( \"Verdana\", Font.BOLD, Math.round(14.0f * scale));\n } else {\n this.font_statusbar = new Font(\"Verdana\", Font.PLAIN, 9);\n this.font_tiny = new Font( \"Verdana\", Font.PLAIN, 10);\n this.font_small = new Font( \"Verdana\", Font.PLAIN, 12);\n this.font_medium = new Font( \"Verdana\", Font.PLAIN, 16);\n this.font_large = new Font( \"Verdana\", Font.PLAIN, 24);\n this.font_zl = new Font( \"Verdana\", Font.PLAIN, Math.round(64.0f * scale));\n this.font_yl = new Font( \"Verdana\", Font.PLAIN, Math.round(32.0f * scale));\n this.font_xxl = new Font( \"Verdana\", Font.PLAIN, Math.round(24.0f * scale));\n this.font_xl = new Font( \"Verdana\", Font.PLAIN, Math.round(21.0f * scale));\n this.font_l = new Font( \"Verdana\", Font.PLAIN, Math.round(18.0f * scale));\n this.font_m = new Font( \"Verdana\", Font.PLAIN, Math.round(16.0f * scale));\n this.font_s = new Font( \"Verdana\", Font.PLAIN, Math.round(14.0f * scale));\n this.font_xs = new Font( \"Verdana\", Font.PLAIN, Math.round(12.0f * scale));\n this.font_xxs = new Font( \"Verdana\", Font.PLAIN, Math.round(10.0f * scale));\n this.font_normal = new Font( \"Verdana\", Font.PLAIN, Math.round(14.0f * scale));\n }\n\n // calculate font metrics\n // W is probably the largest characher...\n FontMetrics fm;\n\n fm = g2.getFontMetrics(this.font_large);\n this.line_height_large = fm.getAscent();\n this.max_char_advance_large = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_large = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_medium);\n this.line_height_medium = fm.getAscent();\n this.max_char_advance_medium = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_medium = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_small);\n this.line_height_small = fm.getAscent();\n this.max_char_advance_small = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_small = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_tiny);\n this.line_height_tiny = fm.getAscent();\n this.max_char_advance_tiny = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_tiny = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_zl);\n this.line_height_zl = fm.getAscent();\n this.max_char_advance_zl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_zl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_yl);\n this.line_height_yl = fm.getAscent();\n this.max_char_advance_yl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_yl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xxl);\n this.line_height_xxl = fm.getAscent();\n this.max_char_advance_xxl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xxl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xl);\n this.line_height_xl = fm.getAscent();\n this.max_char_advance_xl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_l);\n this.line_height_l = fm.getAscent();\n this.max_char_advance_l = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_l = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_m);\n this.line_height_m = fm.getAscent();\n this.max_char_advance_m = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_m = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_s);\n this.line_height_s = fm.getAscent();\n this.max_char_advance_s = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_s = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xs);\n this.line_height_xs = fm.getAscent();\n this.max_char_advance_xs = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xs = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xxs);\n this.line_height_xxs = fm.getAscent();\n this.max_char_advance_xxs = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xxs = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_normal);\n this.line_height_normal = fm.getAscent();\n this.max_char_advance_normal = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_normal = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n }",
"public void setFont(Font f) {\n super.setFont(f);\n columnWidth = 0;\n }",
"@Override\n public String getFont() {\n return graphicsEnvironmentImpl.getFont(canvas);\n }",
"public void setFont(int fontId){\n this.fontId = fontId;\n }",
"public void setFontSize(int font) {\n\t\tthis.font = font;\n\t}",
"private void setFonts() {\n fileTitle.setFont(MasterDisplay.titleFont);\n entryFileButton.setFont(MasterDisplay.tabAndButtonFont);\n entryFileLabel.setFont(MasterDisplay.tabAndButtonFont);\n itemFileButton.setFont(MasterDisplay.tabAndButtonFont);\n itemFileLabel.setFont(MasterDisplay.tabAndButtonFont);\n outputFolderButton.setFont(MasterDisplay.tabAndButtonFont);\n outputFolderLabel.setFont(MasterDisplay.tabAndButtonFont);\n }",
"public void setFontName(String name)\n {\n font.setFontName(name);\n }",
"abstract Font getFont();",
"@Override\n public void changeFontSize(int i) {\n lyricsTV.setTextSize((float) i);\n PreferencesManager pm = PreferencesManager.getInstance();\n pm.setFontSize(i);\n }",
"public Font getFont() {\n return this.font;\n }",
"public void changeFonts(){\n Typeface typeFace = Typeface.createFromAsset (this.getAssets (), \"fonts/courier.ttf\");\n sloganTV.setTypeface (typeFace);\n }",
"public Font getFont() {\r\n return font;\r\n }",
"public Font getFont() {\r\n return font;\r\n }",
"public Font deriveFont(float size){\n\tHashtable newAttributes = (Hashtable)getRequestedAttributes().clone();\n\tapplySize(size, newAttributes);\n return new Font(newAttributes, createdFont, font2DHandle);\n }",
"public void setModifierFont(String name, int type, int size) \n {\n RendererSettings.getInstance().setLabelFont(name, type, size);\n _SPR.RefreshModifierFont();\n }",
"public void setLabelFont(Font value) {\n labelFont = value;\n }",
"public String getFont() {\n return font;\n }",
"public void GetFontA (){\n fontBolA = false;\n fontBolS = true;\n fontBol = true;\n fontBolW = true;\n }",
"public FontProps getFontProps() {\n\t\treturn mFont;\n\t}",
"private void applyFontStyle() {\r\n\t\tfinal Font font = SWTGraphicUtil.buildFontFrom(this.control, PromptSupport.getFontStyle(this.control));\r\n\t\tthis.control.setFont(font);\r\n\t\tSWTGraphicUtil.addDisposer(this.control, font);\r\n\t}",
"Font createFont();",
"public void setFontName(String name) {\n\t\tthis.fontName = name;\n\t}",
"public Font getFont(\n )\n {return font;}",
"public static void setFont(PApplet theApplet, String fontName, int fontSize){\n\t\tif(theApplet != null)\n\t\t\tGComponent.globalFont = GFont.getFont(theApplet, fontName, fontSize);\n\t}",
"public Font getFont() {\n return font;\n }",
"private void changeFont(Component component, int fontSize)\n\t\t{\n\t\tFont f = component.getFont();\n\t\tcomponent.setFont(new Font(f.getName(), f.getStyle(), f.getSize() + fontSize));\n\t\tif (component instanceof Container)\n\t\t\t{\n\t\t\tfor(Component child:((Container)component).getComponents())\n\t\t\t\t{\n\t\t\t\tchangeFont(child, fontSize);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public void change_browser_font(Font font){\n\t\tbrowser_font = font;\n\t\tgui_globals.change_html_pane_font(this.browser, font);\n\t}",
"public void initializeText(){\n\t\tfont = new BitmapFont();\n\t\tfont1 = new BitmapFont();\n\t\tfont1.setColor(Color.BLUE);\n\t\tfont2 = new BitmapFont();\n\t\tfont2.setColor(Color.BLACK);\n\t}",
"void setFontSpacingSlider(Font font);",
"public void setFont(String font) {\r\n\t\tProps p = getPage().getPageProperties();\r\n\t\t_fontTagStart = p.getProperty(font + Props.TAG_START);\r\n\t\t_fontTagEnd = p.getProperty(font + Props.TAG_END);\r\n\t}",
"public void setTextColorAndFont(GraphicsContext graphicsContext) {\r\n\t\tgraphicsContext.setFill(Color.WHITE);\r\n\t\tgraphicsContext.setFont(Font.font(25));\r\n\t}",
"@Override\n\t\t\tpublic void update(Observable o, Object arg) {\n\t\t\t\tupdateCurrentLineFontSize(Properties.getDefaultProperties().getIntProperty(currentLineFontSizeKey));\n\t\t\t}",
"public Font getFont() {\n\treturn font;\n }",
"public Font getFont() {\n\treturn font;\n }",
"private void loadFont() {\n\t\ttry {\n\t\t\tfont = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(\"assets/fonts/forced_square.ttf\"));\n\t\t} catch (Exception e) {\n\t\t\tfont = new Font(\"Helvetica\", Font.PLAIN, 22);\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void GetFontS (){\n fontBolS = false;\n fontBol = true;\n fontBolA = true;\n fontBolW = true;\n }",
"public abstract Font getFont();",
"public void setFont(org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont font)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont target = null;\n target = (org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont)get_store().find_element_user(FONT$0, 0);\n if (target == null)\n {\n target = (org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont)get_store().add_element_user(FONT$0);\n }\n target.set(font);\n }\n }",
"public void setDisplayFont(int size){\n\t\tscreen.setFont(new Font(\"Serif\",Font.BOLD,size));\r\n\t}",
"public final void setConsoleFont(Font font) {\r\n\t\tconsole.setFont(font);\r\n\t}",
"public RMFont getFont()\n {\n return getStyle().getFont();\n }",
"private void setupFont() {\n CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()\n .setDefaultFontPath(\"fonts/Montserrat-Regular.otf\")\n .setFontAttrId(R.attr.fontPath)\n .build()\n );\n }",
"private void loadSettingFont() {\n\t\tSharedPreferences mysettings = getSharedPreferences(\n\t\t\t\tPREFERENCES_FILE_NAME, 0);\n\t\tindexFont = mysettings.getInt(\"indexFont\", 1);\n\t\tLog.d(\"indexFont\", indexFont + \"\");\n\t\tswitch (indexFont) {\n\t\tcase 0:\n\t\t\tmTypeface = Typeface.DEFAULT;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tmTypeface = Typeface.createFromAsset(getApplicationContext()\n\t\t\t\t\t.getAssets(), \"SEGOEUI.TTF\");\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tmTypeface = Typeface.createFromAsset(getApplicationContext()\n\t\t\t\t\t.getAssets(), \"tinhyeu.ttf\");\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tmTypeface = Typeface.createFromAsset(getApplicationContext()\n\t\t\t\t\t.getAssets(), \"thuphap.ttf\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tmTypeface = Typeface.createFromAsset(getApplicationContext()\n\t\t\t\t\t.getAssets(), \"SEGOEUI.TTF\");\n\t\t\tbreak;\n\t\t}\n\t}",
"public CanvasFont getFont() {\n return this.textFont;\n }",
"private void setupFonts()\r\n\t{\r\n\t\tSystem.out.println(\"In setupFonts()\");\r\n\t\t\r\n\t\t// set up the text fonts\r\n\t\ttry\r\n\t\t{\r\n\t\t\ttextFont = Font.createFont(Font.TRUETYPE_FONT, AppletResourceLoader.getFileFromJar(GameConstants.PATH_FONTS + \"FOXLEY8_.ttf\"));\r\n\t\t\ttextFont = textFont.deriveFont(16.0f);\r\n\t\t\ttextFontBold = textFont.deriveFont(Font.BOLD, 16.0f);\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"ERROR IN setupFonts(): \" + e.getClass().getName() + \" - \" + e.getMessage());\r\n\t\t}\r\n\t}",
"private void applyFontToMenuItem(MenuItem subMenuItem) {\n\t\tString s = subMenuItem.getTitle().toString();\n\t\t\n\t\t\n\t\tswitch (syth) {\n\t\tcase 1:\n\t\t\tif(FontUtili.defaultFont==2)\n\t\t\t{\n\t\t\t\t\n\t\t\t\ts = (String) ZawGyiToUni(s, false);\n\t\t\t\tsetStringTypeFace(s,FontUtili.font(ac, 1), subMenuItem);\n\t\t\t} else {\n\t\t\t\tsetStringTypeFace(s,FontUtili.font(ac, 1), subMenuItem);\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 2:\n\t\t\tif(FontUtili.defaultFont==1)\n\t\t\t{\n\t\t\t\t\n\t\t\t\ts =(String) ZawGyiToUni(s, true);\n\t\t\t\tsetStringTypeFace(s,FontUtili.font(ac, 2), subMenuItem);\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tsetStringTypeFace(s,FontUtili.font(ac, 2), subMenuItem);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 3:\n\t\t\tif(FontUtili.defaultFont ==1)\n\t\t\t{\n\t\t\t\ts = (String) XtremeZawGyi(s, true);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\ts = (String) XtremeUni(s, true);\n\t\t\t}\n\t\t\tsetStringTypeFace(s, FontUtili.font(ac,3), subMenuItem);\n\t\t\tbreak;\n\t\t\t\n\t\t\n\t\t}\n\t}",
"public static void changeFont ( Component component, Font font )\n {\n component.setFont ( font );\n if ( component instanceof Container )\n {\n for ( Component child : ( ( Container ) component ).getComponents () )\n {\n changeFont ( child, font );\n }\n }\n }",
"public Font getFont()\r\n\t{\r\n\t\treturn _g2.getFont();\r\n\t}"
] | [
"0.78066236",
"0.77655315",
"0.7754055",
"0.7433686",
"0.7427567",
"0.7411261",
"0.73257893",
"0.72772884",
"0.7256337",
"0.72363454",
"0.7157408",
"0.71379095",
"0.7132054",
"0.7096793",
"0.7086596",
"0.7071172",
"0.70440066",
"0.70304507",
"0.70293754",
"0.7017115",
"0.6972222",
"0.6964431",
"0.6963334",
"0.69540256",
"0.6905161",
"0.68753254",
"0.68735087",
"0.6847438",
"0.6815137",
"0.68149436",
"0.6797446",
"0.6794578",
"0.6785145",
"0.67816883",
"0.6762983",
"0.67478615",
"0.67457604",
"0.6727214",
"0.6700671",
"0.66734225",
"0.6641449",
"0.6626669",
"0.65838814",
"0.6582283",
"0.65500975",
"0.6544347",
"0.6526132",
"0.6485718",
"0.6485416",
"0.6465135",
"0.64590174",
"0.6444079",
"0.6425766",
"0.64162105",
"0.640628",
"0.6403523",
"0.63851523",
"0.6353001",
"0.63385355",
"0.6331377",
"0.6315046",
"0.6310936",
"0.6307483",
"0.6301171",
"0.6301171",
"0.6290885",
"0.62905604",
"0.6289546",
"0.6288296",
"0.62738055",
"0.62735206",
"0.6273075",
"0.6266964",
"0.62601435",
"0.62474954",
"0.6240429",
"0.62301576",
"0.6221146",
"0.6211235",
"0.61956686",
"0.61944264",
"0.61879134",
"0.61809224",
"0.6176866",
"0.6170883",
"0.6170883",
"0.61670786",
"0.6162663",
"0.6141177",
"0.6140941",
"0.6132613",
"0.61309475",
"0.612084",
"0.6120666",
"0.61165506",
"0.6115815",
"0.61115843",
"0.6105475",
"0.609537",
"0.6092443"
] | 0.8495327 | 0 |
Processes requests for both HTTP GET and POST methods. | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String method = request.getMethod();
String message = "";
String url = "/admin/home.jsp";
switch (method) {
case "GET":
url = "/QuizOnline/admin/home.jsp";
response.sendRedirect(url);
break;
case "POST":
String questionContent = request.getParameter("questionContent");
String answer1Content = request.getParameter("answer1");
String answer2Content = request.getParameter("answer2");
String answer3Content = request.getParameter("answer3");
String answer4Content = request.getParameter("answer4");
String correctAnswer = request.getParameter("correctAnswer");
String subjectID = request.getParameter("subject");
try {
if (questionContent.isEmpty() || answer1Content.isEmpty() || answer2Content.isEmpty()
|| answer3Content.isEmpty() || answer4Content.isEmpty() || correctAnswer.isEmpty() || subjectID.isEmpty()) {
throw new NullPointerException();
} else {
Question question = new Question(questionContent, Integer.parseInt(subjectID));
Answer answer1 = new Answer(answer1Content, false);
Answer answer2 = new Answer(answer2Content, false);
Answer answer3 = new Answer(answer3Content, false);
Answer answer4 = new Answer(answer4Content, false);
switch (correctAnswer) {
case "answer1":
answer1.setIsCorrect(true);
break;
case "answer2":
answer2.setIsCorrect(true);
break;
case "answer3":
answer3.setIsCorrect(true);
break;
case "answer4":
answer4.setIsCorrect(true);
break;
default:
throw new NullPointerException();
}
List<Answer> listAnswer = new ArrayList<>(4);
listAnswer.add(answer1);
listAnswer.add(answer2);
listAnswer.add(answer3);
listAnswer.add(answer4);
AdminDAO dao = new AdminDAO();
boolean flag = dao.createNewQuestion(question, listAnswer);
if (flag) {
message = "Them moi thanh cong";
} else {
message = "Them moi chua thanh cong,hay thu lai";
}
List<SearchQuestionDTO> listQuestion = dao.searchPart1("", true, null, 0);
List<String> listQuestionID = new ArrayList<>();
for (SearchQuestionDTO dto : listQuestion) {
listQuestionID.add(dto.getQuestion().getId());
}
List<Answer> listAnswerFromDB = dao.searchPart2(listQuestionID);
for (SearchQuestionDTO dto : listQuestion) {
for (Answer answer : listAnswerFromDB) {
if (dto.getQuestion().getId().equals(answer.getQuestionID())) {
dto.getListAnswers().add(answer);
}
}
}
request.setAttribute("SEARCH_RESULT", listQuestion);
}
} catch (NumberFormatException e) {
message = "Loi khi parse sang so";
logger.error("Error at AddNewQuestionServlet:" + e.toString());
} catch (NullPointerException e) {
message = "Khong duoc nhap thieu";
logger.error("Error at AddNewQuestionServlet:" + e.toString());
} catch (Exception e) {
message = "Loi khong xac dinh";
logger.error("Error at AddNewQuestionServlet:" + e.toString());
} finally {
request.setAttribute("MESSAGE", message);
request.getRequestDispatcher(url).forward(request, response);
}
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);\n }\n }",
"private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // only POST should be used\n doPost(request, response);\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\nSystem.err.println(\"=====================>>>>>123\");\n\t\tString key=req.getParameter(\"method\");\n\t\tswitch (key) {\n\t\tcase \"1\":\n\t\t\tgetProvinces(req,resp);\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tgetCities(req,resp);\t\t\t\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tgetAreas(req,resp);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t\tdoGet(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n processRequest(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t\t\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }"
] | [
"0.7004024",
"0.66585696",
"0.66031146",
"0.6510023",
"0.6447109",
"0.64421695",
"0.64405906",
"0.64321136",
"0.6428049",
"0.6424289",
"0.6424289",
"0.6419742",
"0.6419742",
"0.6419742",
"0.6418235",
"0.64143145",
"0.64143145",
"0.6400266",
"0.63939095",
"0.63939095",
"0.639271",
"0.63919044",
"0.63919044",
"0.63903785",
"0.63903785",
"0.63903785",
"0.63903785",
"0.63887113",
"0.63887113",
"0.6380285",
"0.63783026",
"0.63781637",
"0.637677",
"0.63761306",
"0.6370491",
"0.63626",
"0.63626",
"0.63614637",
"0.6355308",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896"
] | 0.0 | -1 |
Handles the HTTP GET method. | @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doGet( )\n {\n \n }",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}",
"void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }",
"public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }",
"public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}",
"@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}",
"public Result get(Get get) throws IOException;",
"@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }",
"@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}",
"@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }",
"@Override\npublic void get(String url) {\n\t\n}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}",
"@NonNull\n public String getAction() {\n return \"GET\";\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }",
"@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }",
"@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }",
"public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }",
"public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}",
"@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}",
"public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }",
"public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}",
"public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}",
"private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}",
"public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }",
"HttpGet getRequest(HttpServletRequest request, String address) throws IOException;",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }",
"@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}",
"@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}",
"private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}"
] | [
"0.7589609",
"0.71665615",
"0.71148175",
"0.705623",
"0.7030174",
"0.70291144",
"0.6995984",
"0.697576",
"0.68883485",
"0.6873811",
"0.6853569",
"0.6843572",
"0.6843572",
"0.6835363",
"0.6835363",
"0.6835363",
"0.68195957",
"0.6817864",
"0.6797789",
"0.67810035",
"0.6761234",
"0.6754993",
"0.6754993",
"0.67394847",
"0.6719924",
"0.6716244",
"0.67054695",
"0.67054695",
"0.67012346",
"0.6684415",
"0.6676695",
"0.6675696",
"0.6675696",
"0.66747975",
"0.66747975",
"0.6669016",
"0.66621476",
"0.66621476",
"0.66476154",
"0.66365504",
"0.6615004",
"0.66130257",
"0.6604073",
"0.6570195",
"0.6551141",
"0.65378064",
"0.6536579",
"0.65357745",
"0.64957607",
"0.64672184",
"0.6453189",
"0.6450501",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.64067316",
"0.6395873",
"0.6379907",
"0.63737476",
"0.636021",
"0.6356937",
"0.63410467",
"0.6309468",
"0.630619",
"0.630263",
"0.63014317",
"0.6283933",
"0.62738425",
"0.62680805",
"0.62585783",
"0.62553537",
"0.6249043",
"0.62457556",
"0.6239428",
"0.6239428",
"0.62376446",
"0.62359244",
"0.6215947",
"0.62125194",
"0.6207376",
"0.62067443",
"0.6204527",
"0.6200444",
"0.6199078",
"0.61876005",
"0.6182614",
"0.61762017",
"0.61755335",
"0.61716276",
"0.6170575",
"0.6170397",
"0.616901"
] | 0.0 | -1 |
Handles the HTTP POST method. | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }",
"public void doPost( )\n {\n \n }",
"@Override\n public String getMethod() {\n return \"POST\";\n }",
"public String post();",
"@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}",
"@Override\n public String getMethod() {\n return \"POST\";\n }",
"public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }",
"protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }",
"public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}",
"public void postData() {\n\n\t}",
"@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}",
"@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }",
"@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public abstract boolean handlePost(FORM form, BindException errors) throws Exception;",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}",
"public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}",
"@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }",
"@Override\n\tvoid post() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }",
"protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}",
"public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}",
"@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }",
"@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}",
"private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }"
] | [
"0.73289514",
"0.71383566",
"0.7116213",
"0.7105215",
"0.7100045",
"0.70236707",
"0.7016248",
"0.6964149",
"0.6889435",
"0.6784954",
"0.67733276",
"0.67482096",
"0.66677034",
"0.6558593",
"0.65582114",
"0.6525548",
"0.652552",
"0.652552",
"0.652552",
"0.65229493",
"0.6520197",
"0.6515622",
"0.6513045",
"0.6512626",
"0.6492367",
"0.64817846",
"0.6477479",
"0.64725804",
"0.6472099",
"0.6469389",
"0.6456206",
"0.6452577",
"0.6452577",
"0.6452577",
"0.6450273",
"0.6450273",
"0.6438126",
"0.6437522",
"0.64339423",
"0.64253825",
"0.6422238",
"0.6420897",
"0.6420897",
"0.6420897",
"0.6407662",
"0.64041835",
"0.64041835",
"0.639631",
"0.6395677",
"0.6354875",
"0.63334197",
"0.6324263",
"0.62959254",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6280875",
"0.6272104",
"0.6272104",
"0.62711537",
"0.62616795",
"0.62544584",
"0.6251865",
"0.62274224",
"0.6214439",
"0.62137586",
"0.621211",
"0.620854",
"0.62023044",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61638993",
"0.61603814",
"0.6148914",
"0.61465937",
"0.61465937",
"0.614548",
"0.6141879",
"0.6136717",
"0.61313903",
"0.61300284",
"0.6124381",
"0.6118381",
"0.6118128",
"0.61063534",
"0.60992104",
"0.6098801",
"0.6096766"
] | 0.0 | -1 |
Returns a short description of the servlet. | @Override
public String getServletInfo() {
return "Short description";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getServletInfo()\n {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo()\n {\n return \"Short description\";\n }",
"@Override\r\n\tpublic String getServletInfo() {\r\n\t\treturn \"Short description\";\r\n\t}",
"@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }"
] | [
"0.8763362",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8531154",
"0.8531154",
"0.85280526",
"0.85280526",
"0.85280526",
"0.8527255",
"0.8527255",
"0.8527255",
"0.8527255",
"0.8527255",
"0.8527255",
"0.8516929",
"0.8512195",
"0.8511082",
"0.8510197",
"0.8496415"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
imageView = (ImageView) arg1.findViewById(R.id.imageView);
Log.d("1111","...............arg1 ="+(String)imageView.getTag());
Intent intent = new Intent(Intent.ACTION_VIEW);
//Uri mUri = Uri.parse("file://" + picFile.getPath());Android3.0以后最好不要通过该方法,存在一些小Bug
file = new File((String)imageView.getTag());
//File file = new File(Environment.getExternalStorageDirectory().toString()+GlobalApp.DOWNLOAD_PATH);
intent.setDataAndType(Uri.fromFile(file), "image/*");
startActivity(intent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
protected void onResume() {
super.onResume();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
protected void onRestart() {
super.onRestart();
//init();
Log.d("1111","on restart");
DisplayMetrics dm = new DisplayMetrics();
this.getWindowManager().getDefaultDisplay().getMetrics(dm);
width = dm.widthPixels;
fileList = FileTools.getUrls(GlobalApp.DOWNLOAD_PATH);
mGridViewAdapter = null;
Log.d("1111","new LocalPhotoAdapter");
mGridViewAdapter = new LocalPhotoAdapter(LocalPhotoWallActivity.this,fileList, mGridView,width);
//mGridViewAdapter.notifyDataSetInvalidated();
mGridView.setAdapter(mGridViewAdapter);
mGridViewAdapter.notifyDataSetInvalidated();
totalNum.setText(fileList.length+" files");
mGridView.invalidate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Add by zhangyanhu 2013.12.2 | @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// DisplayMetrics dm = new DisplayMetrics();
// this.getWindowManager().getDefaultDisplay().getMetrics(dm);
// width = dm.widthPixels;
//mGridViewAdapter = new LocalPhotoAdapter(this, 0, FileTools.getUrls(GlobalApp.DOWNLOAD_PATH), mGridView, width);
//mGridView.setAdapter(mGridViewAdapter);
// try {
// Thread.currentThread().sleep(5000);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
DisplayMetrics dm = new DisplayMetrics();
this.getWindowManager().getDefaultDisplay().getMetrics(dm);
width = dm.widthPixels;
fileList = FileTools.getUrls(GlobalApp.DOWNLOAD_PATH);
mGridViewAdapter = null;
Log.d("1111","new LocalPhotoAdapter");
mGridViewAdapter = new LocalPhotoAdapter(LocalPhotoWallActivity.this,fileList, mGridView,width);
//mGridViewAdapter.notifyDataSetInvalidated();
mGridView.setAdapter(mGridViewAdapter);
mGridViewAdapter.notifyDataSetInvalidated();
totalNum.setText(fileList.length+" files");
mGridView.invalidate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void add() {\n\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"public void add() {\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tpublic void add() {\n\t\t\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"public void initForAddNew() {\r\n\r\n\t}",
"public Curstomers_add() {\n\t\tsuper();\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"private void enableAdd(){\n addSubmit.setDisable(false);\n removeSubmit.setDisable(true);\n setSubmit.setDisable(true);\n addCS.setDisable(false);\n removeCS.setDisable(true);\n setCS.setDisable(true);\n addIT.setDisable(false);\n removeIT.setDisable(true);\n setIT.setDisable(true);\n addECE.setDisable(false);\n removeECE.setDisable(true);\n setECE.setDisable(true);\n partTime.setDisable(false);\n fullTime.setDisable(false);\n management.setDisable(false);\n dateAddText.setDisable(false);\n dateRemoveText.setDisable(true);\n dateSetText.setDisable(true);\n nameAddText.setDisable(false);\n nameRemoveText.setDisable(true);\n nameSetText.setDisable(true);\n hourlyAddText.setDisable(false);\n annualAddText.setDisable(false);\n managerRadio.setDisable(false);\n dHeadRadio.setDisable(false);\n directorRadio.setDisable(false);\n //codeAddText.setDisable(false);\n hoursSetText.setDisable(true);\n }",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}",
"public void mo38117a() {\n }",
"private void add(String thestring) {\n\t\t\n\t}",
"@Override\r\n\tpublic int add() {\n\t\treturn 0;\r\n\t}",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void addMe() {\n\t\t\r\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}",
"void addData();",
"private void strin() {\n\n\t}",
"@Override\r\n\tvoid func04() {\n\t\t\r\n\t}",
"@Override\n\tpublic int add() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int add() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int add() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void addRec() {\n\t\t\n\t}",
"private void add() {\n \t\r\n\tArrayAdapter<String> adp=new ArrayAdapter<String>(this,\r\n\t\tandroid.R.layout.simple_dropdown_item_1line,li);\r\n\t \t\r\n\tadp.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\r\n\tauto.setThreshold(1);\r\n\tauto.setAdapter(adp);\r\n\tsp.setAdapter(adp);\r\n\t\r\n }",
"public void mo4359a() {\n }",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"private void addition()\n\t{\n\t\tFun = Function.ADD;\t//Function set to determine what action should be taken later. \n\t\t\n\t\t\tsetLeftValue();\n\t\t\tentry.grabFocus();\n\t\t\n\t}",
"private zza.zza()\n\t\t{\n\t\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void verarbeite() {\n\t\t\r\n\t}",
"@Override\n public void perish() {\n \n }",
"public final void mo51373a() {\n }",
"private void kk12() {\n\n\t}",
"public void Exterior() {\n\t\t\r\n\t}",
"public void mo55254a() {\n }",
"public void add() {\n\n }",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\tpublic void pausaParaComer() {\n\n\t}",
"@Override\n\tpublic void recreo() {\n\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n public void addCondiments() {\n System.out.println(\"添加柠檬\");\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"public void add() {\n }",
"@Override\npublic void add(VirtualContainer parent, VirtualComponent comp, int pos) {\n\t\n}",
"private void poetries() {\n\n\t}",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"public void mo9848a() {\n }",
"@Override\n public void memoria() {\n \n }",
"@Override\n\tpublic void alterar() {\n\t\t\n\t}",
"public void addcode(String code){//להחליף את סטרינג למחלקה קוד או מזהה מספרי של קוד\r\n mycods.add(code);\r\n }",
"@Override\n\tpublic void insertar() {\n\t\t\n\t}",
"private void addNewSpinnerItem8() \n\t{\n\t\tmscust=ecust.getText().toString();\n\t\tCharSequence textHolder = \"\" +mscust; \n\t\tadapterpao.insert(textHolder, 0);\n\t\tspao.setAdapter(adapterpao);\n\t}",
"private stendhal() {\n\t}",
"public void mo12930a() {\n }",
"@Override\npublic void add(VirtualComponent comp, int pos) {\n\t\n}",
"@Override\n\tpublic void trabajar() {\n\n\t}",
"public void Tyre() {\n\t\t\r\n\t}",
"@Override\n public void onAdded() {\n }",
"@Override\r\n public void add() {\n String ID =id.getText();\r\n String Name =name.getText();\r\n String form_date =date_start.getText();\r\n String to_date =date_finish.getText();\r\n String Status =status.getText();\r\n String MemberID = MemberId.getText();\r\n ArrayList<String> arr = new ArrayList<String>();\r\n arr.add(ID);\r\n arr.add(Name);\r\n arr.add(form_date);\r\n arr.add(to_date);\r\n arr.add(Status);\r\n arr.add(MemberID);\r\n String PathFile = \"/home/yara/Documents/4year/OODP/Task.txt\";\r\n FileFacade facade = new FileFacade();\r\n facade.Add(PathFile, arr);\r\n }",
"private void addClick() {\n\t\tfindViewById(R.id.top_return).setOnClickListener(this);\n\t\tfm1_jhtx.setOnClickListener(this);\n\t\tfm1_sx.setOnClickListener(this);\n\t}",
"public void baocun() {\n\t\t\n\t}",
"protected int addInfo(syntaxMap toAdd){\n if(index == 10){\n return 0;\n }\n else if(index < 5) {\n this.array1[index] = toAdd;\n }\n else{\n this.array2[index - 5] = toAdd;\n }\n ++index;\n return 1;\n }",
"@Override\n\tpublic void nghe() {\n\n\t}",
"void berechneFlaeche() {\n\t}",
"@Override\n\t public void printAdd(int a,int b) { \n\t\t super.printAdd(10,20); \n\t }",
"static void feladat9() {\n\t}",
"@Override\r\n\tpublic void adminSelectAdd() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}",
"@Override\n\tpublic void preInsert() {\n\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"@Override\r\n\t//public void sqlQueryAdd(JComboBox combo, String name, JTextArea textArea, Vector vectorCombo) {\r\n\tpublic void sqlQueryAdd(String name, Vector vectorCombo) {\n\t\ttry {\r\n\t\t\tstatement = conn.prepareStatement(\"INSERT INTO words VALUES(?, ?)\");\t\t\r\n\t\t\tstatement.setString(1, name);\r\n\t\t\tstatement.setString(2, \"put contents here & click Update!\"); \r\n\t // add a word into the words table\r\n\t statement.executeUpdate();\r\n\t \r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\ttextArea.setText(e.getMessage());\r\n\t\t\t\r\n\t\t}\r\n \r\n sqlQueryList(vectorCombo);\r\n comboBox.setSelectedItem(name);\r\n //JOptionPane.showMessageDialog(null, name + \" needs to be updated with contents\");\r\n sqlQueryDisplay(name);\r\n \r\n\t}",
"@Override\r\n\tprotected void initVentajas() {\n\r\n\t}",
"void addingGlobalData() {\n\n }",
"@Override\n\tprotected void interr() {\n\t}",
"private void remplirPrestaraireData() {\n\t}",
"public void skystonePos6() {\n }",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"public void dvAdded()\r\n/* 76: */ {\r\n/* 77:160 */ this.numDVRecords += 1;\r\n/* 78: */ }"
] | [
"0.6772466",
"0.61398643",
"0.61139977",
"0.60786486",
"0.60415125",
"0.6017091",
"0.597813",
"0.59748554",
"0.5952635",
"0.5851756",
"0.58346844",
"0.5805073",
"0.5787952",
"0.57822996",
"0.5729358",
"0.5723782",
"0.5711656",
"0.57065815",
"0.5692447",
"0.5684389",
"0.56710035",
"0.56624794",
"0.56596375",
"0.56540847",
"0.565086",
"0.5640527",
"0.5635796",
"0.5635796",
"0.5633004",
"0.56151223",
"0.56132585",
"0.5586964",
"0.55866003",
"0.55780464",
"0.5572623",
"0.5572623",
"0.5572623",
"0.55642015",
"0.5558687",
"0.5554004",
"0.5541409",
"0.5541164",
"0.5530595",
"0.5528395",
"0.5519546",
"0.5519546",
"0.5519546",
"0.5519546",
"0.5519546",
"0.5519546",
"0.5519546",
"0.55160314",
"0.5509741",
"0.55090714",
"0.550767",
"0.5494987",
"0.5494842",
"0.5491556",
"0.54892415",
"0.54814196",
"0.5462371",
"0.5462025",
"0.5456459",
"0.54552543",
"0.5451997",
"0.5447644",
"0.5447452",
"0.54390997",
"0.5439057",
"0.5434286",
"0.54329187",
"0.5429543",
"0.5424623",
"0.54218256",
"0.5415585",
"0.5405783",
"0.53930575",
"0.53916746",
"0.53765184",
"0.5362087",
"0.53614676",
"0.53564215",
"0.5355901",
"0.53523326",
"0.53523237",
"0.5338778",
"0.5334931",
"0.53343934",
"0.53242606",
"0.5315231",
"0.53143054",
"0.53083485",
"0.53052926",
"0.5302854",
"0.5302838",
"0.5289576",
"0.5287219",
"0.5286861",
"0.5285732",
"0.52796715",
"0.52780133"
] | 0.0 | -1 |
wenn der CameraButton geklickt wird dann wird die Kamera aufgerufen und man kann ein Bild machen | @Override
public void onClick(View v) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void cameraClicked() {\n\t\tif (this.pictureFromCameraString != null\n\t\t\t\t&& !\"\".equals(this.pictureFromCameraString)) {\n\t\t\timageAvailable();\n\t\t} else {\n\t\t\timageUnavailable();\n\t\t}\n\t\tthis.cameraIsActive = true;\n\t\tthis.camera.addStyleDependentName(\"highlighted\");\n\t\tthis.upload.removeStyleDependentName(\"highlighted\");\n\t\tthis.inputPanel.setWidget(this.cameraPanel);\n\t\tgetCameraPictureNative();\n\t}",
"@Override\n public void onClick(View v) {\n int camerasNumber = Camera.getNumberOfCameras();\n if (camerasNumber > 1) {\n //release the old camera instance\n //switch camera, from the front and the back and vice versa\n\n releaseCamera();\n chooseCamera();\n } else {\n\n }\n }",
"@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\tcam.setCamera(getCameraInstance(getDefaultCameraId()));\n\t\t\t\t}",
"@Override\n public void onClick(View v) {\n\n switch (v.getId()) {\n //if cameraBtn is clicked\n case R.id.cameraBtn:\n mDevice = true;\n break;\n //if cameraBtnCloud is clicked\n case R.id.cameraBtnCloud:\n mDevice = false;\n break;\n\n }\n\n /*\n * picture taken from camera\n */\n mGraphicOverlay.clear();\n mCameraView.start();\n mCameraView.captureImage();\n\n }",
"@Override\n public void onClick(View v) {\n if (!previewing) {\n camera = Camera.open();\n if (camera != null) {\n try {\n camera.setPreviewDisplay(surfaceHolder);\n camera.startPreview();\n previewing = true;\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }\n }",
"@Override\n public void onClick(View v) {\n BSelectImage.setVisibility(View.INVISIBLE);\n BCaptureImage.setVisibility(View.INVISIBLE);\n IVPreviewImage.setVisibility(View.INVISIBLE);\n Rotate.setVisibility(View.INVISIBLE);\n Process.setVisibility(View.INVISIBLE);\n\n cameraKitView.setVisibility(View.VISIBLE);\n cameraBtn.setVisibility(View.VISIBLE);\n\n\n\n }",
"protected void dangerButton(View v) {\n if (isPlay) {\n turnOffActions();\n }\n else{\n boolean bool = activateActions();\n if (bool) {\n // launchCamera(View.VISIBLE);\n //right here //////////////////////////////////////////////////////////////////////////////////////\n try {\n camera = Camera.open();\n camera.setDisplayOrientation(90);\n\n } catch (RuntimeException e) {\n return;\n }\n try {\n camera.setPreviewDisplay(surfaceHolder);\n camera.startPreview();\n } catch (Exception e) {\n return;\n }\n }\n }\n }",
"public void onCaptureClick(View button){\n\t\tcamera.takePicture(null, null, this);\n\t}",
"public void toggleButtonImageCamera() {\n if (isCameraOn) {\n btnCamera.setImageResource(R.drawable.cam_on);\n } else {\n btnCamera.setImageResource(R.drawable.cam_off);\n }\n }",
"@Override\n public void onClick(View view) {\n Camera.Parameters parameters = mCamera.getParameters();\n if (flashOn) {\n flash.setImageResource(R.drawable.ic_flash_two);\n parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);\n flashOn = false;\n } else {\n flash.setImageResource(R.drawable.ic_flash);\n parameters.setFlashMode(Camera.Parameters.FLASH_MODE_ON);\n flashOn = true;\n }\n if (nextCam == Camera.CameraInfo.CAMERA_FACING_BACK)\n mCamera.setParameters(parameters);\n }",
"public void onCamera();",
"@Override\r\n\tpublic void onClick(View v) {\n\t\tswitch(v.getId()) {\r\n\t\tcase R.id.qiezi:\r\n\t\t\tmCameraSurfaceView.takePicture();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"@Override\n public void onCameraIdle() {\n if(markerClickflag)\n showMarkerButtons(true);\n\n //Once camera adjusts to the marker, make the marker click flag false. Any newmovement of camera will cause\n //buttons to disappear.\n markerClickflag=false;\n }",
"@Override\n public void run() {\n preview.startAnimation(fadein);\n //Launch camera layout\n camera_linear.startAnimation(fadein);\n //Launch capture button\n captureButton.startAnimation(fadein);\n //Make these components visible\n preview.setVisibility(View.VISIBLE);\n captureButton.setVisibility(View.VISIBLE);\n camera_linear.setVisibility(View.VISIBLE);\n //Create onClickListener for the capture button\n captureButton.setOnClickListener(\n new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n // get an image from the camera\n if(cameraRecorder.getSafeToTakePicture()) {\n Log.i(\"Taking Picture: \", \"Safe\");\n captureButton.setImageResource(R.drawable.kids_ui_record_anim_alt_mini);\n mCamera.takePicture(null, null, mPicture);\n cameraRecorder.setSafeToTakePicture(false);\n }\n\n else {\n Log.i(\"Taking Picture: \", \"Unsafe\");\n }\n }\n }\n );\n\n }",
"public void openCamera() {\n \n\n }",
"@Override\r\n public void onClick(View v) {\n mPhotoImage.setVisibility(View.GONE);\r\n mCameraButton.setVisibility(View.VISIBLE);\r\n mGallaryButton.setVisibility(View.VISIBLE);\r\n mCameraButton.setEnabled(true);\r\n mGallaryButton.setEnabled(true);\r\n mConfirmButton.setEnabled(false);\r\n mPhotoframeText.setText(R.string.upload_photo_label);\r\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tmIsSubCamera = false;\n\t\t\t\tDrawable subCameraDrawableNormal = getResources().getDrawable(\n\t\t\t\t\t\tR.drawable.ftp_subcamera_normal);\n\t\t\t\tsubCameraDrawableNormal.setBounds(0, 0,\n\t\t\t\t\t\tsubCameraDrawableNormal.getMinimumWidth(),\n\t\t\t\t\t\tsubCameraDrawableNormal.getMinimumHeight());\n\t\t\t\tmSubCamera.setCompoundDrawables(null, subCameraDrawableNormal,\n\t\t\t\t\t\tnull, null);\n\n\t\t\t\tDrawable mainCameraDrawableSelect = getResources().getDrawable(\n\t\t\t\t\t\tR.drawable.ftp_camera_select);\n\t\t\t\tmainCameraDrawableSelect.setBounds(0, 0,\n\t\t\t\t\t\tmainCameraDrawableSelect.getMinimumWidth(),\n\t\t\t\t\t\tmainCameraDrawableSelect.getMinimumHeight());\n\t\t\t\tmMainCamera.setCompoundDrawables(null,\n\t\t\t\t\t\tmainCameraDrawableSelect, null, null);\n\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tLog.d(\"Camara\", \"Esta antes de capturar la imagen\");\n\t\t\t\t\t\tmCamera.takePicture(null, null, mPicture);\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"@Override\n \t\t\tpublic void onAutoFocus(boolean success, Camera camera) {\n \t\t\t}",
"@Override\n public void onCameraMove() {\n if(!markerClickflag)\n showMarkerButtons(false);\n }",
"private void turnOnCamera() {\n // play sound\n playSound();\n isCameraOn = true;\n turnOffFlash();\n strobo.setChecked(false);\n previewCamera();\n toggleButtonImageCamera();\n }",
"private void onChooseCamClickEvent() {\n\t\tmBtnChooseCam.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tavcom.venc.SetCamSrc(-1);\n\t\t\t}\n\t\t});\n\t}",
"@Override\n public void onClick(View v) {\n if(captureButton.getText()==\"Take Picture\") {\n // get an image from the camera\n theCamera.takePicture(null, null, takenPicture);\n captureButton.setText(\"Add Mask\");\n }\n //in picture mode, change to mask mode\n else if(captureButton.getText() == \"Add Mask\"){\n //detect faces and count\n FaceDetector face_detector = new FaceDetector(somebmp.getWidth(), somebmp.getHeight(),MAX_FACES);\n faces = new FaceDetector.Face[MAX_FACES];\n num_faces = face_detector.findFaces(somebmp, faces);\n String count_faces = String.valueOf(num_faces);\n Log.i(\"face_detection\",count_faces);\n\n //argb 8888 for quality\n cvsbitmap = Bitmap.createBitmap(somebmp.getWidth(), somebmp.getHeight(),Bitmap.Config.ARGB_8888);\n canvas = new Canvas(cvsbitmap);\n drawMask(canvas);\n captureButton.setText(\"Show Preview\");\n }\n //in mask mode, change to picture mode\n else if(captureButton.getText()==\"Show Preview\") {\n if(num_faces>0)\n //remove mask\n preview.removeView(addMask);\n else\n //remove error\n preview.removeView(errorText);\n theCamera.startPreview();\n captureButton.setText(\"Take Picture\");\n }\n }",
"@Override\n public void onClick(View v) {\n if (camera != null && previewing) {\n camera.stopPreview();\n camera.release();\n camera = null;\n\n previewing = false;\n }\n }",
"@Override\r\n\t\t\tpublic boolean onLongClick(View arg0) {\n\t\t\t\tif(Camera.getNumberOfCameras()>1){\r\n\t\t\t\t\tcameraId = cameraId==0? 1 : 0;\r\n\t\t\t\t\tinitialCamera();\r\n\t\t\t\t\tmyCamera.startPreview();//開始呈現畫面\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}",
"@Override\n public void onClick(View v) {\n if(cameraRecorder.getSafeToTakePicture()) {\n Log.i(\"Taking Picture: \", \"Safe\");\n captureButton.setImageResource(R.drawable.kids_ui_record_anim_alt_mini);\n mCamera.takePicture(null, null, mPicture);\n cameraRecorder.setSafeToTakePicture(false);\n }\n\n else {\n Log.i(\"Taking Picture: \", \"Unsafe\");\n }\n }",
"@Override\n public void onCameraPreviewStarted() {\n enableTorchButtonIfPossible();\n }",
"@Override\r\n public void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.custom_cameraactivity);\r\n mCamera = getCameraInstance();\r\n mCameraPreview = new CameraPreview(this, mCamera);\r\n FrameLayout preview = (FrameLayout) findViewById(R.id.camera_preview);\r\n preview.addView(mCameraPreview);\r\n\r\n Bundle extras = getIntent().getExtras();\r\n looc = extras.getString(\"coor\");\r\n\r\n Button captureButton = (Button) findViewById(R.id.button_capture);\r\n captureButton.setOnClickListener(new View.OnClickListener() {\r\n @Override\r\n public void onClick(View v) {\r\n mCamera.takePicture(null, null, mPicture);\r\n // havent try to use doinbackgroud test first\r\n\r\n }\r\n });\r\n }",
"public void onSwitchCameraClicked(View view) {\n // Switch the camera\n mRtcEngine.switchCamera();\n }",
"@OnClick(R.id.bt_camera)\n public void onClick() {\n rxPermissions.requestEach(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n .subscribe(new Consumer<Permission>() {\n @Override\n public void accept(Permission permission) throws Exception {\n if (permission.granted) {\n// releaseCamera();\n// camera = Camera.open(0);\n// try {\n// camera.setPreviewDisplay(surfaceView.getHolder());\n// camera.startPreview();\n// } catch (IOException e) {\n// Log.e(TAG, \"Error while trying to display the camera preview\", e);\n// }\n ToastUtil.showS(\"已获取到权限\");\n } else if (permission.shouldShowRequestPermissionRationale) {\n // Denied permission without ask never again\n Toast.makeText(mContext,\n \"Denied permission without ask never again\",\n Toast.LENGTH_SHORT).show();\n } else {\n // Denied permission with ask never again\n // Need to go to the settings\n Toast.makeText(mContext,\n \"Permission denied, can't enable the camera\",\n Toast.LENGTH_SHORT).show();\n }\n }\n });\n }",
"public void configureCamera(){\n try{\n camera = Camera.open(findBackFacingCamera());\n } catch (Exception e){}\n\n if(camera != null) {\n cameraView = new CameraView(this.getApplicationContext(), camera);\n FrameLayout camera_view = (FrameLayout)findViewById(R.id.CameraView);\n camera_view.addView(cameraView);\n }\n }",
"private void setCaptureButtonImages()\n\t{\n\t\tif(m_CaptureButtons == null)\n\t\t\treturn;\n\t\tCameraActivity camaraActivity = this.getCameraActivity();\n\t\tif(!Handle.isValid(m_CaptureButtonBgHandle))\n\t\t\tm_CaptureButtonBgHandle = m_CaptureButtons.setPrimaryButtonBackground(camaraActivity.getDrawable(R.drawable.capture_button_slow_motion_border), 0);\n\t\tif(!Handle.isValid(m_CaptureButtonIconHandle))\n\t\t\tm_CaptureButtonIconHandle = m_CaptureButtons.setPrimaryButtonIcon(camaraActivity.getDrawable(R.drawable.capture_button_slow_motion_icon), 0);\n\t}",
"public void updateCamera() {\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tmIsSubCamera = true;\n\t\t\t\tDrawable subCameraDrawableSelect = getResources().getDrawable(\n\t\t\t\t\t\tR.drawable.ftp_subcamera_select);\n\t\t\t\tsubCameraDrawableSelect.setBounds(0, 0,\n\t\t\t\t\t\tsubCameraDrawableSelect.getMinimumWidth(),\n\t\t\t\t\t\tsubCameraDrawableSelect.getMinimumHeight());\n\t\t\t\tmSubCamera.setCompoundDrawables(null, subCameraDrawableSelect,\n\t\t\t\t\t\tnull, null);\n\n\t\t\t\tDrawable mainCameraDrawableNormal = getResources().getDrawable(\n\t\t\t\t\t\tR.drawable.ftp_camera_normal);\n\t\t\t\tmainCameraDrawableNormal.setBounds(0, 0,\n\t\t\t\t\t\tmainCameraDrawableNormal.getMinimumWidth(),\n\t\t\t\t\t\tmainCameraDrawableNormal.getMinimumHeight());\n\t\t\t\tmMainCamera.setCompoundDrawables(null,\n\t\t\t\t\t\tmainCameraDrawableNormal, null, null);\n\t\t\t}",
"@Override\n public void onClick(View v) {\n Cam.takePicture(shutterCallback, null, mPicture);\n// Cam.takePicture();\n }",
"public void setButton() {\n pan.add(playButton);\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tmCamera.takePicture(null, null, mPicture);\r\n\t\t\t\tcaptureButton.setEnabled(false);\r\n\t\t\t}",
"public void toggleCamera() {\n\t\tif (map != null && map.getCameraPosition().zoom != MBDefinition.DEFAULT_ZOOM && carLatLng!=null) {\n\t\t\tmap.moveCamera(CameraUpdateFactory.newLatLngZoom(carLatLng, MBDefinition.DEFAULT_ZOOM));\n\t\t} else if (map != null && carMarker != null && pickupMarker != null) {\n\t\t\tLatLngBounds.Builder builder = new LatLngBounds.Builder();\n\n\t\t\tbuilder.include(carMarker.getPosition());\n\t\t\tbuilder.include(pickupMarker.getPosition());\n\n\t\t\tLatLngBounds bounds = builder.build();\n\n\t\t\tint padding = 150; // offset from edges of the map in pixels\n\t\t\tCameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding);\n\t\t\tmap.moveCamera(cu);\n\t\t}\n\t}",
"private void getControls() {\n mCameraView = findViewById(R.id.camView);\n mCameraButton = findViewById(R.id.cameraBtn);\n mCameraButtonCloud = findViewById(R.id.cameraBtnCloud);\n mGraphicOverlay = findViewById(R.id.graphic_overlay);\n }",
"@Override\n public void onClick(View v) {\n runTakePicture();\n buttonDisappear();\n }",
"@Override\r\n\tpublic void surfaceCreated(SurfaceHolder holder) {\n\t\tinitialCamera();\r\n\t}",
"private void makeButtonVisible() {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n btnDetectObject.setVisibility(View.VISIBLE);\n }\n });\n }",
"public void onClick(ClickEvent event) {\n Camera c = Camera.getCamera();\n if (!Camera.isSupported()) {\n GWT.log(\"Camera not supported!\");\n return;\n }\n c.getPictureFromLibrary(new CameraCallback() {\n public void onSuccess(String picture) {\n GWT.log(\"picture=\" + picture);\n pictureDataHidden.setValue(picture);\n image.setUrl(\"data:image/jpeg;base64,\" + picture);\n }\n\n public void onFailure(String error) {\n GWT.log(\"getPictureFromCamera\" + error);\n }\n });\n }",
"@Override\n public void onClick(View v) {\n if (hangman != null) {\n if (v.getId() == R.id.backgroundButton) {\n hangman.setBackground();\n } else if (v.getId() == R.id.captureButton) {\n isToSaveBitmap = true;\n } else if (v.getId() == R.id.changeCamera) {\n swapCamera();\n }\n }\n }",
"@Override\n public void call(Camera camera) {\n nameEdit.setText(camera.getName());\n nameEdit.setSelectAllOnFocus(true);\n ipEdit.setText(camera.getIp());\n ipEdit.setSelectAllOnFocus(true);\n // Port can be null\n if (camera.getPort() != null) {\n portEdit.setText(camera.getPort().toString());\n portEdit.setSelectAllOnFocus(true);\n }\n // Inversion of axes\n invertXSwitch.setChecked(!camera.isInvertX());\n invertYSwitch.setChecked(camera.isInvertY());\n }",
"void onAutoFocus(boolean success, Camera camera);",
"@Override\r\n\tpublic void surfaceCreated(SurfaceHolder holder) \r\n\t{\n\t\t if (mCamera != null)\r\n\t\t {\r\n\t\t\t Parameters params = mCamera.getParameters();\r\n\t mCamera.setParameters(params);\r\n\t Log.i(\"Surface\", \"Created\");\r\n\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t Toast.makeText(getApplicationContext(), \"Camera not available!\",\r\n\t Toast.LENGTH_LONG).show();\r\n\r\n\t finish();\r\n\t }\r\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsaveCameraImage(true);\n\t\t\t}",
"Camera getCamera();",
"@Override\n public void onFailure(@NonNull Exception e) {\n mCameraButtonCloud.setEnabled(true);\n e.printStackTrace();\n }",
"public void getCameraInstance() {\n newOpenCamera();\n }",
"@Override\n\tpublic void shiftCamera() {\n\t\t\n\t}",
"@Override\n\tpublic void moveCamera() {\n\n\t}",
"@Override\n public void onClick(View arg0) {\n try {\n mPreview.captureImage();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }",
"public void onSwitchCamera(View v) {\n if (mWZCameraView == null) return;\n\n mBtnTorch.setState(false);\n mBtnTorch.setEnabled(false);\n\n WZCamera newCamera = mWZCameraView.switchCamera();\n if (newCamera != null) {\n if (newCamera.hasCapability(WZCamera.FOCUS_MODE_CONTINUOUS))\n newCamera.setFocusMode(WZCamera.FOCUS_MODE_CONTINUOUS);\n\n boolean hasTorch = newCamera.hasCapability(WZCamera.TORCH);\n if (hasTorch) {\n mBtnTorch.setState(newCamera.isTorchOn());\n mBtnTorch.setEnabled(true);\n }\n }\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\n WindowManager.LayoutParams.FLAG_FULLSCREEN);\n getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n setContentView(R.layout.activity_camera2_video_image);\n\n\n BallInspectorx=BallInspectory=600;\n WhiteBalanceBallInspector= BitmapFactory.decodeResource(getResources(),R.mipmap.isopic100);\n SurfaceView surfaceview=(SurfaceView)findViewById(R.id.surfaceView);\n surfaceview.setZOrderOnTop(true);\n final SurfaceHolder holder=surfaceview.getHolder();\n holder.setFormat(PixelFormat.TRANSLUCENT);\n final Surface surface=holder.getSurface();\n surfaceview.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n\n switch (event.getAction()){\n case MotionEvent.ACTION_DOWN:\n BallInspectorx=event.getX();\n BallInspectory=event.getY();\n break;\n case MotionEvent.ACTION_UP:\n BallInspectorx=event.getX();\n BallInspectory=event.getY();\n break;\n case MotionEvent.ACTION_MOVE:\n BallInspectorx=event.getX();\n BallInspectory=event.getY();\n break;\n }\n return true;\n }\n });\n\n\n\n\n MovementButtonn=(ImageButton)findViewById(R.id.MovementButton);\n MovementButtonn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if(MovementButtonnBooleaan){\n MovementButtonnBooleaan=false;\n MovementButtonn.setImageResource(R.drawable.customiso);\n Toast.makeText(getApplicationContext(), \"Movement Thing Turn on\", Toast.LENGTH_SHORT).show();\n }else{\n MovementButtonnBooleaan=true;\n MovementButtonn.setImageResource(R.drawable.flipback);\n Toast.makeText(getApplicationContext(), \"Movement Button Turned Off\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n\n\n\n\n\n\n createVideoFolder();\n createImageFolder();\n mInfoTextView = (TextView)findViewById(R.id.infotextView2);\n\n\n mFocusTextView = (TextView)findViewById(R.id.infoTextView);\n //we have to create a new thread in order to get real time info from ISO SS adn Aperature\n (new Thread(new Runnable() {\n @Override\n public void run() {\n while (!Thread.interrupted()) {\n try {\n Thread.sleep(1000);\n runOnUiThread(new Runnable() {\n @Override\n\n public void run() {\n\n if(surface.isValid()){\n Canvas canvas1=holder.lockCanvas();\n canvas1.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);\n if(!MovementButtonnBooleaan){\n canvas1.drawBitmap(WhiteBalanceBallInspector,BallInspectorx,BallInspectory,null);\n }\n holder.unlockCanvasAndPost(canvas1);\n\n }\n\n String convertSS;\n\n\n if (1000000000 / mCurrentSSvalue <= 1) {\n convertSS = String.valueOf(mCurrentSSvalue / 1000000000);\n } else {\n convertSS = \"1/\" + String.valueOf(1000000000 / mCurrentSSvalue);\n }\n if (1 / mCurrentFocusDistance < 1 / mMaxFocusDistance - 0.1) {\n mInfoTextView.setText(\"ISO: \" + mCurrentISOValue + \"\\t\\t\" + \"Shutter Speed:\" + convertSS + \"\\t\\t\\t\\t\" + \"Focus Distance: \" + String.format(\"%.2f\", 100 / mCurrentFocusDistance) + \" cm\" + \"Faces Detected:\" +\n mNumberofFaces\n\n );\n } else {\n mInfoTextView.setText(\"ISO: \" + mCurrentISOValue + \"\\t\\t\" + \"Shutter Speed: \" + convertSS + \"\\t\\t\\t\\t\\t\" + \"Focus Distance: \" + \"INFINITE\"\n + \"Faces Detected:\" + mNumberofFaces\n ); // this action have to be in UI thread\n }\n }\n });\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n\n }\n })).start();\n\n\n\n\n\n Intent intent = getIntent();\n String action = intent.getAction();\n if (MediaStore.ACTION_IMAGE_CAPTURE.equals(action)) {\n mRequestingAppUri = intent.getParcelableExtra(MediaStore.EXTRA_OUTPUT);\n }\n mMediaRecorder = new MediaRecorder();\n //mIsAuto2=false;\n //this is new\n mTextureView = (TextureView) findViewById(R.id.textureView);\n mStillImageButton = (ImageButton) findViewById(R.id.CameraButton);\n mStillImageButton.setImageResource(R.mipmap.campic);\n mTimeInterval = (TextView) findViewById(R.id.TimeIntervalDisplay);\n\n mChronometer = (Chronometer) findViewById(R.id.chronometer);\n\n mFlipCamera = (ImageButton) findViewById(R.id.FlipButton);\n\n mFlashButtonOnOff = (ImageButton) findViewById(R.id.FlashButton);\n mFlashButtonOnOff.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n\n //Toast.makeText(getApplicationContext(), \"Flash\", Toast.LENGTH_SHORT).show();\n PopupMenu popMenu2 = new PopupMenu(MainActivity.this, mFlashButtonOnOff);\n\n popMenu2.inflate(R.menu.flash_popup_menu);\n popMenu2.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {\n @Override\n public boolean onMenuItemClick(MenuItem item) {\n int position2 = item.getItemId();\n switch (position2) {\n case R.id.FlashOff:\n mFlashButtonOnOff.setImageResource(R.drawable.ic_flash_off_black_24dp);\n mFlashMode = 0;\n startPreview();\n\n\n break;\n case R.id.FlashAuto:\n mFlashButtonOnOff.setImageResource(R.drawable.ic_flash_auto_black_24dp);\n mFlashMode = 1;\n\n\n break;\n case R.id.FlashOn:\n mFlashButtonOnOff.setImageResource(R.drawable.ic_flash_on_black_24dp);\n mFlashMode = 2;\n break;\n case R.id.TorchOn:\n mFlashButtonOnOff.setImageResource(R.drawable.ic_highlight_black_24dp);\n mFlashMode = 3;\n startPreview();\n break;\n\n\n }\n return false;\n }\n });\n\n popMenu2.show();\n\n\n }\n });\n\n\n mFlipCamera.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (FlipNumberBoolean) {\n\n FlipNumberBoolean = false;\n FlipNumber = 0;\n mFlipCamera.setImageResource(R.drawable.flipfront);\n closeCamera();\n stopBackgroundThread();\n\n startBackgroundThread();\n\n if (mTextureView.isAvailable()) {\n setupCamera(mTextureView.getWidth(), mTextureView.getHeight());\n connectCamera();\n\n } else {\n mTextureView.setSurfaceTextureListener(mSurfaceTextureListener);\n }\n } else {\n\n FlipNumberBoolean = true;\n FlipNumber = 1;\n mFlipCamera.setImageResource(R.drawable.flipback);\n closeCamera();\n stopBackgroundThread();\n startBackgroundThread();\n if (mTextureView.isAvailable()) {\n setupCamera(mTextureView.getWidth(), mTextureView.getHeight());\n connectCamera();\n } else {\n mTextureView.setSurfaceTextureListener(mSurfaceTextureListener);\n }\n\n\n }\n }\n });\n\n\n mSettingsbutton = (Button) findViewById(R.id.button);\n mAutobutton = (Button) findViewById(R.id.Auto);\n mAutobutton.setText(\"AUTO ON\");\n mAutobutton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (AutoNumber == 0) {\n AutoNumber = 1;\n Toast.makeText(getApplicationContext(), \"AUTO OFF\", Toast.LENGTH_SHORT).show();\n mAutobutton.setText(\"AUTO OFF\");\n\n } else if (AutoNumber == 1) {\n AutoNumber = 0;\n Toast.makeText(getApplicationContext(), \"AUTO ON\", Toast.LENGTH_SHORT).show();\n mAutobutton.setText(\"AUTO ON\");\n startPreview();\n\n\n } else if (AutoNumber == 2) {\n AutoNumber = 0;\n Toast.makeText(getApplicationContext(), \"SceneAutoOff\", Toast.LENGTH_SHORT).show();\n mAutobutton.setText(\"AUTO ON\");\n startPreview();\n\n }\n }\n\n });\n\n mAutobutton.setOnLongClickListener(new View.OnLongClickListener() {\n @Override\n public boolean onLongClick(View v) {\n AutoNumber = 2;\n\n Toast.makeText(getApplicationContext(), \"AutoNumber now 2\", Toast.LENGTH_SHORT).show();\n mAutobutton.setText(\"AUTO SCENE\");\n startPreview();\n\n return true;\n }\n });\n\n\n\n mSettingsbutton.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View view) {\n menuonline = true;\n\n\n\n\n\n\n\n //Toast.makeText(MainActivity.this, \"clicked\", Toast.LENGTH_SHORT).show();\n PopupMenu popupMenu = new PopupMenu(MainActivity.this, mSettingsbutton);\n popupMenu.getMenuInflater().inflate(R.menu.popup_menu, popupMenu.getMenu());\n SubMenu sM = popupMenu.getMenu().addSubMenu(0, 100, 0, \"Change Resolution:\");\n SubMenu submenu2 = popupMenu.getMenu().addSubMenu(0,100, 0, \"Available Effects\");\n\n\n StreamConfigurationMap scmap = mCameraCharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);\n\n final Size previewSizes[] = scmap.getOutputSizes(ImageFormat.JPEG);\n\n for (int i = 0; i < previewSizes.length; i++) {\n sM.add(0, i + 200, 0, \"\" + previewSizes[i]);\n }\n\n\n final int[] SupportedSceneModes = new int[mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES).length];\n\n\n for (int i = 0; i < SupportedSceneModes.length; i++) {\n SupportedSceneModes[i] = mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES)[i];\n\n }\n final int[] AvailableEffectsArray1=new int[mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS).length];\n for (int i=0; i<AvailableEffectsArray1.length; i++){\n AvailableEffectsArray1[i]=(mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS)[i]);\n }\n final String[] AvailableEffectsArray2=new String[AvailableEffectsArray1.length];\n for (int i=0; i<AvailableEffectsArray1.length; i++){\n if(AvailableEffectsArray1[i]==0){\n AvailableEffectsArray2[i]=\"OFF\";\n }\n if(AvailableEffectsArray1[i]==1){\n AvailableEffectsArray2[i]=\"Mono\";\n }\n if(AvailableEffectsArray1[i]==2){\n AvailableEffectsArray2[i]=\"Negative\";\n }\n if(AvailableEffectsArray1[i]==3){\n AvailableEffectsArray2[i]=\"Solarize\";\n }\n if(AvailableEffectsArray1[i]==4){\n AvailableEffectsArray2[i]=\"Sepia\";\n }\n if(AvailableEffectsArray1[i]==5){\n AvailableEffectsArray2[i]=\"Posterize\";\n }\n if(AvailableEffectsArray1[i]==6){\n AvailableEffectsArray2[i]=\"Whiteboard\";\n }\n if(AvailableEffectsArray1[i]==7){\n AvailableEffectsArray2[i]=\"Blackboard\";\n }\n if(AvailableEffectsArray1[i]==8){\n AvailableEffectsArray2[i]=\"Aqua\";\n }\n submenu2.add(0, i + 100, 0, \"\" + AvailableEffectsArray2[i]);\n\n }\n\n\n popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {\n @Override\n public boolean onMenuItemClick(MenuItem item) {\n //add settings\n int position = item.getItemId();\n for (int i = 0; i < previewSizes.length; i++) {\n if (position == 200 + i) {\n Toast.makeText(getApplicationContext(), \"\" + previewSizes[i], Toast.LENGTH_SHORT).show();\n adjustAspectRatio(previewSizes[i].getHeight(), previewSizes[i].getWidth());\n setupCamera(previewSizes[i].getHeight(), previewSizes[i].getWidth());\n startPreview();\n\n }\n }\n for (int i=0; i<AvailableEffectsArray2.length; i++){\n if(position== 100+i) {\n mCameraEffect = AvailableEffectsArray1[i];\n startPreview();\n }\n\n }\n\n\n final Range<Long> ShutterSpeed = mCameraCharacteristics.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE);\n final long ShutterSpeed1 = (ShutterSpeed.getLower());\n\n final long ShutterSpeed2 = (ShutterSpeed.getUpper());\n //Toast.makeText(getApplicationContext(), \"ShutterSpeedMax: \"+ ShutterSpeed2, Toast.LENGTH_LONG).show();\n double ShutterSpeed1Double = (double) ShutterSpeed1 / 1000000000;\n double ShutterSpeed2Double = (double) ShutterSpeed2 / 1000000000;\n //trying to convert to fractions\n double x = 1 / ShutterSpeed1Double;\n if (ShutterSpeed2Double <= 1) {\n double y = 1 / ShutterSpeed2Double;\n ShutterSpeed2String = (\"1\" + \"/\" + (int) y);\n } else {\n double y = ShutterSpeed2Double;\n ShutterSpeed2String = (\"\" + (int) y);\n\n }\n ShutterSpeed1String = (\"1\" + \"/\" + (int) x);\n //since ShutterSpeed1 is usually a fraction anyways\n\n mISOtext = (EditText) findViewById(R.id.ISOtext);\n if (ISOvalue == 0) {\n mISOtext.setText(\"ISO:AUTO\");\n }\n\n final Range<Integer> ISOrange = mCameraCharacteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE);\n final int LowestISO = ISOrange.getLower();\n final int HighestISO = ISOrange.getUpper();\n\n\n mChangeFocusSeekBar = (SeekBar) findViewById(R.id.FocusChangeSeekBar);\n mChangeFocusSeekBar.setMax((int) ((int) (1/mMaxFocusDistance - 1/mMinFocusDistance)/0.05));\n\n mCloseALLbutton = (ImageButton) findViewById(R.id.CloseALLbutton);\n mCloseALLbutton.setVisibility(View.VISIBLE);\n mSeekbar = (SeekBar) findViewById(R.id.seekBar);\n mISOseekbar = (SeekBar) findViewById(R.id.ISOseekbar);\n mTextSeekBar = (EditText) findViewById(R.id.editText);\n mMinimumShutterSpeed = (EditText) findViewById(R.id.MinimumShutterSpeed);\n mMaximumShutterSpeed = (EditText) findViewById(R.id.MaximumShutterSpeed);\n\n\n mCloseALLbutton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (mISOtext.getVisibility() == View.VISIBLE) {\n mISOtext.setVisibility(View.INVISIBLE);\n }\n if(mFocusTextView.getVisibility()==View.VISIBLE){\n mFocusTextView.setVisibility(View.INVISIBLE);\n }\n if(mInfoTextView.getVisibility() == View.VISIBLE){\n mInfoTextView.setVisibility(View.INVISIBLE);\n }\n\n if (mSeekbar.getVisibility() == View.VISIBLE) {\n mSeekbar.setVisibility(View.INVISIBLE);\n }\n if (mISOseekbar.getVisibility() == View.VISIBLE) {\n mISOseekbar.setVisibility(View.INVISIBLE);\n }\n if (mTextSeekBar.getVisibility() == View.VISIBLE) {\n mTextSeekBar.setVisibility(View.INVISIBLE);\n }\n if (mMinimumShutterSpeed.getVisibility() == View.VISIBLE) {\n mMinimumShutterSpeed.setVisibility(View.INVISIBLE);\n }\n if (mMaximumShutterSpeed.getVisibility() == View.VISIBLE) {\n mMaximumShutterSpeed.setVisibility(View.INVISIBLE);\n }\n if (mChangeFocusSeekBar.getVisibility() == View.VISIBLE) {\n mChangeFocusSeekBar.setVisibility(View.INVISIBLE);\n }\n if (mTimeInterval.getVisibility() == View.VISIBLE) {\n mTimeInterval.setVisibility(View.INVISIBLE);\n }\n mCloseALLbutton.setVisibility(View.INVISIBLE);\n\n\n }\n });\n //mRawCheckBox = (CheckBox) findViewById(R.id.RawInput);\n\n switch (position) {\n case R.id.LockAutoFocus:\n\n if (!BooleanAutoFocusLock) {\n BooleanAutoFocusLock = true;\n Toast.makeText(getApplicationContext(), \"AutoFocus lock Enabled\", Toast.LENGTH_SHORT).show();\n //UnlockFocusSpecialBooleanCaptureon=true;\n\n\n\n startPreview();\n\n\n } else if (BooleanAutoFocusLock) {\n BooleanAutoFocusLock = false;\n Toast.makeText(getApplicationContext(), \"AutoFocus Unlock Enabled\", Toast.LENGTH_SHORT).show();\n\n //mFocusTextView.setVisibility(View.INVISIBLE);\n\n\n UnlockFocusSpecialBooleanCaptureon=false;\n startPreview();\n /*\n\n unLockFocus();\n startPreview();*/\n\n }\n break;\n case R.id.OpticalStabilizationInput:\n if (BooleanOpticalStabilizationOn) {\n BooleanOpticalStabilizationOn = false;\n\n Toast.makeText(getApplicationContext(), \"Optical Stabilization Disabled\", Toast.LENGTH_SHORT).show();\n } else if (!BooleanOpticalStabilizationOn) {\n BooleanOpticalStabilizationOn = true;\n Toast.makeText(getApplicationContext(), \"Optical Stabilization Enabled\", Toast.LENGTH_SHORT).show();\n\n }\n\n startPreview();\n\n\n break;\n\n case R.id.manualFocus:\n if (!mUnlockFocus) {\n mUnlockFocus = true;\n mFocusTextView.setVisibility(View.VISIBLE);\n Toast.makeText(getApplicationContext(), \"Manual Focus Activated\", Toast.LENGTH_SHORT).show();\n\n startPreview();\n } else if (mUnlockFocus) {\n mUnlockFocus = false;\n mFocusTextView.setVisibility(View.INVISIBLE);\n Toast.makeText(getApplicationContext(), \"Auto Focus Enabled\", Toast.LENGTH_SHORT).show();\n startPreview();\n }\n if (mChangeFocusSeekBar.getVisibility() == View.VISIBLE) {\n mChangeFocusSeekBar.setVisibility(View.INVISIBLE);\n } else if (mChangeFocusSeekBar.getVisibility() == View.INVISIBLE) {\n\n mChangeFocusSeekBar.setVisibility(View.VISIBLE);\n mChangeFocusSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n mFocusDistance = (progress * 0.05);\n mFocusTextView.setText(String.format( \"Focal Distance: \"+\"%.2f\",mFocusDistance)+\"m\");\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n startPreview();\n\n }\n });\n }\n //startPreview();\n break;\n case R.id.manualinputFocus:\n\n //Toast.makeText(getApplicationContext(), \"Not implemented yet\", Toast.LENGTH_SHORT).show();\n LayoutInflater inflate5 = LayoutInflater.from(MainActivity.this);\n View ThemanualinputView= inflate5.inflate(R.layout.manual_focus_input, null);\n AlertDialog.Builder manualinputalert= new AlertDialog.Builder(MainActivity.this);\n manualinputalert.setTitle(\"Manual Focus Input\");\n manualinputalert.setView(ThemanualinputView);\n manualinputalert.setCancelable(true);\n mManualFocusInput= (EditText) ThemanualinputView.findViewById(R.id.FocusEditText);\n manualinputalert.setNegativeButton(\"Close\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n\n }\n });\n manualinputalert.setPositiveButton(\"Confirm\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n if (!mUnlockFocus) {\n mUnlockFocus = true;\n mFocusTextView.setVisibility(View.VISIBLE);\n Toast.makeText(getApplicationContext(), \"Manual Focus Activated\", Toast.LENGTH_SHORT).show();\n\n\n } else if (mUnlockFocus) {\n mUnlockFocus = false;\n mFocusTextView.setVisibility(View.INVISIBLE);\n Toast.makeText(getApplicationContext(), \"Auto Focus Enabled\", Toast.LENGTH_SHORT).show();\n\n }\n\n double TempManualFocusInput= Double.parseDouble(mManualFocusInput.getText().toString());\n mFocusTextView.setText(TempManualFocusInput+\"\");\n mFocusDistance=TempManualFocusInput;\n\n }\n });\n manualinputalert.show();\n startPreview();\n\n\n\n\n\n break;\n case R.id.PhotoBurstInput:\n\n final LayoutInflater inflate4 = LayoutInflater.from(MainActivity.this);\n final View ThePhotoBurstView = inflate4.inflate(R.layout.photo_burst_input, null);\n final AlertDialog.Builder PhotoBurstInputthing = new AlertDialog.Builder(MainActivity.this);\n PhotoBurstInputthing.setTitle(\"Photo Burst Input:\");\n PhotoBurstInputthing.setView(ThePhotoBurstView);\n PhotoBurstInputthing.setCancelable(true);\n mPhotoBurstText = (EditText) ThePhotoBurstView.findViewById(R.id.PhotoBurstEditText);\n\n mPhotoBurstLimitText = (EditText) ThePhotoBurstView.findViewById(R.id.PhotoBurstTimeLimitInputEditText);\n PhotoBurstInputthing.setNegativeButton(\"Close\", new DialogInterface.OnClickListener() {\n\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n PhotoBurstInputthing.setPositiveButton(\"Confirm\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n int TempSecondInterval = Integer.parseInt(mPhotoBurstText.getText().toString());\n SecondStep = TempSecondInterval;\n if (mPhotoBurstLimitText.getText().toString().isEmpty()) {\n mPhotoTimeLimitNumber = 1;\n\n } else {\n mPhotoTimeLimitNumber = 0;\n int TempTimeLimit = Integer.parseInt(mPhotoBurstLimitText.getText().toString());\n PhotoBurstTimeStop = TempTimeLimit;\n }\n }\n });\n\n PhotoBurstInputthing.show();\n\n\n break;\n case R.id.VideoTimeLapseInput:\n LayoutInflater inflate3 = LayoutInflater.from(MainActivity.this);\n View TheVideoTimelapseview = inflate3.inflate(R.layout.video_timelapse_input, null);\n AlertDialog.Builder VideoLapseInputthing = new AlertDialog.Builder(MainActivity.this);\n VideoLapseInputthing.setTitle(\"Video timelapse Input:\");\n VideoLapseInputthing.setView(TheVideoTimelapseview);\n VideoLapseInputthing.setCancelable(true);\n mVideoTimelapse = (EditText) TheVideoTimelapseview.findViewById(R.id.VideoTimeLapseEditText);\n VideoLapseInputthing.setNegativeButton(\"Close\", new DialogInterface.OnClickListener() {\n\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n VideoLapseInputthing.setPositiveButton(\"Confirm\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n int TempSecondInterval = Integer.parseInt(mVideoTimelapse.getText().toString());\n VideoTimelapsSecondStep = TempSecondInterval;\n\n\n }\n });\n\n VideoLapseInputthing.show();\n\n\n break;\n\n case R.id.WhiteBalanceCloudyDaylight:\n mWBMode = CONTROL_AWB_MODE_CLOUDY_DAYLIGHT;\n startPreview();\n break;\n case R.id.WhiteBalanceDaylight:\n mWBMode = CONTROL_AWB_MODE_DAYLIGHT;\n startPreview();\n break;\n case R.id.WhiteBalanceFluorescent:\n mWBMode = CONTROL_AWB_MODE_FLUORESCENT;\n startPreview();\n break;\n case R.id.WhiteBalanceShade:\n mWBMode = CONTROL_AWB_MODE_SHADE;\n startPreview();\n break;\n case R.id.WhiteBalanceTwilight:\n mWBMode = CONTROL_AWB_MODE_TWILIGHT;\n startPreview();\n break;\n case R.id.WhiteBalanceWarmFluorescent:\n mWBMode = CONTROL_AWB_MODE_WARM_FLUORESCENT;\n startPreview();\n break;\n case R.id.WhiteBalanceIncandenscent:\n mWBMode = CONTROL_AWB_MODE_INCANDESCENT;\n startPreview();\n break;\n case R.id.WhiteBalanceAuto:\n if (mWBMode != CONTROL_AWB_MODE_AUTO) {\n mWBMode = CONTROL_AWB_MODE_AUTO;\n } else {\n Toast.makeText(getApplicationContext(), \"AUTO is already on\", Toast.LENGTH_SHORT).show();\n }\n startPreview();\n break;\n case R.id.ChangeISO:\n\n\n mISOtext.setVisibility(View.VISIBLE);\n break;\n\n case R.id.ISO100:\n\n //Toast.makeText(getApplicationContext(), \"100 ISO\", Toast.LENGTH_SHORT).show();\n ISOvalue = 100;\n mISOtext.setText(\"ISO:\" + ISOvalue);\n\n startPreview();\n break;\n case R.id.ISO200:\n ISOvalue = 200;\n\n mISOtext.setText(\"ISO:\" + ISOvalue);\n startPreview();\n break;\n case R.id.ISO400:\n ISOvalue = 400;\n mISOtext.setText(\"ISO:\" + ISOvalue);\n startPreview();\n\n //Toast.makeText(getApplicationContext(), \"400 ISO\", Toast.LENGTH_SHORT).show();\n break;\n case R.id.ISO800:\n ISOvalue = 800;\n mISOtext.setText(\"ISO:\" + ISOvalue);\n startPreview();\n\n //Toast.makeText(getApplicationContext(), \"800\", Toast.LENGTH_SHORT).show();\n break;\n case R.id.ISO1600:\n ISOvalue = 1600;\n mISOtext.setText(\"ISO:\" + ISOvalue);\n startPreview();\n //Toast.makeText(getApplicationContext(), \"1600\", Toast.LENGTH_SHORT).show();\n break;\n case R.id.customISO:\n Toast.makeText(getApplicationContext(), \"Custom ISO\", Toast.LENGTH_SHORT).show();\n\n mISOseekbar.setVisibility(View.VISIBLE);\n\n mISOseekbar.setMax((int) HighestISO - LowestISO);\n\n mISOseekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n progress = ISOprogressValue;\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n mISOtext.setText(\"ISO:\" + (mISOseekbar.getProgress() + LowestISO));\n ISOseekProgress = (mISOseekbar.getProgress() + LowestISO);\n ISOvalue = ISOseekProgress;\n startPreview();\n\n }\n });\n\n startPreview();\n break;\n case R.id.custominputISO:\n\n\n LayoutInflater inflater = LayoutInflater.from(MainActivity.this);\n final View subsubView = inflater.inflate(R.layout.manual_input_alertdialog, null);\n final AlertDialog.Builder manualISODialog = new AlertDialog.Builder(MainActivity.this);\n\n\n mISOEditText = (EditText) subsubView.findViewById(R.id.isoEditText);\n mISOEditTextView = (TextView) subsubView.findViewById(R.id.isoTitle);\n mISOEditTextView.setText(\"ISO Range:\" + LowestISO + \"to\" + HighestISO);\n manualISODialog.setTitle(\"Manual ISO Input\");\n manualISODialog.setView(subsubView);\n manualISODialog.setCancelable(true);\n manualISODialog.setNegativeButton(\"Close\", new DialogInterface.OnClickListener() {\n\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n manualISODialog.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n int tempISO = Integer.parseInt(mISOEditText.getText().toString());\n if (tempISO <= HighestISO && tempISO >= LowestISO) {\n ISOvalue = tempISO;\n mISOtext.setText(\"ISO:\" + ISOvalue);\n startPreview();\n return;\n } else {\n Toast.makeText(getApplicationContext(), \"ISO value is out of range\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n manualISODialog.show();\n\n break;\n case R.id.ChangeShutterSpeedSeek:\n\n mSeekbar.setVisibility(View.VISIBLE);\n mSeekbar.setProgress(progressValue);\n\n mTextSeekBar.setVisibility(View.VISIBLE);\n if (ShutterSpeed2Double < 1) {\n mSeekbar.setMax((int) (ShutterSpeed2 - ShutterSpeed1));\n } else {\n //Working on a precision bar for camera's with higher shutter speed capacity\n Toast.makeText(getApplicationContext(), \"Precision Option Available\", Toast.LENGTH_SHORT).show();\n mSeekBar2 = (SeekBar) findViewById(R.id.seekBar2);\n mSeekBar2.setVisibility(View.VISIBLE);\n mSeekbar.setMax((int) Math.round(ShutterSpeed2Double));\n mTextSeekBar.setText(\"Shutter Speed(in s)\");\n }\n\n //Note:The SeekBar can only take Interger Values. If ShutterSpeed2-ShutterSpeed1==0 then the ShutterSpeed difference is too great\n //Integers can\n //mSeekbar.setProgress(100000);\n\n mMinimumShutterSpeed.setVisibility(View.VISIBLE);\n mMinimumShutterSpeed.setText(ShutterSpeed1String);\n\n mMaximumShutterSpeed.setVisibility(View.VISIBLE);\n mMaximumShutterSpeed.setText(ShutterSpeed2String);\n mSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n\n progress = progressValue;\n\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n //Toast.makeText(getApplicationContext(), \"Start\", Toast.LENGTH_SHORT).show();\n\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n mTextSeekBar.setText(\"Shutter Speed(in ns):\" + (mSeekbar.getProgress() + ShutterSpeed1) + \"/\" + Math.round(mSeekbar.getMax() + ShutterSpeed1));\n Toast.makeText(getApplicationContext(), \"Setting Shutter Speed\", Toast.LENGTH_SHORT).show();\n ShutterSpeedValue = (mSeekbar.getProgress() + ShutterSpeed1);\n\n startPreview();\n }\n });\n\n\n break;\n case R.id.ChangeShutterSpeedInput:\n\n\n LayoutInflater inflater3 = LayoutInflater.from(MainActivity.this);\n final View ChangeShutterSpeedView = inflater3.inflate(R.layout.shutterspeed_input_alertdialog, null);\n final AlertDialog.Builder manualShutterSpeedDialog = new AlertDialog.Builder(MainActivity.this);\n mShutterSpeedEditText = (EditText) ChangeShutterSpeedView.findViewById(R.id.ShutterSpeedEditText);\n mShutterSpeedEditTextView = (TextView) ChangeShutterSpeedView.findViewById(R.id.ShutterSpeedTitle);\n mShutterSpeedEditTextView.setText(\"ShutterSpeed Range: \" + ShutterSpeed1 + \" to \" + ShutterSpeed2);\n manualShutterSpeedDialog.setTitle(\"Manual Shutter Speed Input\");\n manualShutterSpeedDialog.setView(ChangeShutterSpeedView);\n manualShutterSpeedDialog.setCancelable(true);\n manualShutterSpeedDialog.setNegativeButton(\"Close\", new DialogInterface.OnClickListener() {\n\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n\n\n manualShutterSpeedDialog.setPositiveButton(\"Confirm \", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n int tempShutterSpeed = Integer.parseInt(mShutterSpeedEditText.getText().toString());\n if (tempShutterSpeed <= ShutterSpeed2 && tempShutterSpeed >= ShutterSpeed1) {\n ShutterSpeedValue = tempShutterSpeed;\n //.setText(\"ISO:\"+ ISOvalue);\n startPreview();\n return;\n } else {\n Toast.makeText(getApplicationContext(), \"ShutterSpeed value is out of range\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n manualShutterSpeedDialog.show();\n\n break;\n case R.id.ChangeShutterSpeedInput2:\n LayoutInflater inflater4 = LayoutInflater.from(MainActivity.this);\n final View ChangeShutterSpeedView2 = inflater4.inflate(R.layout.shutterspeed_input_alertdialog2, null);\n final AlertDialog.Builder manualShutterSpeedDialog2 = new AlertDialog.Builder(MainActivity.this);\n mShutterSpeedEditText2 = (EditText) ChangeShutterSpeedView2.findViewById(R.id.ShutterSpeedEditText2);\n mShutterSpeedEditTextView2 = (TextView) ChangeShutterSpeedView2.findViewById(R.id.ShutterSpeedTitle2);\n mShutterSpeedEditTextView2.setText(\"ShutterSpeed Range: \" + ShutterSpeed1String + \" to \" + ShutterSpeed2String);\n manualShutterSpeedDialog2.setTitle(\"Manual Shutter Speed Input\");\n manualShutterSpeedDialog2.setView(ChangeShutterSpeedView2);\n manualShutterSpeedDialog2.setCancelable(true);\n manualShutterSpeedDialog2.setNegativeButton(\"Close\", new DialogInterface.OnClickListener() {\n\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n\n\n manualShutterSpeedDialog2.setPositiveButton(\"Confirm \", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n String tempShutterSpeedString[] = new String[2];\n String tt;\n tt = mShutterSpeedEditText2.getText().toString();\n\n //make regex if statement here to satify numbers numbers greater than 1\n tempShutterSpeedString = tt.split(\"/\");\n double tempShutterSpeed1 = Double.parseDouble(tempShutterSpeedString[0]);\n double tempShutterSpeed2 = Double.parseDouble(tempShutterSpeedString[1]);\n\n double tempShutterSpeed = ((tempShutterSpeed1 / tempShutterSpeed2) * 1000000000);\n if (tempShutterSpeed <= ShutterSpeed2 && tempShutterSpeed >= ShutterSpeed1) {\n ShutterSpeedValue = (long) tempShutterSpeed;\n //.setText(\"ISO:\"+ ISOvalue);\n startPreview();\n return;\n } else {\n Toast.makeText(getApplicationContext(), \"ShutterSpeed value is out of range\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n manualShutterSpeedDialog2.show();\n\n\n break;\n\n case R.id.getCameraInfo:\n LayoutInflater inflater2 = LayoutInflater.from(MainActivity.this);\n View cameraInfoSubView = inflater2.inflate(R.layout.camera_info_alertdialog, null);\n mCameraInfoTextView = (TextView) cameraInfoSubView.findViewById(R.id.cameraInfoTextView);\n mCameraInfoTextView.setText(\"Camera Resolutions;\");\n mCameraInfoTextView.setMovementMethod(new ScrollingMovementMethod());\n mCameraInfoTextView2 = (TextView) cameraInfoSubView.findViewById(R.id.cameraInfoTextView2);\n mCameraInfoTextView2.setText(\"Supported Camera Scenes:\");\n mCameraInfoTextView2.setMovementMethod(new ScrollingMovementMethod());\n mCameraInfoTextView3 = (TextView) cameraInfoSubView.findViewById(R.id.cameraInfoTextView3);\n mCameraInfoTextView3.setText(\"Supported Effects:\");\n mCameraInfoTextView3.setMovementMethod(new ScrollingMovementMethod());\n mCameraInfoTextView4 = (TextView) cameraInfoSubView.findViewById(R.id.cameraInfoTextView4);\n mCameraInfoTextView4.setText(\"Supported Face Detections\");\n mCameraInfoTextView4.setMovementMethod(new ScrollingMovementMethod());\n\n\n AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);\n builder.setTitle(\"Camera Information\");\n builder.setMessage(\"Shutter Speed Information(in s):\" + ShutterSpeed1String + \"-\" + ShutterSpeed2String + \"\\n\" + \"ISO Range:\" + mCameraCharacteristics.get(mCameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE)\n + \"\\n\" + \"White Level:\" + mCameraCharacteristics.get(mCameraCharacteristics.SENSOR_INFO_WHITE_LEVEL) + \"\\n\" + \"Sensor Physical Size: \" + mCameraCharacteristics.get(mCameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE)\n + \"\\n\" + \"Sensor Max Analog Sensitivity:\" + mCameraCharacteristics.get(mCameraCharacteristics.SENSOR_MAX_ANALOG_SENSITIVITY)\n + \"\\n\" + \"Standard reference illuminant:\" + mCameraCharacteristics.get(mCameraCharacteristics.SENSOR_REFERENCE_ILLUMINANT1)\n + \"\\n\" + \"Camera Compensation Range:\" + mCameraCharacteristics.get(mCameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE)\n + \"\\n\" + \"Flash Available: \" + mCameraCharacteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE)\n + \"\\n\" + \"Supported Available Burst Capabilities:\" + contains(mCameraCharacteristics.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES), CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE)\n\n );\n for (int i = 0; i < previewSizes.length; i++) {\n String oldTextView = mCameraInfoTextView.getText().toString();\n String newText = oldTextView + \" , \" + previewSizes[i] + \"\"; // can manipulate using substring also\n mCameraInfoTextView.setText(newText);\n }\n for (int i = 0; i < mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES).length; i++) {\n String oldTextView2 = mCameraInfoTextView2.getText().toString();\n String newText2 = oldTextView2 + \"\" + mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES)[i] + \" , \";\n mCameraInfoTextView2.setText(newText2);\n }\n for (int i=0; i< mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS).length; i++)\n {\n String oldTextView3 = mCameraInfoTextView3.getText().toString();\n String newText3 = oldTextView3 + \"\" + mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS)[i] + \" , \";\n mCameraInfoTextView3.setText(newText3);\n }\n builder.setView(cameraInfoSubView);\n\n builder.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n });\n String oldTextView4 = mCameraInfoTextView4.getText().toString();\n\n mCameraInfoTextView4.setText(oldTextView4+ \" \"+ OFFtext+\", \"+SIMPLEtext+\"\"+FULLtext+\"\" );\n\n\n\n AlertDialog alertDialog2 = builder.create();\n alertDialog2.show();\n break;\n case R.id.ChangeScene:\n if (SupportedSceneModes[0] == 0) {\n Toast.makeText(getApplicationContext(), \"No Supported Scene Modes\", Toast.LENGTH_SHORT).show();\n }\n\n break;\n case R.id.ChangeSceneDisabled:\n mSceneMode = CONTROL_SCENE_MODE_DISABLED;\n startPreview();\n break;\n case R.id.ChangeSceneFacePriority:\n mSceneMode = CONTROL_SCENE_MODE_FACE_PRIORITY;\n startPreview();\n break;\n case R.id.ChangeSceneAction:\n mSceneMode = CONTROL_SCENE_MODE_ACTION;\n startPreview();\n break;\n case R.id.ChangeSceneBarcode:\n mSceneMode = 16;\n startPreview();\n break;\n case R.id.ChangeSceneBeach:\n mSceneMode = CONTROL_SCENE_MODE_BEACH;\n startPreview();\n break;\n case R.id.ChangeSceneCandlelight:\n mSceneMode = CONTROL_SCENE_MODE_CANDLELIGHT;\n startPreview();\n break;\n case R.id.ChangeSceneFireworks:\n mSceneMode = CONTROL_SCENE_MODE_FIREWORKS;\n startPreview();\n break;\n case R.id.ChangeSceneHDR:\n mSceneMode = CONTROL_SCENE_MODE_HDR;\n startPreview();\n break;\n case R.id.ChangeSceneLandscape:\n mSceneMode = CONTROL_SCENE_MODE_LANDSCAPE;\n startPreview();\n break;\n case R.id.ChangeSceneNight:\n mSceneMode = CONTROL_SCENE_MODE_NIGHT;\n startPreview();\n break;\n case R.id.ChangeSceneNightPortrait:\n mSceneMode = CONTROL_SCENE_MODE_NIGHT_PORTRAIT;\n startPreview();\n break;\n case R.id.ChangeSceneParty:\n mSceneMode = CONTROL_SCENE_MODE_PARTY;\n startPreview();\n break;\n case R.id.ChangeScenePortrait:\n mSceneMode = CONTROL_SCENE_MODE_PORTRAIT;\n startPreview();\n break;\n case R.id.ChangeSceneSnow:\n mSceneMode = CONTROL_SCENE_MODE_SNOW;\n startPreview();\n break;\n case R.id.ChangeSceneSports:\n mSceneMode = CONTROL_SCENE_MODE_SPORTS;\n startPreview();\n break;\n case R.id.ChangeSceneSteadyphoto:\n mSceneMode = CONTROL_SCENE_MODE_STEADYPHOTO;\n startPreview();\n break;\n case R.id.ChangeSceneSunset:\n mSceneMode = CONTROL_SCENE_MODE_SUNSET;\n startPreview();\n break;\n case R.id.ChangeSceneTheatre:\n mSceneMode = CONTROL_SCENE_MODE_THEATRE;\n startPreview();\n break;\n\n\n\n case R.id.ShowRealTimeInfo:\n if(mInfoTextView.getVisibility()==View.INVISIBLE){\n mInfoTextView.setVisibility(View.VISIBLE);\n }else{\n mInfoTextView.setVisibility(View.INVISIBLE);\n }\n break;\n case R.id.RawInput:\n if(!mRawImageCaptureon){\n\n mRawImageCaptureon=true;\n Toast.makeText(getApplicationContext(), \"Raw Capture Turned on\", Toast.LENGTH_SHORT).show();\n\n\n //mRawCheckBox.setChecked(true);\n }else{\n mRawImageCaptureon=false;\n Toast.makeText(getApplicationContext(), \"Raw Capture Turned Off\", Toast.LENGTH_SHORT).show();\n }\n\n break;\n\n\n\n default:\n return false;\n }\n return true;\n }\n\n });\n popupMenu.show();\n\n }\n\n });\n\n\n mStillImageButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n mStillImageButton.setImageResource(R.mipmap.campic);\n if (!mBurstOn) {\n lockFocus();\n } else if (mBurstOn) {\n //Toast.makeText(getApplicationContext(), \"Burst Done\", Toast.LENGTH_SHORT).show();\n mBurstOn = false;\n }\n if (mChronometer.getVisibility() == View.VISIBLE) {\n mTimeInterval.setVisibility(View.INVISIBLE);\n\n mChronometer.stop();\n mChronometer.setVisibility(View.INVISIBLE);\n }\n }\n });\n mStillImageButton.setOnLongClickListener(new View.OnLongClickListener() {\n @Override\n public boolean onLongClick(View v) {\n mStillImageButton.setImageResource(R.mipmap.btn_timelapse);\n mTimeInterval.setVisibility(View.VISIBLE);\n mTimeInterval.setText(\"Second Step:\" + SecondStep);\n\n\n mBurstOn = true;\n Toast.makeText(getApplicationContext(), \"Burst Started\", Toast.LENGTH_SHORT).show();\n mChronometer.setBase(SystemClock.elapsedRealtime());\n mChronometer.setVisibility(View.VISIBLE);\n mChronometer.start();\n mChronometer.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() {\n @Override\n public void onChronometerTick(Chronometer chronometer) {\n ChronoCount = ChronoCount + 1;\n //chronometer.refreshDrawableState();\n if (mPhotoTimeLimitNumber == 1) {\n\n\n if (ChronoCount % SecondStep == 0) {\n lockFocus();\n }\n\n } else if (mPhotoTimeLimitNumber == 0) {\n if (ChronoCount == (PhotoBurstTimeStop)) {\n if (ChronoCount % SecondStep == 0) {\n lockFocus();\n }\n\n mChronometer.stop();\n mChronometer.setVisibility(View.INVISIBLE);\n mStillImageButton.setImageResource(R.mipmap.campic);\n } else {\n if (ChronoCount % SecondStep == 0) {\n lockFocus();\n }\n }\n\n\n }\n\n }\n });\n\n\n //mStillImageButton.setImageResource(R.mipmap.campic);\n\n\n return true;\n }\n });\n mRecordImageButton = (ImageButton) findViewById(R.id.VideoButton);\n\n mRecordImageButton.setOnClickListener(new View.OnClickListener() {\n @RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public void onClick(View v) {\n if (mIsRecording || mIsTimelapse) {\n mChronometer.stop();\n mChronometer.setVisibility(View.INVISIBLE);\n mIsRecording = false;\n mIsTimelapse = false;\n mRecordImageButton.setImageResource(R.mipmap.vidpiconline);\n mTimeInterval.setVisibility(View.INVISIBLE);\n mMediaRecorder.stop();\n mMediaRecorder.reset();\n Intent mediaStoreUpdateIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);\n mediaStoreUpdateIntent.setData(Uri.fromFile(new File(mVideoFileName)));\n sendBroadcast(mediaStoreUpdateIntent);\n\n\n startPreview();\n } else {\n //mIsRecording = true;\n\n\n mRecordImageButton.setImageResource(R.mipmap.vidpicbusy);\n try {\n checkWriteStoragePermission();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n }\n\n });\n mRecordImageButton.setOnLongClickListener(new View.OnLongClickListener() {\n @RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onLongClick(View v) {\n mIsTimelapse = true;\n mTimeInterval.setVisibility(View.VISIBLE);\n mTimeInterval.setText(\"Pictures per Second\" + VideoTimelapsSecondStep);\n try {\n checkWriteStoragePermission();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return true;\n\n }\n });\n\n\n }",
"public void setCamera(Camera camera) {\r\n\t\tthis.camera = camera;\r\n\t}",
"public void onCameraPicked(String newCameraId);",
"private void clickpic() {\n if (getApplicationContext().getPackageManager().hasSystemFeature(\n PackageManager.FEATURE_CAMERA)) {\n // Open default camera\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);\n\n // start the image capture Intent\n startActivityForResult(intent, 100);\n\n\n } else {\n Toast.makeText(getApplication(), \"Camera not supported\", Toast.LENGTH_LONG).show();\n }\n }",
"public void chooseCamera() {\n if (cameraFront) {\n int cameraId = findBackFacingCamera();\n if (cameraId >= 0) {\n //open the backFacingCamera\n //set a picture callback\n //refresh the preview\n\n mCamera = Camera.open(cameraId);\n setRotation(mCamera, mCamera.getParameters(), cameraId);\n // mCamera.setDisplayOrientation(90);\n mPicture = getPictureCallback();\n mPreview.refreshCamera(mCamera);\n }\n } else {\n int cameraId = findFrontFacingCamera();\n if (cameraId >= 0) {\n //open the backFacingCamera\n //set a picture callback\n //refresh the preview\n mCamera = Camera.open(cameraId);\n setRotation(mCamera, mCamera.getParameters(), cameraId);\n // mCamera.setDisplayOrientation(90);\n mPicture = getPictureCallback();\n mPreview.refreshCamera(mCamera);\n }\n }\n }",
"private void botonFuncional(JButton Boton){\n \n if(!caraUp){\n Boton.setEnabled(false);\n imagen1 =(ImageIcon) Boton.getDisabledIcon();\n v[0] = Boton;\n caraUp = true;\n cara1 = false;\n }\n else {\n Boton.setEnabled(false); \n imagen2 =(ImageIcon) Boton.getDisabledIcon();\n v[1]= Boton;\n cara1 = true;\n ganar();\n }\n }",
"public void camera(){\n System.out.println(\"I am taking pictures...\");\r\n }",
"private void createCamera() {\n camera = getCameraInstance();\n // Setting the right parameters in the camera\n SetCameraParameters();\n // Create our Preview view and set it as the content of our activity.\n camera_preview = new CameraPreview(this, camera);\n // Adding the camera preview after the FrameLayout and before the mainact_btn_InOutAct\n // as a separated element.\n InOut_cameraLayout.addView(camera_preview, 0);\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsaveCameraImage(false);\n\t\t\t}",
"private void pushButton(Floor floor)\r\n\t{\r\n\t\t\tbuttonPanel[floor.getNumber()]=LiftButton.ACTIVE;\r\n\t}",
"private void setCamera() {\n\t\tCamera.CameraInfo cameraInfo = new Camera.CameraInfo();\n\t\tint cameraCount = Camera.getNumberOfCameras();\n\t\tLog.i(TAG, \"count = \" + cameraCount);\n\t\tLog.i(TAG, \"isBack = \" + isBack);\n\t\tint id = 0;\n\n\t\tfor (int camIdx = 0; camIdx < cameraCount; camIdx++) {\n\t\t\tCamera.getCameraInfo(camIdx, cameraInfo);\n\t\t\tLog.i(TAG, \"cameraInfoFacing = \" + cameraInfo.facing);\n\t\t\tif (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK\n\t\t\t\t\t&& isBack) {\n\t\t\t\ttry {\n\t\t\t\t\tLog.i(TAG, \"SETTING mCamera\");\n\t\t\t\t\tmCamera = Camera.open(camIdx);\n\t\t\t\t\tid = camIdx;\n\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\tLog.e(TAG,\n\t\t\t\t\t\t\t\"Camera failed to open: \" + e.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} else if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT\n\t\t\t\t\t&& !isBack){\n\t\t\t\ttry {\n\t\t\t\t\tLog.i(TAG, \"SETTING mCamera\");\n\t\t\t\t\tmCamera = Camera.open(camIdx);\n\t\t\t\t\tid = camIdx;\n\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\tLog.e(TAG,\n\t\t\t\t\t\t\t\"Camera failed to open: \" + e.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (mCamera != null) {\n\t\t\tCamera.Parameters cameraParameters = mCamera.getParameters();\n\t\t\tDisplay display = getActivity().getWindowManager().getDefaultDisplay();\n\t\t\tPoint size = new Point();\n\t\t\tdisplay.getSize(size);\n\t\t\tint screenWidth = size.x;\n\t\t\tint width = Integer.MAX_VALUE;\n\t\t\tint height = 0;\n\t\t\tLog.i(TAG, \"SCREENWIDTH: \" + screenWidth);\n\t\t\tList<Camera.Size> sizes = cameraParameters.getSupportedPreviewSizes();\n\t\t\tfor (Camera.Size cSize : sizes) {\n\t\t\t\tif (cSize.width >= screenWidth && cSize.width <= width) {\n\t\t\t\t\twidth = cSize.width;\n\t\t\t\t\theight = cSize.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tLog.i(TAG, \"Width: \" + width + \" HEIGHT: \" + height);\n\n\t\t\tif (mPreview != null) {\n\t\t\t\tmPreview.switchCamera(mCamera, id, width, height);\n\t\t\t} else {\n\t\t\t\tmPreview = new CameraPreview(getActivity(), mCamera, id, width, height);\n\t\t\t\tFrameLayout preview = (FrameLayout) view\n\t\t\t\t\t\t.findViewById(R.id.camera_preview);\n\t\t\t\tpreview.addView(mPreview);\n\t\t\t}\n\t\t\tmCamera.startPreview();\n\t\t}\n\t}",
"public void onAddCamera(View view){\n setPage(view);\n int index = deleteView(view);\n addImageField(index, \"\");\n Toast.makeText(this, \"Request Camera Added\", Toast.LENGTH_LONG).show();\n }",
"@Override\r\n public void onClick(View view) {\n Intent intent=new Intent(MainActivity.this, CameraActivity.class);\r\n startActivity(intent);\r\n }",
"@Override\n public void onClick(View view) {\n try {\n if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n cameraManager.openCamera(cameraManager.getCameraIdList()[0],\n new CameraState(cameraView), null);\n } catch (CameraAccessException e) {\n Log.d(\"msg\",\"CameraAccessException\");\n e.printStackTrace();\n }\n\n }",
"private void HargaKamera() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public void setCamera(Camera camera) {\n mCamera = camera;\n }",
"public void onClickBack(View view){\n cam = mMap.getCameraPosition();//saves camara position\r\n Intent intent = new Intent(this,MainWindow.class);//needed to send the user to another screen\r\n startActivity(intent);\r\n }",
"void onBind(String cameraId);",
"void initializeCamera() {\n camera_linear = (LinearLayout) findViewById(R.id.camera_linear);\n //The preview frame is overlayed on the layout which shows the camera view.\n preview = (FrameLayout) findViewById(R.id.camera_preview);\n //Get an instance of the phone's camera.\n mCamera = cameraRecorder.getCameraInstance();\n //Find content fort the camera preview frame using the instance of the camera initialized.\n mPreview = new CameraPreview(getApplicationContext(), mCamera);\n //Apply the camera previes content from the camera to the preview frame itself.\n preview.addView(mPreview);\n }",
"public void openCamera() {\n Toast.makeText(this, \"Coming soon...\", Toast.LENGTH_SHORT).show();\n }",
"private void onCameraOpened() {\n SurfaceTexture texture = targetView.getSurfaceTexture();\n\n if (texture != null) {\n targetSurface = new Surface(texture);\n onSurfaceReceived();\n }\n else {\n targetView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() {\n @Override\n public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i1) {\n targetSurface = new Surface(surfaceTexture);\n onSurfaceReceived();\n }\n public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {\n return false;\n }\n\n @Override\n public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {\n\n }\n\n @Override\n public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i, int i1) {\n\n }\n });\n }\n }",
"@Override\n\tpublic void surfaceCreated(SurfaceHolder holder) {\n\t\tLog.e(TAG,\"Surface Created\");\n\t\tcamera = Camera.open();\n\t}",
"public void onClick(ClickEvent event) {\n // sendNameToServer();\n Camera c = Camera.getCamera();\n if (!Camera.isSupported()) {\n GWT.log(\"Camera not supported!\");\n return;\n }\n c.getPictureFromCamera(new CameraCallback() {\n public void onSuccess(String picture) {\n GWT.log(\"picture=\" + picture);\n pictureDataHidden.setValue(picture);\n image.setUrl(\"data:image/jpeg;base64,\" + picture);\n }\n\n public void onFailure(String error) {\n GWT.log(\"getPictureFromCamera\" + error);\n }\n });\n }",
"@Override\n public void onClick(View v) {\n startActivity(new Intent(getActivity(), CameraActivity.class));\n }",
"@Override\n public void onFinish() {\n if (camera == null)\n return;\n\n Camera.Parameters parameters = camera.getParameters();\n parameters.setFocusAreas(null);\n if (supportedFocusModes == null)\n supportedFocusModes = getSupportedFocusModes(parameters);\n if (supportedFocusModes.get(FOCUS_CONTINUOUS_PICTURE)) {\n parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);\n } else if (supportedFocusModes.get(FOCUS_CONTINUOUS_VIDEO)) {\n parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);\n }\n camera.setParameters(parameters);\n }",
"public void chooseBrick(View v) {\n\n // do nothing if block is not available\n if (isBlockAvailable(map_id_to_bricks.get(v.getId()))) {\n\n TextView obj_text_view = (TextView) findViewById(R.id.ID_PlacementMode_BrickPreview_TextView);\n obj_text_view.setVisibility(View.INVISIBLE);\n\n if (objBrickPreview != null) {\n objBlockFactory.ReleaseBlock(objBrickPreview);\n objBrickPreview = null;\n b_brick_is_placeable = false;\n }\n\n ImageView img = (ImageView) findViewById(ID_PlacementMode_BrickPreview_ImageView);\n\n img.setRotation(0);\n img.setColorFilter(Color.GRAY);\n\n // disable drag and drop\n findViewById(ID_PlacementMode_BrickPreview_ImageView).setOnTouchListener(null);\n\n switch (v.getId()) {\n case R.id.ID_PlacementMode_1x1_Brick_ImageButton:\n img.setImageResource(R.drawable.vi_quadrat_1x1);\n i_act_id = R.id.ID_PlacementMode_1x1_Brick_ImageButton;\n break;\n\n case R.id.ID_PlacementMode_2x2_Brick_ImageButton:\n img.setImageResource(R.drawable.vi_quadrat_2x2);\n i_act_id = R.id.ID_PlacementMode_2x2_Brick_ImageButton;\n break;\n\n case R.id.ID_PlacementMode_I_Brick_ImageButton:\n img.setImageResource(R.drawable.vi_i);\n i_act_id = R.id.ID_PlacementMode_I_Brick_ImageButton;\n break;\n\n case R.id.ID_PlacementMode_J_Brick_ImageButton:\n img.setImageResource(R.drawable.vi_j);\n i_act_id = R.id.ID_PlacementMode_J_Brick_ImageButton;\n break;\n\n case R.id.ID_PlacementMode_L_Brick_ImageButton:\n img.setImageResource(R.drawable.vi_l);\n i_act_id = R.id.ID_PlacementMode_L_Brick_ImageButton;\n break;\n\n case R.id.ID_PlacementMode_S_Brick_ImageButton:\n img.setImageResource(R.drawable.vi_s);\n i_act_id = R.id.ID_PlacementMode_S_Brick_ImageButton;\n break;\n\n case R.id.ID_PlacementMode_T_Brick_ImageButton:\n img.setImageResource(R.drawable.vi_t);\n i_act_id = R.id.ID_PlacementMode_T_Brick_ImageButton;\n break;\n\n case R.id.ID_PlacementMode_Z_Brick_ImageButton:\n img.setImageResource(R.drawable.vi_z);\n i_act_id = R.id.ID_PlacementMode_Z_Brick_ImageButton;\n break;\n\n default:\n break;\n }\n updateView();\n }\n\n }",
"private void changeToPhotoIdleView(boolean bl) {\n this.changeLayoutTo(DefaultLayoutPattern.PREVIEW);\n if (!this.isHeadUpDesplayReady()) {\n return;\n }\n super.changeScreenButtonImage(BaseFastViewFinder.HeadUpDisplaySetupState.PHOTO_STANDBY, false);\n if (bl) {\n this.mFocusRectangles.clearExceptTouchFocus();\n } else {\n this.mFocusRectangles.onUiComponentRemoved();\n }\n this.mFocusRectangles.onRecordingStop();\n if (this.mCameraDevice.getCameraId() == 0) {\n super.setSceneIndicatorVisibleAllNotificationIndicators(1);\n }\n this.getBaseLayout().showLeftIconContainer();\n this.setOrientation(this.getOrientation());\n }",
"@Override\n public void onCardboardTrigger() {\n Log.e(TAG, \"onCardboardTrigger\");\n\n mOverlayView.show3DToast(\"Identifying...\");\n try {\n camera.takePicture(null, null, mPicture);\n } catch (Exception e) {\n Log.e(\"Take Picture Failed.:\", e.getMessage());\n }\n\n // Always give user feedback\n mVibrator.vibrate(50);\n }",
"private void setEventListener() {\n mCameraView.addCameraKitListener(this);\n mCameraButton.setOnClickListener(this);\n mCameraButtonCloud.setOnClickListener(this);\n }",
"public static void setCameraFrame() {\n\t\tCAMERA.src = VERTICES[CAMERA.v];\n\t\tVector zc = CAMERA.src.d.scale(-1).normalized();\n\t\tCAMERA.zAxis = zc;\n\t\tVector xc = MathUtils.cross(CAMERA.src.d, new Vector(0, 1, 0)).normalized();\n\t\tCAMERA.xAxis = xc;\n\t\tVector yc = MathUtils.cross(zc, xc).normalized();\n\t\tCAMERA.yAxis = yc;\n\t\t\n\t\tSystem.out.println(\"***** just set camera: \" + CAMERA.toString());\n\t}",
"public void onCameraOpened() {\n openCameraCommon();\n initializeControlByIntent();\n new Thread() {\n public void run() {\n try {\n Thread.sleep(500);\n PhotoModule.this.mIsCameraOpened = true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }.start();\n }",
"@Override\n\tprotected void InitButtonListener() {\n\t\timgbtnOK.setOnClickListener(new View.OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tCursurIndex = 5;\n\t\t\t\tHandleCursurDisplay.sendMessage(HandleCursurDisplay.obtainMessage(CursurIndex));\n\t\t\t\tClickOK();\n\t\t\t}\n\t\t});\n\t\timgbtnCancel.setOnClickListener(new View.OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tCursurIndex = 4;\n\t\t\t\tHandleCursurDisplay.sendMessage(HandleCursurDisplay.obtainMessage(CursurIndex));\n\t\t\t\tClickCancel();\n\t\t\t}\n\t\t});\n\t\tseekbarLevel.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onStopTrackingTouch(SeekBar seekBar) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tCursurIndex = 3;\n\t\t\t\tHandleCursurDisplay.sendMessage(HandleCursurDisplay.obtainMessage(CursurIndex));\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onStartTrackingTouch(SeekBar seekBar) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tBrightnessManualLevel = seekBar.getProgress();\n\t\t\t\tCAN1Comm.Set_BacklightIlluminationLevel_719_PGN61184_109(BrightnessManualLevel + 1);\n\t\t\t\tCAN1Comm.TxCANToMCU(109);\n\t\t\t\tCAN1Comm.TxCMDToMCU(CAN1Comm.CMD_LCD, BrightnessManualLevel + 1);\n\t\t\t\t\n\t\t\t\tParentActivity.BrihgtnessCurrent = BrightnessManualLevel;\n\t\t\t}\n\t\t});\n\t}",
"public void camera360() {\n\n }",
"private void addWithCamera() {\n if (PermissionUtils.isPermissionGranted(Manifest.permission.CAMERA)) {\n startCameraPage();\n } else {\n PermissionUtils.requestPermission(\n this,\n Manifest.permission.CAMERA,\n CAMERA_PERMISSION_REQUEST);\n }\n }",
"public void onCameraPressed(View view) {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\r\n\r\n // create a file handle for the phoot that will be taken\r\n this.photoFile = getFileForPhoto(this.filename);\r\n Uri fileProvider = FileProvider.getUriForFile(PersonDetailsActivity.this, \"com.example.labtest1\", this.photoFile);\r\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\r\n\r\n // Try to open the camera app\r\n if (intent.resolveActivity(getPackageManager()) != null) {\r\n startActivityForResult(intent, TAKE_PHOTO_ACTIVITY_REQUEST_CODE);\r\n }\r\n }",
"public void startCamera()\n {\n startCamera(null);\n }",
"@Override\n public void onClick(View v) {\n Intent camIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n camIntent.setType(\"image/*\");\n startActivityForResult(camIntent,CAMERA_REQUEST);\n }",
"public void setCamera(Camera c) {\n\t\tmCamera = c;\n\t}",
"private void oldOpenCamera() {\n try {\n mCamera = Camera.open(); // attempt to get a Camera instance\n mCamera.setPreviewCallbackWithBuffer(this);\n Log.i(TAG, \"Instance created\");\n } catch (Exception e) {\n Log.e(TAG, \"Error getting Camera instance: \" + e.getMessage());\n }\n }",
"private void init() {\n add_camera_action_two = (Button) findViewById(R.id.add_camera_action_two);\n add_camera_action_two.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View arg0) {\n // TODO Auto-generated method stub\n Intent i = new Intent(mContext, AddCameraThirdActivity.class);\n startActivity(i);\n finish();//@@8.10\n }\n });\n }",
"public ToggleCameraMode() {\n requires(Robot.vision);\n }",
"public void myLocationClick() {\n\n //Set the initial camera position to the current location\n GridPoint gridPoint = myGridPoint();\n float mpp = 1;\n\n if (gridPoint != null) {\n\n CameraPosition cameraPosition = new CameraPosition(gridPoint, mpp);\n mMap.moveCamera(cameraPosition, true);\n\n } else {\n\n //If GPS is off, notify the user to turn it on\n Toast.makeText(MainActivity.this,\"Turn on GPS.\",Toast.LENGTH_SHORT).show();\n\n }\n\n }",
"public void surfaceCreated(SurfaceHolder holder) {\n startCamera(holder);\n }",
"@Override\n public void init() {\n startCamera();\n }",
"@Override // com.master.cameralibrary.CameraViewImpl\n public void takePicture() {\n if (!isCameraOpened()) {\n throw new IllegalStateException(\"Camera is not ready. Call start() before takePicture().\");\n } else if (getAutoFocus()) {\n this.mCamera.cancelAutoFocus();\n this.mCamera.autoFocus(new Camera.AutoFocusCallback() {\n /* class com.master.cameralibrary.Camera1.AnonymousClass2 */\n\n public void onAutoFocus(boolean z, Camera camera) {\n Camera1.this.takePictureInternal();\n }\n });\n } else {\n takePictureInternal();\n }\n }",
"@Override\n public void onClick(View v) {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (checkSelfPermission(Manifest.permission.CAMERA) ==\n PackageManager.PERMISSION_DENIED ||\n checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) ==\n PackageManager.PERMISSION_DENIED) {\n //Permission not enabled, on la demande\n String[] permission = {Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE};\n //pop up pour la demande de permission\n requestPermissions(permission, PERMISSION_CODE);\n } else {\n //permission deja validée\n openCamera();\n }\n } else {\n openCamera();\n }\n }"
] | [
"0.7058738",
"0.7019285",
"0.69925946",
"0.68596596",
"0.67064625",
"0.668271",
"0.66606694",
"0.6619006",
"0.65497357",
"0.65336776",
"0.64104337",
"0.63695323",
"0.63674164",
"0.6363071",
"0.6306835",
"0.6281189",
"0.62654215",
"0.6264844",
"0.6249383",
"0.6242716",
"0.62273204",
"0.6225576",
"0.62140024",
"0.6198732",
"0.6196641",
"0.61815256",
"0.61812246",
"0.61750656",
"0.6173324",
"0.61696523",
"0.61629194",
"0.6158142",
"0.6146968",
"0.6138726",
"0.61185366",
"0.61155766",
"0.6097318",
"0.60773796",
"0.60699105",
"0.6060855",
"0.6059051",
"0.6055337",
"0.60480744",
"0.6038393",
"0.60166913",
"0.6016665",
"0.60004705",
"0.59801906",
"0.5977333",
"0.59668267",
"0.59464365",
"0.593798",
"0.59356916",
"0.59343356",
"0.59279907",
"0.59244436",
"0.5908046",
"0.58980554",
"0.58971816",
"0.58936894",
"0.58913064",
"0.58695686",
"0.58609694",
"0.58590144",
"0.5857461",
"0.58529776",
"0.58442897",
"0.58354366",
"0.58341604",
"0.58314663",
"0.58307594",
"0.5817929",
"0.5815691",
"0.5810879",
"0.5802736",
"0.57893103",
"0.5786589",
"0.57851213",
"0.5783199",
"0.5780262",
"0.5756317",
"0.5753202",
"0.57433283",
"0.5740669",
"0.57386893",
"0.5735244",
"0.57173014",
"0.5711973",
"0.5704357",
"0.57037073",
"0.5703225",
"0.57009315",
"0.56908506",
"0.56892926",
"0.5678703",
"0.5673318",
"0.5668084",
"0.56674564",
"0.565663",
"0.56553036",
"0.56212777"
] | 0.0 | -1 |
Returns a list of StudentAnswer objects for a given student id and quiz id. | public ArrayList<StudentAnswer> getAnswers() {
TeacherDBCommands tdbc = new TeacherDBCommands(ctx);
QuestionDBCommands qdbc = new QuestionDBCommands(ctx);
ArrayList<StudentAnswer> answers = null;
try {
answers = tdbc.getStudentAnswers(this.studentId, this.quizId);
} catch (SQLException e) {
log.log(Level.SEVERE, e.getMessage(), e);
}
tdbc.closeConnection();
if(answers != null){
for (int i = 0; i < answers.size(); i++) {
try {
answers.get(i).setQuestion(qdbc.getQuestionById(answers.get(i).getQuizTestModuleQuestionId()));
} catch (SQLException e) {
log.log(Level.SEVERE, e.getMessage(), e);
break;
}
}
}
qdbc.closeConnection();
return answers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<StudentExam> findAllByExamId(Long examId) {\n log.debug(\"Request to get all student exams for Exam : {}\", examId);\n return studentExamRepository.findByExamId(examId);\n }",
"List<Result> getResultsByQuizId(int quizId);",
"List<Question> getQuestions(String surveyId);",
"public ArrayList<Answer> getAllAnswersByQuestionId(int id) {\n \t\tArrayList<Answer> questionAnswers = new ArrayList<Answer>();\n \t\tfor (Answer answer : answers) {\n \t\t\tif (answer.getQuestionId() == id) {\n \t\t\t\tquestionAnswers.add(answer);\n \t\t\t}\n \t\t}\n \t\treturn questionAnswers;\n \t}",
"@Override\r\n\tpublic List<ZyAnswer> getAnswersByQuestion(int questionId) {\n\t\treturn answerDao.getAnswersByquestion(questionId);\r\n\t}",
"public Student[] listStudents(long id) {\n\t\treturn new Tutor().listMyStudents(id);\n\t}",
"public ArrayList<Result> getQuizResults(String quizId, String userId){\n \t\tString query = \"select * from results where user = '\" + userId + \"' AND quiz = '\" + quizId + \"'\";\n \t\tResultSet rs = getResult(query);\n \t\tArrayList<Result> results = new ArrayList<Result>();\n \t\t\n \t\ttry {\n \t\t\twhile(rs.next()){\n \t\t\t\tresults.add(new Result(rs.getString(\"quiz\"), rs.getString(\"user\"), Integer.parseInt(rs.getString(\"time\")), Integer.parseInt(rs.getString(\"questions\")), Integer.parseInt(rs.getString(\"correct\")), rs.getString(\"date\")));\n \t\t\t}\n \t\t} catch (SQLException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\treturn results;\n \t}",
"public List<Question> getQuestionbySid(int sid);",
"@Override\r\n\tpublic List<Exam> listAllExamsByStudent(Student student) {\n\t\treturn null;\r\n\t}",
"public AnswerStatistics getAnswerStatisticsbyID(int sid,int qid);",
"@Override\n\tpublic List<Subject> findByExam(int examId) {\n\t\tList<Subject> subjects = new ArrayList<Subject>();\n\t\tExam exam = examDao.findOne(examId);\n\t\tList<ExamSubject> examSubjects = examSubjectDao.findByExam(exam);\n\t\tfor (ExamSubject examSubject : examSubjects) {\n\t\t\tsubjects.add(examSubject.getSubject());\n\t\t}\n\t\t\n\t\treturn subjects;\n\t}",
"public List<AnswerEntity> getAllAnswersToQuestion(\n final String questionId, final String accessToken)\n throws AuthorizationFailedException, InvalidQuestionException {\n UserAuthEntity userAuthEntity = userAuthDao.getUserAuthByToken (accessToken);\n if (userAuthEntity == null) {\n throw new AuthorizationFailedException (\"ATHR-001\", \"User has not signed in\");\n } else if (userAuthEntity.getLogoutAt () != null) {\n throw new AuthorizationFailedException (\n \"ATHR-002\", \"User is signed out.Sign in first to get the answers\");\n }\n QuestionEntity questionEntity = questionDao.getQuestionById (questionId);\n if (questionEntity == null) {\n throw new InvalidQuestionException (\n \"QUES-001\", \"The question with entered uuid whose details are to be seen does not exist\");\n }\n return answerDao.getAllAnswersToQuestion (questionId);\n }",
"public ArrayList<Student> getAllStudentInfo(String student_id,\n\t\t\tString roll_no) {\n\t\tArrayList<Student> studentList = new ArrayList<Student>();\n\t\t// Select All Query\n\t\tString selectQuery = \"SELECT * FROM \" + TABLE_TEACHER_ASSIGNMENT\n\t\t\t\t+ \" WHERE \" + KEY_STUDENT_ID + \"=\" + student_id + \" AND \"\n\t\t\t\t+ KEY_ROLL_NO + \"=\" + roll_no;\n\t\tCursor cursor = db.rawQuery(selectQuery, null);\n\n\t\t// looping through all rows and adding to list\n\t\tcursor.moveToFirst();\n\t\twhile (cursor.isAfterLast() == false) {\n\t\t\tStudent info = new Student();\n\t\t\tinfo.row_id = Integer.parseInt(cursor.getString(0));\n\t\t\tinfo.id = cursor.getString(1);\n\t\t\tinfo.name = cursor.getString(2);\n\t\t\tinfo.roll_no = cursor.getString(3);\n\t\t\tinfo.section_id = cursor.getString(4);\n\t\t\tinfo.subject_id = cursor.getString(5);\n\t\t\tinfo.teacher_id = cursor.getString(6);\n\t\t\t// Adding contact to list\n\t\t\tstudentList.add(info);\n\t\t\tcursor.moveToNext();\n\t\t}\n\t\tcursor.close();\n\t\t// return contact list\n\t\treturn studentList;\n\t}",
"@Override\n\tpublic List getQuestionListByExamId(Integer examId) {\n\t\tString hql = \"from ElearningExamQRelation a where 1 = 1 \";\n\t\tif(examId!=null && !examId.equals(\"\")){\n\t\t\thql+=\"and a.examId='\"+examId+\"'\";\n\t\t}\n\t\thql+=\"order by a.number asc\";\n\t\tList list = this.queryForList(hql);\n\t\tif(list == null || list.size()== 0)\n\t\t\treturn null;\n\t\telse{\n\t\t\treturn list;\n\t\t}\n\t}",
"@Override\n\tpublic Quiz getQuizById(int quizId) {\n\t\ttry {\n\t\t\tConnection database = ds.getConnection();\n\t\t\tString selectStatement = \"SELECT * from quiz where quiz_id = ?\";\n\t\t\tPreparedStatement selectPs = database.prepareStatement(selectStatement);\n\t\t\t\n\t\t\tselectPs.setInt(1, quizId);\n\t\t\t\n\t\t\tResultSet rs = selectPs.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\treturn extractQuiz(rs);\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t} catch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"public ArrayList<Answer> getAnswersSortedByScore(int id) {\n \t\tArrayList<Answer> sortedAnswers = this.getAllAnswersByQuestionId(id);\n \n \t\tCollections.sort(sortedAnswers, Collections.reverseOrder(new ScoreComparator()));\n \n \t\treturn sortedAnswers;\n \t}",
"QuestionResponse getResponses(String questionId);",
"@GetMapping(\"/quiz/{qid}\")\n\tpublic ResponseEntity<?> getQuestionsOfQuiz(@PathVariable(\"qid\") Long qid){\n\t\tQuiz quiz = this.quizService.getQuiz(qid);\n\t\tSet<Question> questions = quiz.getQuestions();\n\t\tList<Question> list = new ArrayList<>(questions);\n\t\tif(list.size() > Integer.parseInt(quiz.getNumberOfQuestions())) {\n\t\t\tlist = list.subList(0, Integer.parseInt(quiz.getNumberOfQuestions()));\n\t\t}\n\t\t\n\t\tlist.forEach((q)-> {\n\t\t\tq.setAnswer(\"\");\n\t\t});\n\t\t\n\t\tCollections.shuffle(list);\n\t\treturn ResponseEntity.ok(list);\n\t}",
"List<ScoreEntity> findList(int studentId);",
"public ExamResultAnswers findSubmittedAnswersByQuestionId(final Long questionId) {\n for (final Entry<Question, ExamResultAnswers> entry : submittedAnswers.entrySet()) {\n final Question question = entry.getKey();\n if (question.getId().equals(questionId)) {\n return entry.getValue();\n }\n }\n return null;\n }",
"@JsonView(View.Public.class)\n @RequestMapping(value = \"api-quiz-getAllById/{id}\", method = RequestMethod.GET)\n public Response <Quiz> getQuizById(@PathVariable Integer id, @ModelAttribute Quiz quiz)\n {\n Quiz kuis = quizService.findQuizById(id);\n return ModelToResponseMapper.mapThisSuccess(kuis);\n }",
"public List<Answer> getAnswers(Integer qusetionCsddId, String qusetionHash) throws MyCustException {\n logger.debug(\"qusetionCsddId \" + qusetionCsddId + \"qusetionHash\" + qusetionHash);\n Connection sqlCon = apacheDerbyClient.getSqlConn();\n List<Answer> answers = new ArrayList<Answer>();\n\n try {\n String sql2 = \"select answer, answerCSDDid from \" + Storage.schemName + \".\" + Storage.TABLE_QUESTION_ANSWERS_LINKER + \" \" +\n \"where 1 = 1 \";\n\n if ((qusetionCsddId != null) && (qusetionCsddId != 0))\n sql2 += \" and questionCSDDid = \" + qusetionCsddId;\n\n if (!qusetionHash.isEmpty())\n sql2 += \" and question = '\" + qusetionHash + \"'\";\n logger.debug(sql2);\n PreparedStatement ps = sqlCon.prepareStatement(sql2);\n\n ResultSet rs = ps.executeQuery();\n while (rs.next()) {\n Answer answer = new Answer();\n answer.setAnswerHash(rs.getString(\"answer\"));\n answer.setAnswerCsddId(rs.getInt(\"answerCsddId\"));\n\n String sql = \"select answtxt, CSDDid, answcor from \" + Storage.schemName + \".\" + Storage.TABLE_ANSWERS + \" \" +\n \"where CSDDid = \" + answer.getAnswerCsddId() + \" and \" +\n \"hash = '\" + answer.getAnswerHash() + \"'\";\n logger.debug(sql2);\n PreparedStatement ps2 = sqlCon.prepareStatement(sql);\n\n ResultSet rs2 = ps2.executeQuery();\n while (rs2.next()) {\n answer.setAnswerText(rs2.getString(\"answtxt\"));\n answer.setCorrect(rs2.getBoolean(\"answcor\"));\n\n if (!answers.contains(answer))\n answers.add(answer);\n else\n logger.warn(\"records in Answers duplicating !!!: \" + answer.toString());\n }\n }\n } catch (Exception ex) {\n logger.error(\"\", ex);\n }\n return answers;\n }",
"public List<Student>ViewStudentDAO(int id) {\n\t\tList<Student> students = new ArrayList<Student>();\n\t\ttry {\n stmt = connection.prepareStatement(SqlQueries.GetStudents);\n stmt.setInt(1, id);\n stmt.execute();\t \n ResultSet result =stmt.executeQuery();\n while(result.next())\n {\n \tstudents.add(SDAO.GetStudent(result.getInt(1)));\n }\n } catch(Exception ex){\n \tlogger.error(ex.getMessage()); \n } finally{\n \t//close resources\n \tDBUtil.closeStmt(stmt);\n }\n\treturn students ;\t\n\t}",
"public Quiz getQuiz(String quizId){\n \t\tString query = \"SELECT * FROM quizzes WHERE quiz_id = '\" + quizId + \"';\";\n \t\tResultSet rs = getResult(query);\n \t\tString creatorId = \"\";\n \t\tString dateCreated = \"\";\n \t\tboolean isRandom = false;\n \t\tboolean isOnePage = false;\n \t\tboolean isImmediate = false;\n \t\tString imageURL = \"\";\n \t\tString description = \"\";\n \t\ttry {\n \t\t\trs.first();\n \t\t\tcreatorId = rs.getString(\"creator_id\");\n \t\t\tdateCreated = rs.getString(\"date_created\");\n \t\t\tisRandom = rs.getBoolean(\"is_random\");\n \t\t\tisOnePage = rs.getBoolean(\"is_one_page\");\n \t\t\tisImmediate = rs.getBoolean(\"is_immediate\");\n \t\t\timageURL = rs.getString(\"image_url\");\n \t\t\tdescription = rs.getString(\"description\");\n \t\t} catch (SQLException e) {\n \t\t\t// TODO Auto-generated catch block\n \t\t\te.printStackTrace();\n \t\t}\n \t\tQuiz quiz = new Quiz(quizId, creatorId, dateCreated, isRandom, isOnePage, isImmediate, imageURL, description);\n \t\t\n \t\t//extracts info from fill_in_the_blank table, building each question with info from \n \t\t//answers as well\n \t\tquery = \"SELECT * FROM fill_in_the_blank WHERE quiz_id = '\" + quizId + \"';\";\n \t\trs = getResult(query);\n \t\ttry {\n \t\t\trs.beforeFirst();\n \t\t\twhile (rs.next()){\n \t\t\t\tArrayList<String> questions = new ArrayList<String>();\n \t\t\t\tint questionNum = rs.getInt(\"question_num\");\n \t\t\t\tquestions.add(0, rs.getString(\"question_one\"));\n \t\t\t\tquestions.add(1, rs.getString(\"question_two\"));\n \t\t\t\tString questionQuery = \"SELECT * FROM answers WHERE quiz_id = '\" + quizId + \"' AND question_num = \" + questionNum + \";\";\n \t\t\t\tResultSet questionRS = getResult(questionQuery);\n \t\t\t\tArrayList<String> answers = new ArrayList<String>();\n \t\t\t\tquestionRS.beforeFirst();\n \t\t\t\twhile (questionRS.next()){\n \t\t\t\t\tanswers.add(questionRS.getString(\"answer\"));\n \t\t\t\t}\n \t\t\t\tFillInBlank FIB = new FillInBlank(questions, answers, questionNum);\n \t\t\t\tquiz.addQuestion(FIB);\n \t\t\t}\n \t\t} catch (SQLException e) {\n \t\t\t// TODO Auto-generated catch block\n \t\t\te.printStackTrace();\n \t\t}\n \t\t\n \t\t\n \t\t//extracts info from question_response table, building each question with info from \n \t\t//answers as well\n \t\tquery = \"SELECT * FROM question_response WHERE quiz_id = '\" + quizId + \"';\";\n \t\trs = getResult(query);\n \t\ttry {\n \t\t\trs.beforeFirst();\n \t\t\twhile (rs.next()){\n \t\t\t\tint questionNum = rs.getInt(\"question_num\");\n \t\t\t\tString question = rs.getString(\"question\");\n \t\t\t\tString questionQuery = \"SELECT * FROM answers WHERE quiz_id = '\" + quizId + \"' AND question_num = \" + questionNum + \";\";\n \t\t\t\tResultSet questionRS = getResult(questionQuery);\n \t\t\t\tArrayList<String> answers = new ArrayList<String>();\n \t\t\t\tquestionRS.beforeFirst();\n \t\t\t\twhile (questionRS.next()){\n \t\t\t\t\tanswers.add(questionRS.getString(\"answer\"));\n \t\t\t\t}\n \t\t\t\tQuestionResponse QR = new QuestionResponse(question, answers, questionNum);\n \t\t\t\tquiz.addQuestion(QR);\n \t\t\t}\n \t\t} catch (SQLException e) {\n \t\t\t// TODO Auto-generated catch block\n \t\t\te.printStackTrace();\n \t\t}\n \t\t\n \t\t\n \t\t//extracts info from picture table, building each question with info from \n \t\t//answers as well\n \t\tquery = \"SELECT * FROM picture WHERE quiz_id = '\" + quizId + \"';\";\n \t\trs = getResult(query);\n \t\ttry {\n \t\t\trs.beforeFirst();\n \t\t\twhile (rs.next()){\n \t\t\t\tint questionNum = rs.getInt(\"question_num\");\n \t\t\t\tString question = rs.getString(\"question\");\n \t\t\t\tString url = rs.getString(\"url\");\n \t\t\t\tString questionQuery = \"SELECT * FROM answers WHERE quiz_id = '\" + quizId + \"' AND question_num = \" + questionNum + \";\";\n \t\t\t\tResultSet questionRS = getResult(questionQuery);\n \t\t\t\tArrayList<String> answers = new ArrayList<String>();\n \t\t\t\tquestionRS.beforeFirst();\n \t\t\t\twhile (questionRS.next()){\n \t\t\t\t\tanswers.add(questionRS.getString(\"answer\"));\n \t\t\t\t}\n \t\t\t\tPicture P = new Picture(url, question, answers, questionNum);\n \t\t\t\tquiz.addQuestion(P);\n \t\t\t}\n \t\t} catch (SQLException e) {\n \t\t\t// TODO Auto-generated catch block\n \t\t\te.printStackTrace();\n \t\t}\n \t\t\n \t\t\n \t\t//extracts info from multiple_choice table, building each question with info from \n \t\t//answers as well\n \t\tquery = \"SELECT * FROM multiple_choice WHERE quiz_id = '\" + quizId + \"';\";\n \t\trs = getResult(query);\n \t\ttry {\n \t\t\trs.beforeFirst();\n \t\t\twhile (rs.next()){\n \t\t\t\tint questionNum = rs.getInt(\"question_num\");\n \t\t\t\tString question = rs.getString(\"question\");\n \t\t\t\tArrayList<String> answers = new ArrayList<String>();\n \t\t\t\tanswers.add(0, rs.getString(\"a\"));\n \t\t\t\tanswers.add(1, rs.getString(\"b\"));\n \t\t\t\tanswers.add(2, rs.getString(\"c\"));\n \t\t\t\tanswers.add(3, rs.getString(\"d\"));\n \t\t\t\tString questionQuery = \"SELECT * FROM answers WHERE quiz_id = '\" + quizId + \"' AND question_num = \" + questionNum + \";\";\n \t\t\t\tResultSet questionRS = getResult(questionQuery);\n \t\t\t\tquestionRS.first();\n \t\t\t\tString correctAnswer = questionRS.getString(\"answer\");\n \t\t\t\t\n \t\t\t\tMultipleChoice MC = new MultipleChoice(question, answers, correctAnswer, questionNum);\n \t\t\t\tquiz.addQuestion(MC);\n \t\t\t}\n \t\t} catch (SQLException e) {\n \t\t\t// TODO Auto-generated catch block\n \t\t\te.printStackTrace();\n \t\t}\n \t\t\n \t\t\n \treturn quiz;\n \t}",
"public void search(String quizID) {\n\t\t\n\t\tthis.getChildren().clear(); // empty the result first\n\t\t\n\t\tArrayList<QuizData> quizList = BrowserData.quizList();\n\n\t\tboolean noMatch = true; // true if no match found\n\t\t\n\t\tfor (int i = 0; i < quizList.size(); i++) {\n\t\t\t\n\t\t\tif(quizID.equals(quizList.get(i).getName())) { // if match found: create a snippet for the quiz and show\n\t\t\t\t\n\t\t\t\tthis.getChildren().add(new QuizSnippet(quizList.get(i)));\n\t\t\t\tnoMatch = false;\n\t\t\t\t\n\t\t\t}\n\t\t \n\t\t}\n\n\t\tif(noMatch) { // if no match found: show \"No match found!\"\n\n\t\t\tText noResult = new Text(\"No match found!\");\n\t\t\tnoResult.setFont(new Font(20));\n\t\t\tthis.getChildren().add(noResult);\n\n\t\t}\n\t\t\n\t}",
"public List<StudentExam> getRegisteredExams(Student student) {\n return null;\n }",
"public java.util.List findStudentByStudentId(java.lang.Integer studentId) throws GenericBusinessException {\n sust.paperlessexm.hibernatehelper.HibernateQueryHelper hibernateTemplate = new sust.paperlessexm.hibernatehelper.HibernateQueryHelper();\n try {\n String queryString = \"from \" + Student.class.getName() + \" e where e.studentId like :studentId \";\n // Add a an order by on all primary keys to assure reproducable results.\n String orderByPart = \"\";\n orderByPart += \" order by e.studentId\";\n queryString += orderByPart;\n Query query = hibernateTemplate.createQuery(queryString);\n hibernateTemplate.setQueryParameter(query, \"studentId\", studentId);\n List list = hibernateTemplate.list(query);\n return list;\n } finally {\n log.debug(\"finished findStudentByStudentId(java.lang.Integer studentId)\");\n }\n }",
"@Override\n\t@Transactional\n\tpublic List<Question> getQuestionsByTestId(int id) {\n\t\treturn questionDao.getQuestionsByTestId(id);\n\t}",
"public ArrayList<Marks> getMarks(Student student) {\n\n ArrayList<Marks> marks = new ArrayList<>();\n String query = String.format(\"SELECT * FROM enrollment WHERE student_id = '%s'\", student.getId());\n\n try {\n\n result = statement.executeQuery(query);\n\n while(result.next()){\n String yearMark = result.getString(\"year_mark\");\n String examMark = result.getString(\"exam_mark\");\n String finalMark = result.getString(\"final_mark\");\n String tutAttendance = result.getString(\"tut_attendance\");\n String outcome = result.getString(\"outcome\");\n String course_id = result.getString(\"course_code\");\n String course = getCourseName(course_id);\n marks.add(new Marks(course, yearMark, examMark, finalMark, outcome, tutAttendance));\n }\n return marks;\n }\n catch (SQLException e){\n return marks;\n }\n }",
"public ArrayList<Integer> getStudentAnswer() {\r\n return this.studentAnswer;\r\n }",
"@GetMapping(value = getTeachersByStudentIdMapping + \"{studentId}\")\r\n\tpublic ResponseEntity<List<Teacher>> getTeachersByStudentId(@PathVariable(\"studentId\") String studentId) {\r\n\t\treturn ResponseEntity.ok().body(teacherStudentService.getTeachersByStudentId(studentId));\r\n\t}",
"public List<QuizResultDTO> getQuizResults() {\n List<QuizResultDTO> quizResultDTOList = new ArrayList<>();\n List<Long> articleIdList = articleService.getArticleIdWhichHasQuizzes();\n for (long articleId : articleIdList) {\n QuizResultDTO quizResultDTO = new QuizResultDTO();\n quizResultDTO.setArticleId(articleId);\n quizResultDTO.setArticleTitle(articleRepository.findByArticleId(articleId).getArticleTitle());\n quizResultDTO.setQuestionNumber(articleService.getNumberOfQuizzesForArticle(articleId));\n\n Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n quizResultDTO.setCorrectAnswer(userQuizArticleRepository.countByUsernameAndArticleId(authentication.getName(), articleId));\n\n quizResultDTOList.add(quizResultDTO);\n }\n\n return quizResultDTOList;\n }",
"public List<AnswerStatistics> getStatisticsbySid(int sid);",
"@Override\r\n\tpublic List<StudentBean> getStudentsByClassId(String classId) {\n\t\treturn studentDAO.getStudentsByClassId(classId);\r\n\t}",
"public void setIdQuiz(int idQuiz) {\r\n\t\tthis.idQuiz = idQuiz;\r\n\t}",
"@Override\n public List<StudentOnYearDTO> studentsBySubject(Long subjectId, Pageable pageable)\n throws SubjectRealizationNotFoundException\n {\n SubjectRealization subjectRealization = this.subjectRealizationRepository\n .findBySubjectId(subjectId)\n .orElseThrow(\n () ->\n new SubjectRealizationNotFoundException(String.format(\"Subject realization with subject id: %s could not be found\", subjectId))\n );\n // holds students\n List<SubjectAttendance> subjectAttendances = this.subjectAttendanceRepository\n .getAllBySubjectRealizationIdAndDeletedFalse(subjectRealization.getId(), pageable);\n\n List<Long> studentIds = new ArrayList<>();\n subjectAttendances.forEach(sA -> studentIds.add(sA.getStudent().getStudentId()));\n\n List<StudentDTO> studentDTOS = this.authService.getAllStudents(jwtUtil.getToken(), studentIds);\n\n List<Long> studentIdsDTO = studentDTOS.stream().mapToLong(StudentDTO::getId).boxed().collect(Collectors.toList());\n List<StudentOnYear> studentOnYears = this.studentOnYearRepository.findAllByStudentIdIn(studentIdsDTO);\n return StudentOnYearMapper.map(studentDTOS, studentOnYears, subjectRealization);\n }",
"public Question getQuestionbyId(int sid,int qid);",
"@GetMapping(\"getans/{id}\")\n public ResponseEntity<List<Answer>> getAnswer(@PathVariable Long id) {\n\n List<Answer> a = this.userServices.getAnswer(id);\n\n if (a.size() <= 0) {\n\n return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n }\n\n return ResponseEntity.status(HttpStatus.CREATED).body(a);\n\n }",
"@GetMapping(\"/students/{studentId}\")\n @ApiOperation(value = \"Search StudyClasses by its students\")\n public List<StudyClassDTO> findByStudentStudentId(\n @ApiParam(value = \"The student studentId\") @PathVariable String studentId) {\n return studyClassService.findByStudentStudentId(studentId);\n }",
"Student getStudentById(Long id);",
"@Override\r\n\tpublic ReportAndSummary findByStudentId(int id) {\n\t\tReportAndSummary result = reportAndSummaryDao.findByStudentId(id);\r\n\t\treturn result;\r\n\t}",
"public List<Survey> getSurveybyTid(int tid);",
"@Transactional\n\tpublic List<Comment> getListForQuiz(int quiz) {\n\t\ttry {\n\t List<Comment> comments =new ArrayList<Comment>();\n\t Set<Comment> commentsByUser=commentDao.getCommentsListForQuiz(quiz);\n\t \tfor (Iterator<Comment> it = commentsByUser.iterator(); it\n\t\t\t\t\t.hasNext();) {\n\t \t\tComment f = it.next();\n\t \t\tcomments.add(f);\n\t \t}\n\t if(comments==null || comments.size()==0) {\n\t return null;\n\t }\n\t return comments;\n\t\t} catch (HibernateException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"@GetMapping(\"/quiz/all/{qid}\")\n\tpublic ResponseEntity<?> getQuestionsOfQuizAdmin(@PathVariable(\"qid\") Long qid){\n\t\tQuiz quiz = new Quiz();\n\t\tquiz.setqId(qid);\n\t\tSet<Question> questionsOfQuiz = this.questionService.getQuestionOfQuiz(quiz);\n\t\treturn ResponseEntity.ok(questionsOfQuiz);\t\t\n\t}",
"@Override\n\tpublic List<Student> selectStudent(int classId) {\n\t\t\n\t\tString sql=\"select t2.stu_id,t2.stu_name,t2.stu_no ,t1.score_jilv,t1.score_jishu,t1.score_zhiye from \"\n\t\t\t\t+ \"(select stu_id,\"\n\t\t\t\t+ \"SUM(CASE WHEN score_type=1 THEN score_value END )score_jilv,\"\n\t\t\t\t+ \"SUM(CASE WHEN score_type=2 THEN score_value END )score_jishu,\"\n\t\t\t\t+ \"SUM(CASE WHEN score_type=3 THEN score_value END )score_zhiye \"\n\t\t\t\t+ \"from tb_score where class_id=? GROUP BY stu_id)t1,\"\n\t\t\t\t+ \"tb_student t2 WHERE t1.stu_id=t2.stu_id\";\n\t\tObject[] classid={classId};\n\t\t\n\t\tList<Student> stu=ORMUtil.ormutil().selectList(sql, classid, Student.class);\n\t\t\n\t\treturn stu;\n\t}",
"@RequestMapping( value = \"/{id}/student\", method = RequestMethod.GET )\n public Set<StudentDTO> readStudents(@PathVariable(value=\"id\") long id){\n return classService.read(id).getStudents();\n }",
"public AnswerDTO examAnswer(long submittedQuizOptionId) {\n AnswerDTO answerDTO = new AnswerDTO();\n //find the quiz of the submitted option\n QuizOption submittedQuizOption = quizOptionRepository.findByQuizOptionId(submittedQuizOptionId);\n Quiz quiz = submittedQuizOption.getQuiz();\n\n // if the user is logged in, save the answer of this quiz for this user\n Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n if (!(authentication instanceof AnonymousAuthenticationToken)) {\n String currentPrincipalName = authentication.getName();\n GeneralUser user = userRepository.findByUsername(currentPrincipalName);\n\n UserQuizRecord userQuizRecord = userQuizRecordRepository.findByGeneralUserAndQuiz(user, quiz);\n if (userQuizRecord == null) {\n userQuizRecord = new UserQuizRecord();\n }\n userQuizRecord.setAnswerResult(submittedQuizOption.isAnswer());\n userQuizRecord.setGeneralUser(user);\n userQuizRecord.setQuiz(quiz);\n userQuizRecordRepository.save(userQuizRecord);\n\n // check if the user can get an achievement after answer this quiz\n achievementService.updateQuizAchievement(user);\n\n // check if this quiz can unlock a game, if so, unlock the game for this user\n Article article = articleRepository.findByArticleId(quizSectionArticleRepository.findByQuizId(quiz.getQuizId()).getArticleId());\n Game game = gameRepository.findByArticle(article);\n if (game != null) {\n UserGameRecord userGameRecord = userGameRecordRepository.findByGeneralUserAndGame(user, game);\n userGameRecord.setUnlocked(true);\n userGameRecordRepository.save(userGameRecord);\n }\n }\n\n QuizOption correctQuizOption = quizOptionRepository.findByQuizAndIsAnswer(quiz, true);\n\n answerDTO.setSubmittedOptionId(submittedQuizOptionId);\n answerDTO.setCorrectness(submittedQuizOption.isAnswer());\n answerDTO.setCorrectOptionId(correctQuizOption.getQuizOptionId());\n answerDTO.setCorrectOptionText(correctQuizOption.getQuizOptionText());\n return answerDTO;\n }",
"@Override\n\t public List<Student> getAllStudent(BigInteger stdId){\n\t \t\n\t\t \n\t \treturn (List<Student>) studentrepo.findAll(); \t\n\t }",
"public Student findStudent(int id);",
"public List<ExamQuestionMarkAssigneeBO> getAssignees(String examId, String courseId) {\n Assert.hasText(examId, \"examId cannot be empty!\");\n List<ExamQuestionMarkAssigneePO> assignees = examQuestionMarkAssigneeDAO.getAssignees(examId, courseId, null);\n return BeanUtils.convert(assignees, ExamQuestionMarkAssigneeBO.class);\n }",
"@GetMapping(\"student-list/{id}\")\n\tpublic Student getStudentById(@PathVariable int id) throws SQLException {\n\t\treturn studentSerivce.getStudents(id);\n\t}",
"public SectionQuizDTO getSectionQuiz(long sectionId) {\n SectionQuizDTO sectionQuizDTO = new SectionQuizDTO();\n sectionQuizDTO.setSectionId(sectionId);\n Section section = sectionRepository.findBySectionId(sectionId);\n\n List<Quiz> sectionQuizList = quizRepository.findBySection(section);\n List<QuizDTO> sectionQuizDTOList = new ArrayList<>();\n for (Quiz q : sectionQuizList) {\n QuizDTO newQuizDTO = new QuizDTO();\n newQuizDTO.setQuizId(q.getQuizId());\n newQuizDTO.setQuizQuestion(q.getQuizQuestion());\n newQuizDTO.setQuizOptionDTOList(getOptionDTO(q));\n sectionQuizDTOList.add(newQuizDTO);\n }\n\n sectionQuizDTO.setSectionQuizDTOList(sectionQuizDTOList);\n return sectionQuizDTO;\n }",
"public final @ResponseBody Map<String, Object> getQuestionAndResponse(Long taskVariantId, Long studentId,\n\t\t\tLong testId) {\n\t\tLOGGER.trace(\"Entering the getQuestionAndResponse() method\");\n\t\tMap<String, Object> questionAndResponse = new HashMap<String, Object>();\n\t\tString taskVariant = \"\";\n\t\tTaskVariant tv = testService.getTaskVariantById(taskVariantId);\n\t\tif (tv != null) {\n\t\t\ttaskVariant = tv.getTaskStem();\n\t\t\tquestionAndResponse.put(\"rubricQuestion\", taskVariant);\n\t\t}\n\n\t\tStudentsResponses studentsResponses = studentsResponsesService.getStudentResponse(studentId, taskVariantId,\n\t\t\t\ttestId);\n\n\t\t// String response = \"\";\n\n\t\tif (studentsResponses != null) {\n\t\t\tString response = studentsResponses.getResponse();\n\t\t\tquestionAndResponse.put(\"rubricResponse\", response);\n\t\t} else {\n\t\t\tquestionAndResponse.put(\"rubricResponse\", \"Not Answered\");\n\t\t}\n\n\t\tLOGGER.trace(\"Leaving the getQuestionAndResponse() method\");\n\t\treturn questionAndResponse;\n\t}",
"public Survey getSurveybySid(int sid);",
"@GetMapping(value = getStudentsByTeacherIdMapping + \"{teacherId}\")\r\n\tpublic ResponseEntity<List<Student>> getStudentsByTeacherId(@PathVariable(\"teacherId\") String teacherId) {\r\n\t\treturn ResponseEntity.ok().body(teacherStudentService.getStudentsByTeacherId(teacherId));\r\n\t}",
"Student findById(String id);",
"public List<Answer> answersOfQuestion(Question question){\n\t\treturn this.aRepo.findAllByQuestion(question);\n\t}",
"public Student getStudentById(int id){\n String whereClause=\"id=?\";\n String[] whereArgs={String.valueOf(id)};\n SQLiteDatabase st=getReadableDatabase();\n Cursor rs=st.query(\"student\",null,whereClause,\n whereArgs,null,null,null);\n if(rs.moveToNext()){\n String n=rs.getString(1);\n boolean g=rs.getInt(2)==1;\n double m=rs.getDouble(3);\n return new Student(id,n,g,m);\n }\n return null;\n }",
"public student getstudent(Integer id);",
"public List <Student> getAllStudents();",
"@Override\n\tpublic List getPaperByStudentId(int studentId, int testId) {\n\t\treturn null;\n\t}",
"public List<Question> getQuestionsExam(int eId){\r\n List<Question> questions = new ArrayList<>();\r\n String selectQuery = \"SELECT * FROM \" + TABLE_QUESTIONS + \" AS q INNER JOIN \" +\r\n TABLE_EXAMS_TOPICS_QUESTIONS + \" AS etq ON q.\" +\r\n KEY_ID + \" = etq.\" + KEY_QID +\r\n \" WHERE etq.\" + KEY_EID + \" = \" + eId + \" ORDER BY RANDOM()\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n if(cursor.moveToFirst()){\r\n do{\r\n Question question = new Question();\r\n question.setId(cursor.getInt(cursor.getColumnIndex(KEY_QID)));\r\n question.setQuestion(cursor.getString(cursor.getColumnIndex(KEY_QUESTION)));\r\n question.setAnswer(cursor.getString(cursor.getColumnIndex(KEY_ANSWER)));\r\n question.setExplanation(cursor.getString(cursor.getColumnIndex(KEY_EXPLANATION)));\r\n question.setOptA(cursor.getString(cursor.getColumnIndex(KEY_OPT_A)));\r\n question.setOptB(cursor.getString(cursor.getColumnIndex(KEY_OPT_B)));\r\n question.setOptC(cursor.getString(cursor.getColumnIndex(KEY_OPT_C)));\r\n question.setOptD(cursor.getString(cursor.getColumnIndex(KEY_OPT_D)));\r\n\r\n questions.add(question);\r\n\r\n } while (cursor.moveToNext());\r\n }\r\n\r\n\r\n\r\n cursor.close();\r\n db.close();\r\n return questions;\r\n }",
"@Transactional\n\tpublic List<Pitanje> getAllPtanje(int idQuiz) {\n\t\treturn quizDAO.getAllPtanje(idQuiz);\n\t}",
"public void setExamId(String examId) {\r\n\t\tthis.examId = examId;\r\n\t}",
"public QuizDTO getQuiz(long quizId) {\n QuizDTO newQuizDTO = new QuizDTO();\n Quiz quiz = quizRepository.findByQuizId(quizId);\n newQuizDTO.setQuizId(quiz.getQuizId());\n newQuizDTO.setQuizQuestion(quiz.getQuizQuestion());\n newQuizDTO.setQuizOptionDTOList(getOptionDTO(quiz));\n return newQuizDTO;\n }",
"@NotNull\n public StudentExam findOneWithExercises(Long studentExamId) {\n log.debug(\"Request to get student exam {} with exercises\", studentExamId);\n return studentExamRepository.findWithExercisesById(studentExamId)\n .orElseThrow(() -> new EntityNotFoundException(\"Student exam with id \\\"\" + studentExamId + \"\\\" does not exist\"));\n }",
"@NotNull\n public StudentExam findOneWithEagerExercises(Long studentExamId) {\n log.debug(\"Request to get student exam with exercises : {}\", studentExamId);\n return studentExamRepository.findWithEagerExercisesById(studentExamId)\n .orElseThrow(() -> new EntityNotFoundException(\"Student exam with id \\\"\" + studentExamId + \"\\\" does not exist\"));\n }",
"public interface IStudent {\r\n\t\r\n\tpublic String getId();\r\n\t\r\n\tpublic void setId(String i);\r\n\t\r\n\tpublic List<Integer> generateAnswers(List<String> options, boolean multi);\r\n}",
"@Transactional\n\t@Override\n\tpublic List<Lesson> showLesson(int qid) throws Exception {\n\t\treturn lessonDao.findAllByQid(qid);\n\t}",
"public List<MultQuestion> multChoiceQuestions(int qid);",
"private List<Student> getStudentList(StudentSearchResponse srchResponse) {\r\n\t\tList<Student> studentList = new ArrayList<Student>();\r\n\t\tif (srchResponse != null && srchResponse.size() > 0) {\r\n\t\t\tfor (StudentSearchResult srchRes : srchResponse) {\r\n\t\t\t\tStudent std = new Student(srchRes.getInquiryId(),\r\n\t\t\t\t\t\tsrchRes.getStudentNumber(), srchRes.getFirstName(),\r\n\t\t\t\t\t\tsrchRes.getLastName(), srchRes.getMaidenName(),\r\n\t\t\t\t\t\tsrchRes.getDateOfBirth(), srchRes.getCity(),\r\n\t\t\t\t\t\tsrchRes.getStateProvince(), srchRes.getSSN());\r\n\t\t\t\tstudentList.add(std);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn studentList;\r\n\t}",
"public static List<Student> getAllStudents(){\r\n Student student1 = new Student(\"Dowlath\",2,3.6,\"male\", Arrays.asList(\"Swim\",\"BasketBall\",\"VolleyBall\"),11);\r\n Student student2 = new Student(\"Bhavya\",2,3.8,\"female\",Arrays.asList(\"Swim\",\"Gymnastics\",\"soccer\"),12);\r\n\r\n\r\n /* 3rd Grade Students */\r\n Student student3 = new Student(\"Priya\",3,4.0,\"female\", Arrays.asList(\"Swim\",\"BasketBall\",\"Aerobics\"),10);\r\n Student student4 = new Student(\"Arsh\",3,3.9,\"male\",Arrays.asList(\"Swim\",\"Gymnastics\",\"soccer\"),9);\r\n\r\n\r\n /* 4th Grade Students */\r\n Student student5 = new Student(\"Sowmiya\",4,3.5,\"female\", Arrays.asList(\"Swim\",\"Dancing\",\"FootBall\"),15);\r\n Student student6 = new Student(\"Ariz\",4,3.9,\"male\",Arrays.asList(\"Swim\",\"BasketBall\",\"BaseBall\",\"FootBall\"),14);\r\n\r\n List<Student> students = Arrays.asList(student1,student2,student3,student4,student5,student6);\r\n return students;\r\n }",
"public List<Comment> getAllCommentsForQuiz(Integer quizId)\n\t{\n\t\tList<Comment> allComments = commentDao.getAllCommentsForQuiz(quizId);\n\t\t\n\t\tif(allComments==null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn allComments;\n\t\t\n\t}",
"@RequestMapping(method=RequestMethod.GET, value=\"/{id}/student/{idClass}/class\")\r\n\tpublic ResponseEntity<?> getMarksForStudentForAllSubjects(@PathVariable Long id, @PathVariable Long idClass){\r\n\t\ttry {\r\n\t\t\tStudentEntity student= studentService.getById(id);\r\n\t\t\tif(student==null) {\r\n\t\t\t\treturn new ResponseEntity<RESTError>(new RESTError(\"Student not found.\"), HttpStatus.NOT_FOUND);\r\n\t\t\t}\r\n\t\t\tClassEntity classs= classService.getById(idClass);\r\n\t\t\tif(classs==null) {\r\n\t\t\t\treturn new ResponseEntity<RESTError>(new RESTError(\"Class not found.\"), HttpStatus.NOT_FOUND);\r\n\t\t\t}\r\n\t\t\tif(!(studentService.findStudentsByClass(idClass).contains(student))) {\r\n\t\t\t\treturn new ResponseEntity<RESTError>(new RESTError(\"Student does not belong to this class.\"), HttpStatus.BAD_REQUEST);\r\n\t\t\t}\r\n\t\t\tList<SubjectMarksDto> list= new ArrayList<>();\r\n\t\t\tList<MarkDto> marksFirstSem= new ArrayList<>();\r\n\t\t\tList<MarkDto> marksSecondSem= new ArrayList<>();\r\n\t\t\tfor(TeacherSubjectClassEntity tsc: classs.getTeacherSubjectClass()) {\r\n\t\t\t\tSubjectDto subjectDto= new SubjectDto(tsc.getTeacherSubject().getSubject().getName());\r\n\t\t\t\tmarksFirstSem= gradingService.getMarksBySubjectBySemester(student, tsc, 1);\r\n\t\t\t\tmarksSecondSem=gradingService.getMarksBySubjectBySemester(student, tsc, 2);\r\n\t\t\t\tSubjectMarksDto subjectMarksDto= new SubjectMarksDto(subjectDto, marksFirstSem, marksSecondSem);\r\n\t\t\t\tlist.add(subjectMarksDto);\r\n\t\t\t}\r\n return new ResponseEntity<List<SubjectMarksDto>>(list, HttpStatus.OK);\r\n }catch(Exception e){\r\n\t\t\treturn new ResponseEntity<RESTError>(new RESTError(\"Exception occurred: \" + e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);\r\n\t\t }\r\n\t }",
"@Override\n\tpublic List<Questions> listQuestion(int testId) {\n\t\treturn null;\n\t}",
"public ArrayList<Student> getStudents() {\n\n ArrayList<Student> students = new ArrayList<Student>();\n String query = \"SELECT * FROM student\";\n try{\n result = statement.executeQuery(query);\n while(result.next()) {\n\n String id = Integer.toString(result.getInt(\"student_id\"));\n String firstName = result.getString(\"student_first_name\");\n String lastName = result.getString(\"student_last_name\");\n String degree = result.getString(\"degree\");\n String yearOfStudy = result.getString(\"year_of_study\");\n String outcome = result.getString(\"outcome\");\n students.add(new Student(id, firstName, lastName, degree, yearOfStudy, outcome));\n\n }\n }\n catch (SQLException e){\n\n }\n\n return students;\n }",
"public static void sitExam(int stuId) {\n ExamService examService = new ExamServiceImpl();\n Scanner sc = new Scanner(System.in);\n\n int testId;\n while (true) {\n System.out.print(\"Please input the test ID: \");\n try {\n String input = sc.nextLine().trim();\n if (input.length() == 6) {\n testId = Integer.parseInt(input);\n break;\n }\n } catch (NumberFormatException ignored) {\n }\n System.out.println(\"The id should be 6 digits!\");\n }\n\n List<Question> allQuestion = examService.sitExam(stuId, testId);\n LoggerUtil.addLog(\"[Student \" + stuId + \"] take exam \" + testId);\n\n for (Question q : allQuestion) {\n if (isTimeUp(testId) == true) {\n System.out.println(\"Exam ended, please wait us upload your answer...\");\n AutoJudgeService autoJudgeService = new AutoJudgeServiceImpl();\n autoJudgeService.judgeAnExam(testId);\n break;\n }\n System.out.printf(\"QNo:%d Type:%s, Complsory:%s Score:%d \\n\", q.getqNo(), q.getType(), q.getCompulsory(),\n q.getScore());\n System.out.println(\"****************************************\");\n System.out.println(q.getqDescri());\n System.out.println(\"****************************************\");\n\n String answer;\n while (true) {\n System.out.printf(\"Input your answer(in one line): \");\n answer = sc.nextLine();\n\n boolean nextQustion = false;\n while (true) {\n System.out.println(\"Next question?(Y/N)\");\n String op = sc.nextLine().trim().toUpperCase();\n if (op.equals(\"Y\"))\n nextQustion = true;\n else if (!op.equals(\"N\"))\n continue;\n break;\n }\n if (nextQustion) {\n break;\n }\n }\n examService.answerAnQuestion(q, stuId, answer);\n }\n\n while (true) {\n System.out.println(\"You have answered all question, submit now?(Y/N)\");\n String op = sc.nextLine().trim().toUpperCase();\n if (op.equals(\"Y\")) {\n AutoJudgeService autoJudgeService = new AutoJudgeServiceImpl();\n autoJudgeService.judgeAnExam(testId);\n break;\n }\n }\n }",
"public List<TextQuestion> TextQuestions(int aid);",
"@GetMapping(\"/getquestion/{id}\")\n public ResponseEntity<List<Questions>> getQuestion(@PathVariable Long id) {\n\n List<Questions> q = this.userServices.getquetion(id);\n\n if (q.size() <= 0) {\n\n return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n\n }\n\n return ResponseEntity.status(HttpStatus.CREATED).body(q);\n\n }",
"public int getIdQuiz() {\r\n\t\treturn idQuiz;\r\n\t}",
"List<Student> getAllStudents();",
"public String[] getQuestionAndAnswer(int qID) {\n String[] questionInfo = new String[8];\n String query;\n\n try {\n Connection con = Database.createDBconnection();\n Statement stmt = con.createStatement();\n query = \"SELECT question, ans1, ans2, ans3, ans4, ans5, correct_answer, point_value FROM question WHERE question_ID='\" + qID + \"';\";\n ResultSet rs = stmt.executeQuery(query);\n\n while(rs.next()){\n questionInfo[0] = rs.getString(\"question\"); // the question\n questionInfo[1] = rs.getString(\"ans1\"); // possible answer 1\n questionInfo[2] = rs.getString(\"ans2\"); // possible answer 2\n questionInfo[3] = rs.getString(\"ans3\"); // possible answer 3\n questionInfo[4] = rs.getString(\"ans4\"); // possible answer 4\n questionInfo[5] = rs.getString(\"ans5\"); // possible answer 5\n questionInfo[6] = rs.getString(\"correct_answer\"); // the correct answer\n questionInfo[7] = rs.getString(\"point_value\"); // the point value\n }\n\n Database.closeDBconnection(con);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return questionInfo;\n }",
"public void setAnswerId(int answerId) {\r\n this.answerId = answerId;\r\n }",
"@GetMapping(value = getDataForMapping + \"/{studentId}\")\r\n\tpublic ResponseEntity<List<Teacher>> getTeachersForMapping(@PathVariable(\"studentId\") String studentId) {\r\n\t\treturn ResponseEntity.ok().body(teacherStudentService.getTeachersForMapping(studentId));\r\n\t}",
"public Survey getSurvey(int surveyId) {\r\n try {\r\n Element survey = getSurveyElementBySid(surveyId);\r\n \r\n List<Question> questions = new ArrayList<>();\r\n \r\n //get Questions of survey\r\n NodeList questionList = survey.getElementsByTagName(\"question\");\r\n for (int i = 0; i < questionList.getLength(); i++) {\r\n Element questionElement = (Element) questionList.item(i);\r\n int qid = Integer.parseInt(questionElement.getAttribute(\"qid\"));\r\n String description = questionElement.getElementsByTagName(\"description\").item(0).getTextContent();\r\n String qTString = questionElement.getAttribute(\"type\");\r\n QuestionType qt = null;\r\n switch (qTString) {\r\n case \"closed\":\r\n qt = QuestionType.CLOSED;\r\n break;\r\n case \"multiple\":\r\n qt = QuestionType.MULTIPLE;\r\n break;\r\n }\r\n Question question = new Question(qid, description, qt);\r\n \r\n //get Answers of survey\r\n NodeList answersList = questionElement.getElementsByTagName(\"answer\");\r\n for (int j = 0; j < answersList.getLength(); j++) {\r\n Element answerElement = (Element) answersList.item(j);\r\n int aid = Integer.parseInt(answerElement.getAttribute(\"aid\"));\r\n String text = answerElement.getTextContent();\r\n question.addAnswer(aid, text);\r\n }\r\n\r\n questions.add(question);\r\n }\r\n return new Survey(\r\n Integer.parseInt(survey.getAttribute(\"sid\")), \r\n survey.getElementsByTagName(\"title\").item(0).getTextContent(), \r\n survey.getElementsByTagName(\"description\").item(0).getTextContent(), \r\n questions);\r\n } catch (NumberFormatException | DOMException e) {\r\n throw e;\r\n }\r\n }",
"public List<Student> getAllStudentData() {\r\n\t\tList<Student> list = new ArrayList<Student>();\r\n\t\ttry {\r\n\t\t\tConnection con = DatabaseUtility.getCon(inputStream);\r\n\t\t\tPreparedStatement ps = con.prepareStatement(\"select * from student\");\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tStudent stud = new Student();\r\n\r\n\t\t\t\tstud.setRollno(rs.getInt(1));\r\n\t\t\t\tstud.setFname(rs.getString(2));\r\n\t\t\t\tstud.setLname(rs.getString(3));\r\n\t\t\t\tstud.setEmail(rs.getString(4));\r\n\t\t\t\tstud.setGender(rs.getString(5));\r\n\t\t\t\tstud.setDOB(rs.getString(6));\r\n\t\t\t\tstud.setAddress(rs.getString(7));\r\n\t\t\t\tstud.setContact(rs.getString(8));\r\n\r\n\t\t\t\tlist.add(stud);\r\n\t\t\t}\r\n\t\t\tcon.close();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tSystem.out.println(ex);\r\n\t\t}\r\n\r\n\t\treturn list;\r\n\t}",
"public Long getQuizId() {\n return this.quizId;\n }",
"public Answer getAnswerById(int id) {\n \t\tfor (Answer answer : answers)\n \t\t\tif (answer.getId() == id)\n \t\t\t\treturn answer;\n \t\treturn null;\n \t}",
"private static String searchStudent ( int studentId){\n for (Student s : studentDB) {\n if (s.getID() == studentId) {\n return s.getName();\n }\n }\n return \"\";\n }",
"public Student getById(int id) {\r\n\r\n\t\treturn studentMapper.selectByPrimaryKey(id);\r\n\t}",
"public void setStudentId(String studentId) {\r\n this.studentId = studentId;\r\n }",
"public Student getById(int id) {\n\t\tResultSet rs = null;\n\t\t\n\t\tString sql = String.format(\"select * from student where id = %s\", id);\n\t\ttry {\n\t\t\trs = myDB.execSQLQuery(sql);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint aPosition = 0;\n\t\tStudent aStudent = getAStudentFromRS(rs, aPosition);\n\t\treturn aStudent;\n\t}",
"@Override\r\n\tpublic List<Yquestion> queryYquestion(int qid) {\n\t\treturn ym.queryYquestion(qid);\r\n\t}",
"public ExitQuestions[] getQuestionsWithAnswers(int exitId) {\n\t\t// declare variables\n\t\tfinal boolean isConnSupplied = (userConn != null);\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\tResultSet rs = null;\n\t\ttry{\n\t\t\t// get the user-specified connection or get a connection from the ResourceManager\n\t\t\tconn = isConnSupplied ? userConn : ResourceManager.getConnection();\n\t\t\t// construct the SQL statement\n\t\t\tfinal String SQL = \"SELECT E.*,ANSWER FROM EXIT_QUESTIONS E LEFT OUTER JOIN EXIT_QUESTIONS_MAP EQM ON EQM.EXIT_QUESTION_ID=E.ID AND EQM.EXIT_ID=?\";\n\t\t\tif (logger.isDebugEnabled()){\n\t\t\t\tlogger.debug(\"Executing \" + SQL);\n\t\t\t}\n\t\t\t// prepare statement\n\t\t\tstmt = conn.prepareStatement(SQL);\n\t\t\tstmt.setInt(1, exitId);\n\t\t\t// bind parameters\n\t\t\trs = stmt.executeQuery();\n\t\t\t// fetch the results\n\t\t\tCollection<ExitQuestions> resultList = new ArrayList<ExitQuestions>();\n\t\t\twhile (rs.next())\n\t\t\t\tresultList.add(new ExitQuestions(rs.getInt(1), rs.getString(2), rs.getString(3), rs.getString(4)));\n\t\t\tExitQuestions ret[] = new ExitQuestions[resultList.size()];\n\t\t\tresultList.toArray(ret);\n\t\t\treturn ret;\n\t\t} catch (Exception _e){\n\t\t\tlogger.error(\"Exception: \" + _e.getMessage(), _e);\n\t\t\treturn new ExitQuestions[] {};\n\t\t} finally{\n\t\t\tResourceManager.close(rs);\n\t\t\tResourceManager.close(stmt);\n\t\t\tif (!isConnSupplied){\n\t\t\t\tResourceManager.close(conn);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic List<Answer> getAllAnswers() {\n\t\treturn dao.findAll();\n\t}",
"public Observable<QuizQuestionResponse> fetchQuestionsForQuiz(final String quizId) {\n return Observable.create(new ObservableOnSubscribe<QuizQuestionResponse>() {\n @Override\n public void subscribe(ObservableEmitter<QuizQuestionResponse> e) throws Exception {\n\n\n Call<QuizQuestionResponse> call = mNetworkModel.fetchQuestionsForQuiz(quizId);\n Response<QuizQuestionResponse> response = call.execute();\n if (response != null && response.isSuccessful()) {\n QuizQuestionResponse body = response.body();\n Log.e(\"fetchQuestions--\", \"Successful\");\n e.onNext(body);\n } else if (response.code() == 404) {\n throw new Exception(mContext.getString(R.string.messageQuestionFetchFailed));\n } else if ((response.code() == 401) && SyncServiceHelper.refreshToken(mContext)) {\n Response<QuizQuestionResponse> response2 = call.clone().execute();\n if (response2 != null && response2.isSuccessful()) {\n QuizQuestionResponse body = response2.body();\n Log.e(\"fetchQuestions--\", \"Successful\");\n e.onNext(body);\n } else if ((response2.code() == 401)) {\n mContext.startActivity(LoginActivity.getUnauthorizedIntent(mContext));\n } else if (response2.code() == 404) {\n throw new Exception(mContext.getString(R.string.messageQuestionFetchFailed));\n } else {\n Log.e(\"fetchQuestions--\", \"Failed\");\n throw new Exception(mContext.getString(R.string.messageQuestionFetchFailed));\n }\n } else {\n Log.e(\"fetchQuestions--\", \"Failed\");\n throw new Exception(mContext.getString(R.string.messageQuestionFetchFailed));\n }\n\n e.onComplete();\n }\n });\n }",
"@Override\n\tpublic List<Exam_User> listExam_User(int exam_id) {\n\t\treturn examResultRepo.listExamResult(exam_id);\n\t}",
"@Override\n public ArrayList<QuestionBean> ObtainUsersExam(int course_id) {\n return null;\n }",
"@RequestMapping(value = \"getRubricScoringGuidelines.htm\", method = RequestMethod.POST)\n\tpublic final @ResponseBody Map<String, Object> getRubricScoringGuidelines(Long taskVariantId, Long testId,\n\t\t\tLong studentId) {\n\t\tLOGGER.trace(\"Entering the getRubricScoringGuidelines() method\");\n\t\tMap<String, Object> rubricScoresGuidelines = new HashMap<String, Object>();\n\t\tList<RubricReportDto> rubricReportDtos = testService.getRubricByTaskVariant(taskVariantId);\n\t\trubricScoresGuidelines.put(\"rubrics\", rubricReportDtos);\n\t\tRubricScore rubricScore = studentReportService.getRubricScoreByStudent(studentId, testId, taskVariantId);\n\t\tif (rubricScore != null && rubricScore.getRubricInfoIds() != null) {\n\t\t\tList<String> selectedIds = Arrays.asList(rubricScore.getRubricInfoIds().split(\",\"));\n\t\t\tfor (RubricReportDto rubricReportDto : rubricReportDtos) {\n\t\t\t\tif (selectedIds.contains(rubricReportDto.getRubricInfoId() + \"\")) {\n\t\t\t\t\trubricReportDto.setSelected(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\trubricScoresGuidelines.put(\"rubricScore\", rubricScore);\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"MM-dd-yyyy hh:mm:ss a\");\n\t\t\trubricScoresGuidelines.put(\"date\", dateFormat.format(rubricScore.getDate()));\n\t\t}\n\n\t\tLOGGER.trace(\"Leaving the getRubricScoringGuidelines() method\");\n\t\treturn rubricScoresGuidelines;\n\t}",
"public static Object[] loadQuestions(String surveyId, String serverBase)\r\n \t\t\tthrows Exception {\r\n \t\tObject[] results = new Object[2];\r\n \t\tMap<String, String> questions = new HashMap<String, String>();\r\n \t\tList<QuestionGroupDto> groups = fetchQuestionGroups(serverBase,\r\n \t\t\t\tsurveyId);\r\n \t\tList<String> keyList = new ArrayList<String>();\r\n \t\tif (groups != null) {\r\n \t\t\tfor (QuestionGroupDto group : groups) {\r\n \t\t\t\tList<QuestionDto> questionDtos = fetchQuestions(serverBase,\r\n \t\t\t\t\t\tgroup.getKeyId());\r\n \t\t\t\tif (questionDtos != null) {\r\n \t\t\t\t\tfor (QuestionDto question : questionDtos) {\r\n \t\t\t\t\t\tkeyList.add(question.getKeyId().toString());\r\n \t\t\t\t\t\tquestions.put(question.getKeyId().toString(), question\r\n \t\t\t\t\t\t\t\t.getText());\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\tresults[0] = keyList;\r\n \t\tresults[1] = questions;\r\n \t\treturn results;\r\n \t}"
] | [
"0.6840287",
"0.65341187",
"0.63026786",
"0.62849385",
"0.61267096",
"0.6057431",
"0.59713715",
"0.59692544",
"0.59380525",
"0.58587986",
"0.5821672",
"0.5815335",
"0.5812183",
"0.5785601",
"0.57460254",
"0.5698992",
"0.56979066",
"0.56541634",
"0.56527936",
"0.5627679",
"0.5596144",
"0.5576349",
"0.556748",
"0.55247146",
"0.55243635",
"0.55150586",
"0.54738975",
"0.54558283",
"0.54524404",
"0.5411621",
"0.5408573",
"0.54037374",
"0.5386607",
"0.53737605",
"0.5368064",
"0.53486615",
"0.53451455",
"0.53392535",
"0.5334674",
"0.5295782",
"0.5276724",
"0.5273299",
"0.52633154",
"0.52597845",
"0.525736",
"0.5254067",
"0.5241956",
"0.52415067",
"0.5230502",
"0.522071",
"0.5218074",
"0.52075624",
"0.52070075",
"0.52037877",
"0.51889074",
"0.5181076",
"0.51710486",
"0.51641804",
"0.514882",
"0.5144805",
"0.5137486",
"0.5118862",
"0.51151955",
"0.511056",
"0.5093007",
"0.50786865",
"0.507638",
"0.50735956",
"0.50735307",
"0.5070577",
"0.5066145",
"0.5060912",
"0.50601274",
"0.50534445",
"0.5053259",
"0.50488794",
"0.50398046",
"0.50350386",
"0.50246394",
"0.5021107",
"0.5018463",
"0.5000589",
"0.49910197",
"0.49880806",
"0.49874225",
"0.49772385",
"0.49763802",
"0.4975964",
"0.49756494",
"0.4965795",
"0.4965613",
"0.49641502",
"0.4959907",
"0.49483857",
"0.49478403",
"0.49473947",
"0.49440107",
"0.49392566",
"0.49328804",
"0.49305648"
] | 0.6972141 | 0 |
Method for extracting the Huffman Codes from a Huffman Tree (PQHeap). | public String[] makeCodes(){
HuffmanTempTree tree = makeTree();
return tree.inOrderTreeWalkPath(tree.root, "", codes);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private HuffmanTreeNode[] heapify(int freq[][]) {\n\t\tHuffmanTreeNode[] heap = new HuffmanTreeNode[freq.length];\n\t\tfor (int i = 0; i < freq.length; i++)\n\t\t{\n\t\t\theap[i] = new HuffmanTreeNode(freq[i][1], freq[i][0], null, null);\n\t\t}\n\t\t\n\t\theap = heapSort(heap);\n\n\t\treturn heap;\n\t}",
"public void constructTree(){\n PriorityQueue<HCNode> queue=new PriorityQueue<HCNode>();\n \n for(int i=0;i<MAXSIZE;i++){\n if(NOZERO){\n if(occTable[i]!=0){\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }else{\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }\n //constructing the Huffman Tree\n HCNode n1=null,n2=null;\n while(((n2=queue.poll())!=null) && ((n1=queue.poll())!=null)){\n HCNode nnode=new HCNode(n1.str+n2.str,n1.occ+n2.occ, null);\n nnode.left=n1;nnode.right=n2;\n n1.parent=nnode;n2.parent=nnode;\n queue.add(nnode);\n }\n if(n1==null&&n2==null){\n System.out.println(\"oops\");\n }\n if(n1!=null)\n root=n1;\n else\n root=n2;\n }",
"public void HuffmanCode()\n {\n String text=message;\n /* Count the frequency of each character in the string */\n //if the character does not exist in the list add it\n for(int i=0;i<text.length();i++)\n {\n if(!(c.contains(text.charAt(i))))\n c.add(text.charAt(i));\n } \n int[] freq=new int[c.size()];\n //counting the frequency of each character in the text\n for(int i=0;i<c.size();i++)\n for(int j=0;j<text.length();j++)\n if(c.get(i)==text.charAt(j))\n freq[i]++;\n /* Build the huffman tree */\n \n root= buildTree(freq); \n \n }",
"public void createHuffmanTree() {\n\t\twhile (pq.getSize() > 1) {\n\t\t\tBinaryTreeInterface<HuffmanData> b1 = pq.removeMin();\n\t\t\tBinaryTreeInterface<HuffmanData> b2 = pq.removeMin();\n\t\t\tHuffmanData newRootData =\n\t\t\t\t\t\t\tnew HuffmanData(b1.getRootData().getFrequency() +\n\t\t\t\t\t\t\t\t\t\t\tb2.getRootData().getFrequency());\n\t\t\tBinaryTreeInterface<HuffmanData> newB =\n\t\t\t\t\t\t\tnew BinaryTree<HuffmanData>(newRootData,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b1,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b2);\n\t\t\tpq.add(newB);\n\t\t}\n\t\thuffmanTree = pq.getMin();\n\t}",
"public Hashtable<Character,Code> getHuffmanCodes(int numberOfCodes,Hashtable<String,Character> revCodes) throws IOException {\r\n\t\tbyte[] b;\r\n\t\tHashtable<Character,Code> codes = new Hashtable<>();\r\n\t\t for (int i = 0 ; i < numberOfCodes ; i++) {\r\n\t\t\t System.out.println(\"i = \" + i);\r\n\t\t\t // i create a stringBuilder that will hold the code for each character\r\n\t\t\t StringBuilder c = new StringBuilder();\r\n\t\t\t // read the integer (4 bytes)\r\n\t\t\t b = new byte[4];\r\n\t\t\t in.read(b);\r\n\t\t\t // will hold the 4 bytes\r\n\t\t\t int code = 0;\r\n\t\t\t \r\n\t\t\t /* beacuse we wrote the integer reversed in the head\r\n\t\t\t * so the first 2 bytes from the left will hold the huffman's code\r\n\t\t\t * we get the second one then stick it to the (code) value we shift it to the left \r\n\t\t\t * then we get the first one and stick it to the (code) without shifting it\r\n\t\t\t * so actually we swipe the first 2 bytes because they are reversed\r\n\t\t\t */\r\n\t\t\t code |= (b[1] & 0xFF);\r\n\t\t\t code <<= 8;\r\n\t\t\t code |= (b[0] & 0xFF);\r\n\t\t\t \r\n\t\t\t // this loop go throw the (code) n bits where n is the length of the huff code that stored in the 2nd index of the array\r\n\t\t\t for (int j = 0 ; j < (b[2] & 0xFF) ; j++) {\r\n\t\t\t\t /*\r\n\t\t\t\t * each loop we compare the first bit from the right using & operation ans if it 1 so insert 1 to he first of the (c) which hold the huff it self\r\n\t\t\t\t * and if it zero we will insert zero as a string for both zero or 1\r\n\t\t\t\t */\r\n\t\t\t\t if ((code & 1) == 1) {\r\n\t\t\t\t\t c.insert(0, \"1\");\r\n\t\t\t\t } else \r\n\t\t\t\t\t c.insert(0, \"0\");\r\n\t\t\t\t code >>>= 1;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t// codes.put((char)(b[3] & 0xFF), new Code((char)(b[3] & 0xFF),c.toString(),rep2[b[0] & 0xFF]));\r\n\t\t\t System.out.println(\"c = \" + c);\r\n\t\t\t \r\n\t\t\t // we store the huff code as a key in the hash and its value will be the character that in the index 3\r\n\t\t\t revCodes.put(c.toString(), (char)(b[3] & 0xFF));\r\n\t\t\t \r\n\t\t }\r\n\t\t return codes;\r\n\t}",
"public void makeTree(){\n //convert Hashmap into charList\n for(Map.Entry<Character,Integer> entry : freqTable.entrySet()){\n HuffmanNode newNode = new HuffmanNode(entry.getKey(),entry.getValue());\n charList.add(newNode);\n }\n \n if(charList.size()==0)\n return;\n \n if(charList.size()==1){\n HuffmanNode onlyNode = charList.get(0);\n root = new HuffmanNode(null,onlyNode.getFrequency());\n root.setLeft(onlyNode);\n return;\n }\n \n Sort heap = new Sort(charList);\n heap.heapSort();\n \n while(heap.size()>1){\n \n HuffmanNode leftNode = heap.remove(0);\n HuffmanNode rightNode = heap.remove(0);\n \n HuffmanNode newNode = merge(leftNode,rightNode);\n heap.insert(newNode);\n heap.heapSort();\n }\n \n charList = heap.getList();\n root = charList.get(0);\n }",
"private void buildBinaryTree() {\n log.info(\"Constructing priority queue\");\n Huffman huffman = new Huffman(cache.vocabWords());\n huffman.build();\n\n log.info(\"Built tree\");\n\n }",
"private PQHeap makeQueue(){\n \tPQHeap queue = new PQHeap(frequency.length);\n \tfor (int i = 0; i < frequency.length; i++) {\n \t\tqueue.insert(new Element(frequency[i], new HuffmanTempTree(i)));\n \t}\n \treturn queue;\n \t}",
"public HuffmanCodes() {\n\t\thuffBuilder = new PriorityQueue<CS232LinkedBinaryTree<Integer, Character>>();\n\t\tfileData = new ArrayList<char[]>();\n\t\tfrequencyCount = new int[127];\n\t\thuffCodeVals = new String[127];\n\t}",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tMap<Character, Integer> frequencyMap = new HashMap<>();\n\t\tint textLength = text.length();\n\n\t\tfor (int i = 0; i < textLength; i++) {\n\t\t\tchar character = text.charAt(i);\n\t\t\tif (!frequencyMap.containsKey(character)) {\n\t\t\t\tfrequencyMap.put(character, 1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tint newFreq = frequencyMap.get(character) + 1;\n\t\t\t\tfrequencyMap.replace(character, newFreq);\n\t\t\t}\n\t\t}\n\n\t\tPriorityQueue<Node> queue = new PriorityQueue<>();\n\n\t\tIterator iterator = frequencyMap.entrySet().iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMap.Entry<Character, Integer> pair = (Map.Entry<Character, Integer>) iterator.next();\n\t\t\tNode node = new Node(null, null, pair.getKey(), pair.getValue());\n\t\t\tqueue.add(node);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tNode node1 = queue.poll();\n\t\t\tNode node2 = queue.poll();\n\t\t\tNode parent = new Node(node1, node2, '\\t', node1.getFrequency() + node2.getFrequency());\n\t\t\tqueue.add(parent);\n\t\t}\n\t\thuffmanTree = queue.poll();\n\t\tSystem.out.println(\"firstNode: \"+ huffmanTree);\n\t\tcodeTable(huffmanTree);\n\n\t\t//Iterator iterator1 = encodingTable.entrySet().iterator();\n\n\t\t/*\n\t\twhile (iterator1.hasNext()) {\n\t\t\tMap.Entry<Character, String> pair = (Map.Entry<Character, String>) iterator1.next();\n\t\t\tSystem.out.println(pair.getKey() + \" : \" + pair.getValue() + \"\\n\");\n\t\t}\n\t\t*/\n\n\t\t//System.out.println(\"Hashmap.size() : \" + frequencyMap.size());\n\n\t}",
"private static void generateHuffmanTree(){\n try (BufferedReader br = new BufferedReader(new FileReader(_codeTableFile))) {\n String line;\n while ((line = br.readLine()) != null) {\n // process the line.\n if(!line.isEmpty() && line!=null){\n int numberData = Integer.parseInt(line.split(\" \")[0]);\n String code = line.split(\" \")[1];\n Node traverser = root;\n for (int i = 0; i < code.length() - 1; i++){\n char c = code.charAt(i); \n if (c == '0'){\n //bit is 0\n if(traverser.getLeftPtr() == null){\n traverser.setLeftPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getLeftPtr();\n }\n else{\n //bit is 1\n if(traverser.getRightPtr() == null){\n traverser.setRightPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getRightPtr();\n }\n }\n //Put data in the last node by creating a new leafNode\n char c = code.charAt(code.length() - 1);\n if(c == '0'){\n traverser.setLeftPtr(new LeafNode(9999999, numberData, null, null));\n }\n else{\n traverser.setRightPtr(new LeafNode(9999999, numberData, null, null));\n }\n }\n }\n } \n catch (IOException ex) {\n Logger.getLogger(FrequencyTableBuilder.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public int[] headCode(Hashtable<Character,Code> codes,int[] rep) {\r\n\t\t\r\n\t\tint count = 0;\r\n\t\tint counter = 0;\r\n\t\tfor (int i = 0 ; i < rep.length ; i++) \r\n\t\t\tif (rep[i] > 0)\r\n\t\t\t\tcount++;\r\n\t\tint[] headArr = new int[count]; // create integer array that will hold the integer value for the every character information \r\n\t\t\r\n\t\tfor (int i = 0 ; i < rep.length ; i++) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (rep[i] > 0) {\r\n\t\t\t\tSystem.out.println(i);\r\n\t\t\t\tint num = 0;\r\n\t\t\t\t\r\n\t\t\t\t//num |= codes.get((char)i).code.length();\r\n\t\t\t\t\r\n\t\t\t\tString c = codes.get((char)i).code; // get huffman code for the character from hash table which is O(1)\r\n\t\t\t\tSystem.out.println(c + \" \" + c.length());\r\n\t\t\t\tfor (int j = 0 ; j < c.length() ; j++) {\r\n\t\t\t\t\tnum <<= 1; // shift the integer by 1 bit to the left\r\n\t\t\t\t\tif (c.charAt(j) == '1') {\r\n\t\t\t\t\t\tnum |= 1; // make or operation for each digit of the huffman code with num that will contains the information\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnum |= 0; \r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tint ch = i; \r\n\t\t\t\tch <<= 24; // shift character value 24 bit to the left so that it will be in the first byte to the left of the integer\r\n\t\t\t\tint l = c.length();\r\n\t\t\t\tl <<= 16; // shift the length of huffman code 16 bit to the left so that it will be in the second byte to the left of the integer\r\n\t\t\t\tnum |= ch; // make or operation that will put the value of character to the fisrt byte of the integer\r\n\t\t\t\tnum |= l; // make of operation that will put the calue of huffman code to the second byte of the integer\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\t * integer representation >> 00000000000000000000000000000000\r\n\t\t\t\t * my representation >>\t ccccccccllllllllhhhhhhhhhhhhhhhh\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(num);\r\n\t\t\t\theadArr[counter++] = num;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn headArr;\r\n\t\t\r\n\t}",
"public Word[] encode(Word[] heap) {\n\t\theapLast = heap.length - 1;\n\t\tArrays.sort(heap);\n\n\t\tfor (int i = 0; i < heap.length - 1; i++) {\n\t\t\tWord<String> word1 = (Word<String>) removeRoot(heap, 0, heapLast--);\n\t\t\tWord<String> word2 = (Word<String>) removeRoot(heap, 0, heapLast--);\n\n\t\t\tint weight = word1.weight + word2.weight;\n\t\t\tString str = word1.str + word2.str;\n\t\t\tWord word = new Word(weight, str);\n\n\t\t\theapLast = heapLast + 3;\n\t\t\tinsert(heap, word, 0, heapLast);\n\t\t}\n\t\t\n\t\treturn heap;\n\t}",
"private HuffmanTempTree makeTree() {\n \tPQHeap queue = makeQueue();\n \tfor (int i = 0; i < frequency.length - 1; i++) {\n \t\tHuffmanTempTree zTree = new HuffmanTempTree(0);\n \t\tElement x = queue.extractMin();\n \t\tElement y = queue.extractMin();\n \t\tint zFreq = x.key + y.key;\n \t\tzTree.merge((HuffmanTempTree) x.data, (HuffmanTempTree) y.data);\n \t\tqueue.insert(new Element(zFreq, zTree));\n \t}\n \treturn (HuffmanTempTree) queue.extractMin().data;\n \t}",
"public HuffmanTree(Queue<Node> queue) {\r\n while (queue.size() > 1) {\r\n Node left = queue.poll();\r\n Node right = queue.poll();\r\n Node node = new Node('-', left.f + right.f, left, right);\r\n queue.add(node);\r\n }\r\n this.root = queue.peek();\r\n\r\n //initial two maps\r\n this.initialTable(this.root, \"\");\r\n\r\n }",
"public static void main(String[] args) {\n Huffman huffman=new Huffman(\"Shevchenko Vladimir Vladimirovich\");\n System.out.println(huffman.getCodeText());//\n //answer:110100001001101011000001001110111110110101100110110001001110101111100011101000011011000100111010111110001110100101110101111100000\n\n huffman.getSizeBits();//размер в битах\n ;//кол-во символов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*8)); //коэффициент сжатия относительно aski кодов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*\n (Math.pow(huffman.getValueOfCharactersOfText(),0.5)))); //коэффициент сжатия относительно равномерного кода. Не учитывается размер таблицы\n System.out.println(huffman.getMediumLenght());//средняя длина кодового слова\n System.out.println(huffman.getDisper());//дисперсия\n\n\n }",
"public void setPriorityQueue() {\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tif (leafEntries[i].getFrequency() > 0)\n\t\t\t\tpq.add(new BinaryTree<HuffmanData>(leafEntries[i]));\n\t\t}\n\t}",
"public static void main(String[] args) throws FileNotFoundException, IOException {\n\t\tString input = \"\";\r\n\r\n\t\t//읽어올 파일 경로\r\n\t\tString filePath = \"C:/Users/user/Desktop/data13_huffman.txt\";\r\n\r\n\t\t//파일에서 읽어옴\r\n\t\ttry(FileInputStream fStream = new FileInputStream(filePath);){\r\n\t\t\tbyte[] readByte = new byte[fStream.available()];\r\n\t\t\twhile(fStream.read(readByte) != -1);\r\n\t\t\tfStream.close();\r\n\t\t\tinput = new String(readByte);\r\n\t\t}\r\n\r\n\t\t//빈도수 측정 해시맵 생성\r\n\t\tHashMap<Character, Integer> frequency = new HashMap<>();\r\n\t\t//최소힙 생성\r\n\t\tList<Node> nodes = new ArrayList<>();\r\n\t\t//테이블 생성 해시맵\r\n\t\tHashMap<Character, String> table = new HashMap<>();\r\n\r\n\t\t//노드와 빈도수 측정\r\n\t\tfor(int i = 0; i < input.length(); i++) {\r\n\t\t\tif(frequency.containsKey(input.charAt(i))) {\r\n\t\t\t\t//이미 있는 값일 경우 빈도수를 1 증가\r\n\t\t\t\tchar currentChar = input.charAt(i);\r\n\t\t\t\tfrequency.put(currentChar, frequency.get(currentChar) + 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//키를 생성해서 넣어줌\r\n\t\t\t\tfrequency.put(input.charAt(i), 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//최소 힙에 저장\r\n\t\tfor(Character key : frequency.keySet()) \r\n\t\t\tnodes.add(new Node(key, frequency.get(key), null, null));\r\n\t\t\t\t\r\n\t\t//최소힙으로 정렬\r\n\t\tbuildMinHeap(nodes);\r\n\r\n\t\t//huffman tree를 만드는 함수 실행\r\n\t\tNode resultNode = huffman(nodes);\r\n\r\n\t\t//파일에 씀 (table)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_table.txt\")){\r\n\t\t\tmakeTable(table, resultNode, \"\");\r\n\t\t\tfor(Character key : table.keySet()) {\r\n\t\t\t\t//System.out.println(key + \" : \" + table.get(key));\r\n\t\t\t\tfw.write(key + \" : \" + table.get(key) + \"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//파일에 씀 (encoded code)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_encoded.txt\")){\r\n\t\t\tString allString = \"\";\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < input.length(); i++)\r\n\t\t\t\tallString += table.get(input.charAt(i));\r\n\r\n\t\t\t//System.out.println(allString);\r\n\t\t\tfw.write(allString);\r\n\t\t}\r\n\t}",
"void buildHeap() {\n\tfor(int i=parent(size-1); i>=0; i--) {\n\t percolateDown(i);\n\t}\n }",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\ttextArray = text.toCharArray();\n\n\t\tPriorityQueue<Leaf> queue = new PriorityQueue<>(new Comparator<Leaf>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Leaf a, Leaf b) {\n\t\t\t\tif (a.frequency > b.frequency) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (a.frequency < b.frequency) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfor (char c : textArray) {\n\t\t\tif (chars.containsKey(c)) {\n\t\t\t\tint freq = chars.get(c);\n\t\t\t\tfreq = freq + 1;\n\t\t\t\tchars.remove(c);\n\t\t\t\tchars.put(c, freq);\n\t\t\t} else {\n\t\t\t\tchars.put(c, 1);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"tree print\");\t\t\t\t\t\t\t\t// print method begin\n\n\t\tfor(char c : chars.keySet()){\n\t\t\tint freq = chars.get(c);\n\t\t\tSystem.out.println(c + \" \" + freq);\n\t\t}\n\n\t\tint total = 0;\n\t\tfor(char c : chars.keySet()){\n\t\t\ttotal = total + chars.get(c);\n\t\t}\n\t\tSystem.out.println(\"total \" + total);\t\t\t\t\t\t\t// ends\n\n\t\tfor (char c : chars.keySet()) {\n\t\t\tLeaf l = new Leaf(c, chars.get(c), null, null);\n\t\t\tqueue.offer(l);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tLeaf a = queue.poll();\n\t\t\tLeaf b = queue.poll();\n\n\t\t\tint frequency = a.frequency + b.frequency;\n\n\t\t\tLeaf leaf = new Leaf('\\0', frequency, a, b);\n\n\t\t\tqueue.offer(leaf);\n\t\t}\n\n\t\tif(queue.size() == 1){\n\t\t\tthis.root = queue.peek();\n\t\t}\n\t}",
"public HuffmanTree() {\r\n\t\tsuper();\r\n\t}",
"void buildHeap() {\n for (int i = parent(size - 1); i >= 0; i--) {\n percolateDown(i);\n }\n }",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tif (text.length() <= 1)\n\t\t\treturn;\n\n\t\t//Create a the frequency huffman table\n\t\tHashMap<Character, huffmanNode> countsMap = new HashMap<>();\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tchar c = text.charAt(i);\n\t\t\tif (countsMap.containsKey(c))\n\t\t\t\tcountsMap.get(c).huffmanFrequency++;\n\t\t\telse\n\t\t\t\tcountsMap.put(c, new huffmanNode(c, 1));\n\t\t}\n\n\t\t//Build the frequency tree\n\t\tPriorityQueue<huffmanNode> countQueue = new PriorityQueue<>(countsMap.values());\n\t\twhile (countQueue.size() > 1) {\n\t\t\thuffmanNode left = countQueue.poll();\n\t\t\thuffmanNode right = countQueue.poll();\n\t\t\thuffmanNode parent = new huffmanNode('\\0', left.huffmanFrequency + right.huffmanFrequency);\n\t\t\tparent.leftNode = left;\n\t\t\tparent.rightNode = right;\n\n\t\t\tcountQueue.offer(parent);\n\t\t}\n\n\t\thuffmanNode rootNode = countQueue.poll();\n\n\t\t//Assign the codes to each node in the tree\n\t\tStack<huffmanNode> huffmanNodeStack = new Stack<>();\n\t\thuffmanNodeStack.add(rootNode);\n\t\twhile (!huffmanNodeStack.empty()) {\n\t\t\thuffmanNode huffmanNode = huffmanNodeStack.pop();\n\n\t\t\tif (huffmanNode.huffmanValue != '\\0') {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\thuffmanNode.codeRecord.forEach(sb::append);\n\t\t\t\tString codeSb = sb.toString();\n\n\t\t\t\tencodingTable.put(huffmanNode.huffmanValue, codeSb);\n\t\t\t\tdecodingTable.put(codeSb, huffmanNode.huffmanValue);\n\t\t\t}\n\t\t\telse {\n\t\t\t\thuffmanNode.leftNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.leftNode.codeRecord.add('0');\n\t\t\t\thuffmanNode.rightNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.rightNode.codeRecord.add('1');\n\t\t\t}\n\n\t\t\tif (huffmanNode.leftNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.leftNode);\n\n\t\t\tif (huffmanNode.rightNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.rightNode);\n\t\t}\n\t}",
"private Queue<HuffmanNode> ArrayHuffmanCodeCreator(Queue<HuffmanNode> frequencies) {\n while (frequencies.size() > 1) {\n HuffmanNode first = frequencies.poll();\n HuffmanNode second = frequencies.poll();\n HuffmanNode tempNode = new \n HuffmanNode(first.getFrequency() + second.getFrequency());\n tempNode.left = first;\n tempNode.right = second;\n frequencies.add(tempNode);\n }\n return frequencies;\n }",
"public Huffman(String input) {\n\t\t\n\t\tthis.input = input;\n\t\tmapping = new HashMap<>();\n\t\t\n\t\t//first, we create a map from the letters in our string to their frequencies\n\t\tMap<Character, Integer> freqMap = getFreqs(input);\n\n\t\t//we'll be using a priority queue to store each node with its frequency,\n\t\t//as we need to continually find and merge the nodes with smallest frequency\n\t\tPriorityQueue<Node> huffman = new PriorityQueue<>();\n\t\t\n\t\t/*\n\t\t * TODO:\n\t\t * 1) add all nodes to the priority queue\n\t\t * 2) continually merge the two lowest-frequency nodes until only one tree remains in the queue\n\t\t * 3) Use this tree to create a mapping from characters (the leaves)\n\t\t * to their binary strings (the path along the tree to that leaf)\n\t\t * \n\t\t * Remember to store the final tree as a global variable, as you will need it\n\t\t * to decode your encrypted string\n\t\t */\n\t\t\n\t\tfor (Character key: freqMap.keySet()) {\n\t\t\tNode thisNode = new Node(key, freqMap.get(key), null, null);\n\t\t\thuffman.add(thisNode);\n\t\t}\n\t\t\n\t\twhile (huffman.size() > 1) {\n\t\t\tNode leftNode = huffman.poll();\n\t\t\tNode rightNode = huffman.poll();\n\t\t\tint parentFreq = rightNode.freq + leftNode.freq;\n\t\t\tNode parent = new Node(null, parentFreq, leftNode, rightNode);\n\t\t\thuffman.add(parent);\n\t\t}\n\t\t\n\t\tthis.huffmanTree = huffman.poll();\n\t\twalkTree();\n\t}",
"public Tree getHuffmanTree() {\n return huffmanTree;\n }",
"public CS232LinkedBinaryTree<Integer, Character> buildHuffTree() {\n\n\t\twhile (huffBuilder.size() > 1) {// Until one tree is left...\n\n\t\t\t// Make references to the important trees\n\t\t\tCS232LinkedBinaryTree<Integer, Character> newTree = new CS232LinkedBinaryTree<Integer, Character>();\n\t\t\tCS232LinkedBinaryTree<Integer, Character> firstSubTree = huffBuilder.remove();\n\t\t\tCS232LinkedBinaryTree<Integer, Character> secondSubTree = huffBuilder.remove();\n\n\t\t\t// Create the new root on the new joined tree. Use the character of higher priority.\n\t\t\tCharacter newTreeRootValue = this.getPriorityCharacter(firstSubTree.root.value, secondSubTree.root.value);\n\t\t\tnewTree.add(firstSubTree.root.key + secondSubTree.root.key, newTreeRootValue);\n\n\t\t\t// Join the new root's right side with the first tree\n\t\t\tnewTree.root.right = firstSubTree.root;\n\t\t\tfirstSubTree.root.parent = newTree.root;\n\n\t\t\t// Join the new root's left side with the second tree\n\t\t\tnewTree.root.left = secondSubTree.root;\n\t\t\tsecondSubTree.root.parent = newTree.root;\n\n\t\t\t// put the newly created tree back into the priority queue\n\t\t\thuffBuilder.add(newTree); \n\t\t}\n\t\t/*\n\t\t * At the end of the whole process, we have one final mega-tree. return\n\t\t * it and finally empty the queue!\n\t\t */\n\t\treturn huffBuilder.remove();\n\t}",
"public void buildTree(HuffData[] symbols) {\n //Create a new priorityqueue of type BinaryTree<HuffData> the size of \n //the number of symbols passed in\n Queue<BinaryTree<HuffData>> theQueue = new PriorityQueue<BinaryTree<HuffData>>(symbols.length, new CompareHuffmanTrees());\n //For each symbol in the symbols array\n for (HuffData nextSymbol : symbols) {\n //Create a new binary tree with the symbol\n BinaryTree<HuffData> aBinaryTree = new BinaryTree<HuffData>(nextSymbol, null, null);\n //Offer the new binary tree to the queue\n theQueue.offer(aBinaryTree);\n }\n //While there are still more than one items in the queue\n while(theQueue.size() > 1) {\n BinaryTree<HuffData> left = theQueue.poll(); //Take the top off the queue\n BinaryTree<HuffData> right = theQueue.poll(); //Take the new top off the queue\n int wl = left.getData().weight; //Get the weight of the left BinaryTree\n int wr = left.getData().weight; //Get the weight of the right BinaryTree\n //Create a new HuffData object with the weight as the sum of the left\n //and right and a null symbol\n HuffData sum = new HuffData(wl + wr, null); \n //Create a new BinaryTree with the sum HuffData and the left and right\n //as the left and right children\n BinaryTree<HuffData> newTree = new BinaryTree<HuffData>(sum, left, right);\n //Offer the sum binarytree back to the queue\n theQueue.offer(newTree);\n }\n //Take the last item off the queue\n huffTree = theQueue.poll();\n \n //Initalize the EncodeData array to be the same length as the passed in symbols\n encodings = new EncodeData[symbols.length];\n }",
"private void buildTree() {\n\t\tfinal TreeSet<Tree> treeSet = new TreeSet<Tree>();\n\t\tfor (char i = 0; i < 256; i++) {\n\t\t\tif (characterCount[i] > 0) {\n\t\t\t\ttreeSet.add(new Tree(i, characterCount[i]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge the trees to one Tree\n\t\tTree left;\n\t\tTree right;\n\t\twhile (treeSet.size() > 1) {\n\t\t\tleft = treeSet.pollFirst();\n\t\t\tright = treeSet.pollFirst();\n\t\t\ttreeSet.add(new Tree(left, right));\n\t\t}\n\n\t\t// There is only our final tree left\n\t\thuffmanTree = treeSet.pollFirst();\n\t}",
"private HuffmanNode buildTree(int n) {\r\n \tfor (int i = 1; i <= n; i++) {\r\n \t\tHuffmanNode node = new HuffmanNode();\r\n \t\tnode.left = pQueue.poll();\r\n \t\tnode.right = pQueue.poll();\r\n \t\tnode.frequency = node.left.frequency + node.right.frequency;\r\n \t\tpQueue.add(node);\r\n \t}\r\n return pQueue.poll();\r\n }",
"private void recoverCodes(PrioQ p)\n\t{\n\t\tcodes = new String[256];\n\t\t\n\t\tString s = \"\";\n\t\twhile(s.length() < p.get(0).getCount())\n\t\t{\n\t\t\ts += \"0\";\n\t\t}\n\t\tp.get(0).setCanCode(s);\n\t\tcodes[p.get(0).getData()] = s;\n\t\t\n\t\tint n = 0;\n\t\tfor(int i = 1; i < p.size(); i++)\n\t\t{\n\t\t\tn++;\n\t\t\twhile(Integer.toBinaryString(n).length() < \n\t\t\t\t\tp.get(i).getCount())\n\t\t\t{\n\t\t\t\tn = n << 1;\n\t\t\t}\n\t\t\t\n\t\t\tp.get(i).setCanCode(Integer.toBinaryString(n));\n\t\t\tcodes[p.get(i).getData()] = Integer.toBinaryString(n);\n\t\t}\n\t}",
"public void loadInitQueue() {\n\t\t// go through every character\n\t\tfor (int i = 0; i < frequencyCount.length; i++) { \n\t\t\t// check to see if it has appeared at least once.\n\t\t\tif (frequencyCount[i] != 0) { \n\t\t\t\t// if so, make a tree for it and add it to the priority queue.\n\t\t\t\tCS232LinkedBinaryTree<Integer, Character> curTree = new CS232LinkedBinaryTree<Integer, Character>();\n\t\t\t\tcurTree.add(frequencyCount[i], (char) i);\n\t\t\t\thuffBuilder.add(curTree);\n\t\t\t}\n\t\t}\n\t}",
"private static <T extends Comparable<T>> void buildHeap(T[] table)\n {\n int n = 1;\n while (n < table.length)\n {\n n++;\n int child = n-1;\n int parent = (child - 1) / 2;\n while (parent >=0 && table[parent].compareTo(table[child]) < 0)\n {\n swap (table, parent, child);\n child = parent;\n parent = (child - 1) / 2;\n }//end while\n }//end while\n }",
"public HuffmanCompressor(){\n charList = new ArrayList<HuffmanNode>();\n }",
"public static void makeHeap(char[] heap, int size, CharComparator c) {\n/* 124 */ int i = size >>> 1;\n/* 125 */ while (i-- != 0)\n/* 126 */ downHeap(heap, size, i, c); \n/* */ }",
"public HuffmanCode(int[] frequencies) {\n Queue<HuffmanNode> nodeFrequencies = new PriorityQueue<HuffmanNode>();\n for (int i = 0; i < frequencies.length; i++) {\n if (frequencies[i] > 0) {\n nodeFrequencies.add(new HuffmanNode(frequencies[i], (char) i));\n }\n }\n nodeFrequencies = ArrayHuffmanCodeCreator(nodeFrequencies);\n this.front = nodeFrequencies.peek();\n }",
"public static void main(String[] args){\n huffmanCoder(args[0],args[1]);\n }",
"public void insertIntoHeap(HuffmanTreeNode node) {\n\n\t\tHuffmanTreeNode[] heap = this.getHuffmanHeap();\n\t\tHuffmanTreeNode[] newHeap = new HuffmanTreeNode[heap.length + 1];\n\t\t\n\t\tfor (int i = 0; i < heap.length; i++)\n\t\t{\n\t\t\tnewHeap[i] = heap[i];\n\t\t}\n\t\t\n\t\tnewHeap[heap.length] = node;\n\t\tnewHeap = heapSort(newHeap);\n\t\tthis.setHuffmanHeap(newHeap);\n\t}",
"public void buildHeap() {\n\t\tthis.makeComplete();\n\t\tfor(int i = this.size/2; i >= 1; i--)\n\t\t\tthis.heapify(i);\n\t}",
"public static Node buildHuffManTree(PriorityQueue<Node> queue) {\n\t\t\n\t\twhile(queue.size()>1) {\n\t\t\t\n\t\t\tNode left = queue.poll();\n\t\t\tNode right = queue.poll();\n\t\t\t\n\t\t\tNode root = new Node(left.frequency + right.frequency);\n\t\t\troot.left = left;\n\t\t\troot.right = right;\n\t\t\t\n\t\t\tqueue.add(root);\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn queue.poll();\n\t\t\n\t}",
"public static void main(String[] args) {\n\r\n\t\tint [][] arr = new int[][] {\r\n\t\t\t{8,9,10,12},\r\n\t\t\t{2,5,9,12},\r\n\t\t\t{3,6,10,11},\r\n\t\t\t{1,4,7,8}\r\n\t\t};\t\t\r\n\t\t\r\n\t\tPriorityQueue<HeapNode> heap = new PriorityQueue<>();\r\n\t\tfor(int i=0;i<arr.length;i++)\r\n\t\t{\r\n\t\t\theap.offer(new HeapNode(arr[i][0], i, 0));\r\n\t\t}\r\n\t\tint count=0;\r\n\t\twhile(count<16)\r\n\t\t{\r\n\t\t\tHeapNode min = heap.poll();\r\n\t\t\tSystem.out.println(min.value);\r\n\t\t\tcount++;\r\n\t\t\tint value=0;\r\n\t\t\tint nextIndex=min.index+1;\r\n\t\t\tif(nextIndex < arr[min.k].length)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tvalue=arr[min.k][nextIndex];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvalue=Integer.MAX_VALUE;\r\n\t\t\t}\r\n\t\t\theap.offer(new HeapNode(value, min.k, nextIndex));\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"private int[] genererCodeHamming(int[] tabCode) {\n\t\t\n\t\t\t\tint hamming[];\n\t\t\t\t\n\t\t\t\tint i=0;\n\t\t\t\tint nbParite=0; \n\t\t\t\tint j=0;\n\t\t\t\tint k=0;\n\t\t\t\t\n\t\t\t\twhile(i < tabCode.length) {\n\t\t\t\t\t\n\t\t\t\t\tif(Math.pow(2,nbParite) == i+nbParite + 1) {\n\t\t\t\t\t\tnbParite++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\thamming = new int[tabCode.length + nbParite];\n\t\t\t\t\n\t\t\t\tfor(i=1 ; i <= hamming.length ; i++) {\n\t\t\t\t\tif(Math.pow(2, j) == i) {\n\t\t\t\t\t\t\n\t\t\t\t\t\thamming[i-1] = 2;\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\thamming[k+j] = tabCode[k++];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(i=0 ; i < nbParite ; i++) {\n\t\t\t\t\t\n\t\t\t\t\thamming[((int) Math.pow(2, i))-1] = getParite(hamming, i);\n\t\t\t\t}\n\t\t\t\treturn hamming;\n\t}",
"public static String huffmanCoder(String inputFileName, String outputFileName){\n File inputFile = new File(inputFileName+\".txt\");\n File outputFile = new File(outputFileName+\".txt\");\n File encodedFile = new File(\"encodedTable.txt\");\n File savingFile = new File(\"Saving.txt\");\n HuffmanCompressor run = new HuffmanCompressor();\n \n run.buildHuffmanList(inputFile);\n run.makeTree();\n run.encodeTree();\n run.computeSaving(inputFile,outputFile);\n run.printEncodedTable(encodedFile);\n run.printSaving(savingFile);\n return \"Done!\";\n }",
"public static void main(String args[])\n {\n Scanner s = new Scanner(System.in).useDelimiter(\"\");\n List<node> freq = new SinglyLinkedList<node>();\n \n // read data from input\n while (s.hasNext())\n {\n // s.next() returns string; we're interested in first char\n char c = s.next().charAt(0);\n if (c == '\\n') continue;\n // look up character in frequency list\n node query = new node(c);\n node item = freq.remove(query);\n if (item == null)\n { // not found, add new node\n freq.addFirst(query);\n } else { // found, increment node\n item.frequency++;\n freq.addFirst(item);\n }\n }\n \n // insert each character into a Huffman tree\n OrderedList<huffmanTree> trees = new OrderedList<huffmanTree>();\n for (node n : freq)\n {\n trees.add(new huffmanTree(n));\n }\n \n // merge trees in pairs until one remains\n Iterator ti = trees.iterator();\n while (trees.size() > 1)\n {\n // construct a new iterator\n ti = trees.iterator();\n // grab two smallest values\n huffmanTree smallest = (huffmanTree)ti.next();\n huffmanTree small = (huffmanTree)ti.next();\n // remove them\n trees.remove(smallest);\n trees.remove(small);\n // add bigger tree containing both\n trees.add(new huffmanTree(smallest,small));\n }\n // print only tree in list\n ti = trees.iterator();\n Assert.condition(ti.hasNext(),\"Huffman tree exists.\");\n huffmanTree encoding = (huffmanTree)ti.next();\n encoding.print();\n }",
"public static HuffmanNode createTree(HuffmanNode[] nodeArr){\n HuffmanNode[] garbageArr = nodeArr;\n while(garbageArr.length != 1){\n HuffmanNode[] tempArr = new HuffmanNode[garbageArr.length-1];\n tempArr[0] = combineNodes(garbageArr[0], garbageArr[1]);\n for(int i = 1; i < garbageArr.length-1; i++){\n tempArr[i] = garbageArr[i+1];\n }\n garbageArr = freqSort(tempArr);\n }\n return garbageArr[0];\n }",
"public void printHeap() {\n \tSystem.out.println(\"Binomial heap Representation:\");\n \tNode x = this.head;\n if (x != null)\n x.print(0);\n }",
"public void makeHeap() {\r\n\t\t//for (int i = (theHeap.size() >> 1) - 1; i >= 0; i--) {\r\n\t\tfor (int i = (theHeap.size() - 1) >> 1; i >= 0; i--) {\r\n\t\t\tsiftDown(i);\r\n\t\t}\r\n\t}",
"public static void buildHeap(int[]data){\n for (int i = data.length-1; i>=0; i--){\n pushDown(data, data.length, i);\n }\n }",
"public Node buildTree(int[] frequency)\n {\n /* Initialize the priority queue */\n pq=new PriorityQueue<Node>(c.size(),comp); \n p=new PriorityQueue<Node>(c.size(),comp); \n /* Create leaf node for each unique character in the string */\n for(int i = 0; i < c.size(); i++)\n { \n pq.offer(new Node(c.get(i), frequency[i], null, null));\n } \n createCopy(pq); \n /* Until there is only one node in the priority queue */\n while(pq.size() > 1)\n { \n /* Minimum frequency is kept in the left */\n Node left = pq.poll();\n /* Next minimum frequency is kept in the right */\n Node right = pq.poll();\n /* Create a new internal node as the parent of left and right */\n pq.offer(new Node('\\0', left.frequency+right.frequency, left, right)); \n } \n /* Return the only node which is the root */\n return pq.poll();\n }",
"@Test\r\n public void testEncode() throws Exception {\r\n System.out.println(\"encode\");\r\n String message = \"furkan\";\r\n \r\n HuffmanTree Htree = new HuffmanTree();\r\n\r\n HuffmanTree.HuffData[] symbols = {\r\n new HuffmanTree.HuffData(186, '_'),\r\n new HuffmanTree.HuffData(103, 'e'),\r\n new HuffmanTree.HuffData(80, 't'),\r\n new HuffmanTree.HuffData(64, 'a'),\r\n new HuffmanTree.HuffData(63, 'o'),\r\n new HuffmanTree.HuffData(57, 'i'),\r\n new HuffmanTree.HuffData(57, 'n'),\r\n new HuffmanTree.HuffData(51, 's'),\r\n new HuffmanTree.HuffData(48, 'r'),\r\n new HuffmanTree.HuffData(47, 'h'),\r\n new HuffmanTree.HuffData(32, 'b'),\r\n new HuffmanTree.HuffData(32, 'l'),\r\n new HuffmanTree.HuffData(23, 'u'),\r\n new HuffmanTree.HuffData(22, 'c'),\r\n new HuffmanTree.HuffData(21, 'f'),\r\n new HuffmanTree.HuffData(20, 'm'),\r\n new HuffmanTree.HuffData(18, 'w'),\r\n new HuffmanTree.HuffData(16, 'y'),\r\n new HuffmanTree.HuffData(15, 'g'),\r\n new HuffmanTree.HuffData(15, 'p'),\r\n new HuffmanTree.HuffData(13, 'd'),\r\n new HuffmanTree.HuffData(8, 'v'),\r\n new HuffmanTree.HuffData(5, 'k'),\r\n new HuffmanTree.HuffData(1, 'j'),\r\n new HuffmanTree.HuffData(1, 'q'),\r\n new HuffmanTree.HuffData(1, 'x'),\r\n new HuffmanTree.HuffData(1, 'z')\r\n };\r\n\r\n Htree.buildTree(symbols);\r\n \r\n String expResult = \"1100110000100101100001110100111\";\r\n String result = Htree.encode(message, Htree.huffTree);\r\n \r\n assertEquals(expResult, result);\r\n \r\n }",
"public static void HuffmanTree(String input, String output) throws Exception {\n\t\tFileReader inputFile = new FileReader(input);\n\t\tArrayList<HuffmanNode> tree = new ArrayList<HuffmanNode>(200);\n\t\tchar current;\n\t\t\n\t\t// loops through the file and creates the nodes containing all present characters and frequencies\n\t\twhile((current = (char)(inputFile.read())) != (char)-1) {\n\t\t\tint search = 0;\n\t\t\tboolean found = false;\n\t\t\twhile(search < tree.size() && found != true) {\n\t\t\t\tif(tree.get(search).inChar == (char)current) {\n\t\t\t\t\ttree.get(search).frequency++; \n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t\tsearch++;\n\t\t\t}\n\t\t\tif(found == false) {\n\t\t\t\ttree.add(new HuffmanNode(current));\n\t\t\t}\n\t\t}\n\t\tinputFile.close();\n\t\t\n\t\t//creates the huffman tree\n\t\tcreateTree(tree);\n\t\t\n\t\t//the huffman tree\n\t\tHuffmanNode sortedTree = tree.get(0);\n\t\t\n\t\t//prints out the statistics of the input file and the space saved\n\t\tFileWriter newVersion = new FileWriter(\"C:\\\\Users\\\\Chris\\\\workspace\\\\P2\\\\src\\\\P2_cxt240_Tsuei_statistics.txt\");\n\t\tprintTree(sortedTree, \"\", newVersion);\n\t\tspaceSaver(newVersion);\n\t\tnewVersion.close();\n\t\t\n\t\t// codes the file using huffman encoding\n\t\tFileWriter outputFile = new FileWriter(output);\n\t\ttranslate(input, outputFile);\n\t}",
"public static Node make_huffmann_tree(List li){\n //Sorting list in increasing order of its letter frequency \n li.sort(new comp());\n Node temp=null;\n Iterator it=li.iterator();\n //System.out.println(li.size());\n //Loop for making huffman tree till only single node remains in list\n while(true){\n temp=new Node();\n //a and b are Node which are to be combine to make its parent\n Node a=new Node(),b=new Node();\n a=null;b=null;\n //checking if list is eligible for combining or not\n //here first assignment of it.next in a will always be true as list till end will\n //must have atleast one node\n a=(Node)it.next();\n //Below condition is to check either list has 2nd node or not to combine \n //If this condition will be false, then it means construction of huffman tree is completed\n if(it.hasNext()){b=(Node)it.next();}\n //Combining first two smallest nodes in list to make its parent whose frequncy \n //will be equals to sum of frequency of these two nodes \n if(b!=null){\n temp.freq=a.freq+b.freq;a.data=0;b.data=1;//assigining 0 and 1 to left and right nodes\n temp.left=a;temp.right=b;\n //after combing, removing first two nodes in list which are already combined\n li.remove(0);//removes first element which is now combined -step1\n li.remove(0);//removes 2nd element which comes on 1st position after deleting first in step1\n li.add(temp);//adding new combined node to list\n //print_list(li); //For visualizing each combination step\n }\n //Sorting after combining to again repeat above on sorted frequency list\n li.sort(new comp()); \n it=li.iterator();//resetting list pointer to first node (head/root of tree)\n if(li.size()==1){return (Node)it.next();} //base condition ,returning root of huffman tree \n }\n}",
"private void heapify(int left, int right) {\r\n\t\tint k = 2 * left;\r\n\r\n\t\tif (k > right)\r\n\t\t\treturn;\r\n\r\n\t\tif ((k + 1) > right) {\r\n\t\t\tif (c[k - 1].compareTo(c[left - 1]) > 0)\r\n\t\t\t\tswitchElements(left - 1, k - 1);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (c[k - 1].compareTo(c[k]) < 0)\r\n\t\t\tk++;\r\n\r\n\t\tif (c[left - 1].compareTo(c[k - 1]) < 0) {\r\n\t\t\tswitchElements(left - 1, k - 1);\r\n\t\t\theapify(k, right);\r\n\t\t}\r\n\t}",
"public static void main(String[] args)\n {\n\t\t\tHuffman tree= new Huffman();\n \t \t Scanner sc=new Scanner(System.in);\n\t\t\tnoOfFrequencies=sc.nextInt();\n\t\t\t// It adds all the user input values in the tree.\n\t\t\tfor(int i=1;i<=noOfFrequencies;i++)\n\t\t\t{\n\t\t\t\tString temp=sc.next();\n\t\t\t\ttree.add(temp,sc.next());\n\t\t\t}\n\t\tint lengthToDecode=sc.nextInt();\n\t\tString encodedValue=sc.next();\n\t\t// This statement decodes the encoded values.\n\t\ttree.getDecodedMessage(encodedValue);\n\t\tSystem.out.println();\n\t\t}",
"public CodeBook getOptimalCodificacion(){\n ArrayList<ArbolCod> listaA=new ArrayList<ArbolCod>();\n \n // Se inicializan los árboles con las probabilidades.\n for (int i=0;i<probabilidades.size();i++)\n listaA.add(new ArbolCod(alfabeto.getI(i),probabilidades.get(i)));\n \n return codHuffman(listaA);\n }",
"public boolean[] binaryRep() {\r\n\t\tint length = -1;\r\n\t\tfor (int i = 0; i < this.HeapTreesArray.length; i++) {\r\n\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\tlength = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\tboolean[] arr = new boolean[length + 1];\r\n\t\tfor (int i = 0; i < arr.length; i++) {\r\n\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\tarr[i] = true;\r\n\t\t\t} else {\r\n\t\t\t\tarr[i] = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn arr;\r\n\t}",
"private void buildOutput()\n\t{\n\t\tif(outIndex >= output.length)\n\t\t{\n\t\t\tbyte[] temp = output;\n\t\t\toutput = new byte[temp.length * 2];\n\t\t\tSystem.arraycopy(temp, 0, output, 0, temp.length);\n\t\t}\n\t\t\n\t\tif(sb.length() < 16 && aryIndex < fileArray.length)\n\t\t{\n\t\t\tbyte[] b = new byte[1];\n\t\t\tb[0] = fileArray[aryIndex++];\n\t\t\tsb.append(toBinary(b));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < prioQ.size(); i++)\n\t\t{\n\t\t\tif(sb.toString().startsWith(prioQ.get(i).getCode()))\n\t\t\t{\n\t\t\t\toutput[outIndex++] = (byte)prioQ.get(i).getByteData();\n\t\t\t\tsb = new StringBuilder(\n\t\t\t\t\t\tsb.substring(prioQ.get(i).getCode().length()));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Can't find Huffman code.\");\n\t\tSystem.exit(1);\n\t\texit = true;\n\t}",
"public static HuffmanNode huffmanAlgo() {\r\n\t\tHuffmanNode root;\r\n\t\t\r\n\t\twhile(nodeArrList.size() > 1) {\r\n\t\t\tif(nodeArrList.get(0).frequency == 0) {\r\n\t\t\t\tnodeArrList.remove(0);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tHuffmanNode left = nodeArrList.remove(0);\r\n\t\t\t\tHuffmanNode right = nodeArrList.remove(0);\r\n\t\t\t\tHuffmanNode replacement = new HuffmanNode(null, left.frequency + right.frequency);\r\n\t\t\t\treplacement.left = left;\r\n\t\t\t\treplacement.right = right;\r\n\t\t\t\tnodeArrList.add(replacement);\r\n\t\t\t}\r\n\t\t}\r\n\t\troot = nodeArrList.get(0);\r\n\t\treturn root;\r\n\t}",
"@Override\r\n public void run() {\n File huffmanFolder = newDirectoryEncodedFiles(file, encodedFilesDirectoryName);\r\n File huffmanTextFile = new File(huffmanFolder.getPath() + \"\\\\text.huff\");\r\n File huffmanTreeFile = new File(huffmanFolder.getPath() + \"\\\\tree.huff\");\r\n\r\n\r\n try (FileOutputStream textCodeOS = new FileOutputStream(huffmanTextFile);\r\n FileOutputStream treeCodeOS = new FileOutputStream(huffmanTreeFile)) {\r\n\r\n\r\n// Writing text bits to file text.huff\r\n StringBuilder byteStr;\r\n while (boolQueue.size() > 0 | !boolRead) {\r\n while (boolQueue.size() > 8) {\r\n byteStr = new StringBuilder();\r\n\r\n for (int i = 0; i < 8; i++) {\r\n String s = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(s);\r\n }\r\n\r\n if (isInterrupted())\r\n break;\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n\r\n if (fileRead && boolQueue.size() > 0) {\r\n lastBitsCount = boolQueue.size();\r\n byteStr = new StringBuilder();\r\n for (int i = 0; i < lastBitsCount; i++) {\r\n String bitStr = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(bitStr);\r\n }\r\n\r\n for (int i = 0; i < 8 - lastBitsCount; i++) {\r\n byteStr.append(\"0\");\r\n }\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n }\r\n\r\n\r\n// Writing the info for decoding to tree.huff\r\n// Writing last bits count to tree.huff\r\n treeCodeOS.write((byte)lastBitsCount);\r\n\r\n// Writing info for Huffman tree to tree.huff\r\n StringBuilder treeBitsArray = new StringBuilder();\r\n treeBitsArray.append(\r\n parser.parseByteToBinaryString(\r\n (byte) codesMap.size()));\r\n\r\n codesMap.keySet().forEach(key -> {\r\n String keyBits = parser.parseByteToBinaryString((byte) (char) key);\r\n String valCountBits = parser.parseByteToBinaryString((byte) codesMap.get(key).length());\r\n\r\n treeBitsArray.append(keyBits);\r\n treeBitsArray.append(valCountBits);\r\n treeBitsArray.append(codesMap.get(key));\r\n });\r\n if ((treeBitsArray.length() / 8) != 0) {\r\n int lastBitsCount = boolQueue.size() / 8;\r\n for (int i = 0; i < 7 - lastBitsCount; i++) {\r\n treeBitsArray.append(\"0\");\r\n }\r\n }\r\n\r\n for (int i = 0; i < treeBitsArray.length() / 8; i++) {\r\n treeCodeOS.write(parser.parseStringToByte(\r\n treeBitsArray.substring(8 * i, 8 * (i + 1))));\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public Node createHuffmanTree(File f) throws FileNotFoundException {\r\n File file = f;\r\n FileInputStream fi = new FileInputStream(file);\r\n List<Node> nodes = new LinkedList<>();\r\n\r\n// Creating a map, where the key is characters and the values are the number of characters in the file\r\n Map<Character, Integer> charsMap = new LinkedHashMap<>();\r\n try (Reader reader = new InputStreamReader(fi);) {\r\n int r;\r\n while ((r = reader.read()) != -1) {\r\n char nextChar = (char) r;\r\n\r\n if (charsMap.containsKey(nextChar))\r\n charsMap.compute(nextChar, (k, v) -> v + 1);\r\n else\r\n charsMap.put(nextChar, 1);\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n//// Sort the map by value and create a list\r\n// charsMap = charsMap.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));\r\n\r\n// Creating a list of Nodes from a map\r\n for (Character ch : charsMap.keySet()) {\r\n nodes.add(new Node(ch, charsMap.get(ch), null, null));\r\n }\r\n\r\n// Creating a Huffman tree\r\n while (nodes.size() > 1) {\r\n Node firstMin = nodes.stream().min(Comparator.comparingInt(n -> n.count)).get();\r\n nodes.remove(firstMin);\r\n Node secondMin = nodes.stream().min(Comparator.comparingInt(n -> n.count)).get();\r\n nodes.remove(secondMin);\r\n\r\n Node newNode = new Node(null, firstMin.count + secondMin.count, firstMin, secondMin);\r\n newNode.left.count = null;\r\n newNode.right.count = null;\r\n nodes.add(newNode);\r\n nodes.remove(firstMin);\r\n nodes.remove(secondMin);\r\n }\r\n\r\n// Why first? See algorithm!\r\n nodes.get(0).count = null;\r\n return nodes.get(0);\r\n }",
"private static Node binomialHeapMerge(BinomialHeap h1, BinomialHeap h2) {\n\t\t\n\t\t// checking for null values\n\t\tif(h1.head == null)\n\t\t\treturn h2.head;\n\t\tif(h2.head == null)\n\t\t\treturn h1.head;\n\t\t\n\t\t// initialize pointers\n\t\t// initialize the first pointer based on smallest node in both heaps\n\t\tNode first = null;\n\t\tNode curr = null;\n\t\tNode currh1 = h1.head;\n\t\tNode currh2 = h2.head;\n\t\tif (currh1.degree < currh2.degree) { \n first = currh1;\n currh1 = currh1.rightSibling;\n }\n else {\n \tfirst = currh2;\n currh2 = currh2.rightSibling;\n }\n\t\t\n\t\t// loop over remaining values by attaching the smallest degree element\n\t\t// one at a time until one of the pointers becomes null\n\t\tcurr = first;\n\t\twhile (currh1!=null && currh2!=null) {\n\t if (currh1.degree < currh2.degree) { \n\t curr.rightSibling = currh1;\n\t currh1 = currh1.rightSibling;\n\t }\n\t else {\n\t curr.rightSibling = currh2;\n\t currh2 = currh2.rightSibling;\n\t }\n\t \n\t curr = curr.rightSibling;\n\t }\n\t \n\t\t// attach the remaining of the other list to current list's right\n\t if (currh1!=null)\n\t curr.rightSibling = currh1;\n\t else\n\t curr.rightSibling = currh2;\n\n\t //return the head of newly formed list of heaps\n\t return first;\n\t}",
"private int Huffmancodebits( int [] ix, EChannel gi ) {\n\t\tint region1Start;\n\t\tint region2Start;\n\t\tint count1End;\n\t\tint bits, stuffingBits;\n\t\tint bvbits, c1bits, tablezeros, r0, r1, r2;//, rt, pr;\n\t\tint bitsWritten = 0;\n\t\tint idx = 0;\n\t\ttablezeros = 0;\n\t\tr0 = r1 = r2 = 0;\n\n\t\tint bigv = gi.big_values * 2;\n\t\tint count1 = gi.count1 * 4;\n\n\n\t\t/* 1: Write the bigvalues */\n\n\t\tif ( bigv!= 0 ) {\n\t\t\tif ( (gi.mixed_block_flag) == 0 && gi.window_switching_flag != 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t// if ( (gi.mixed_block_flag) == 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t/*\n Within each scalefactor band, data is given for successive\n time windows, beginning with window 0 and ending with window 2.\n Within each window, the quantized values are then arranged in\n order of increasing frequency...\n\t\t\t\t */\n\n\t\t\t\tint sfb, window, line, start, end;\n\n\t\t\t\t//int [] scalefac = scalefac_band_short; //da modificare nel caso si convertano mp3 con fs diversi\n\n\t\t\t\tregion1Start = 12;\n\t\t\t\tregion2Start = 576;\n\n\t\t\t\tfor ( sfb = 0; sfb < 13; sfb++ ) {\n\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\tstart = scalefac_band_short[ sfb ];\n\t\t\t\t\tend = scalefac_band_short[ sfb+1 ];\n\n\t\t\t\t\tif ( start < region1Start )\n\t\t\t\t\t\ttableindex = gi.table_select[ 0 ];\n\t\t\t\t\telse\n\t\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tif ( gi.mixed_block_flag!= 0 && gi.block_type == 2 ) { /* Mixed blocks long, short */\n\t\t\t\t\tint sfb, window, line, start, end;\n\t\t\t\t\tint tableindex;\n\t\t\t\t\t//scalefac_band_long;\n\n\t\t\t\t\t/* Write the long block region */\n\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\tif ( tableindex != 0 )\n\t\t\t\t\t\tfor (int i = 0; i < 36; i += 2 ) {\n\t\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\t\t\t\t\t/* Write the short block region */\n\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( sfb = 3; sfb < 13; sfb++ ) {\n\t\t\t\t\t\tstart = scalefac_band_long[ sfb ];\n\t\t\t\t\t\tend = scalefac_band_long[ sfb+1 ];\n\n\t\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\t\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else { /* Long blocks */\n\t\t\t\t\tint scalefac_index = 100;\n\n\t\t\t\t\tif ( gi.mixed_block_flag != 0 ) {\n\t\t\t\t\t\tregion1Start = 36;\n\t\t\t\t\t\tregion2Start = 576;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscalefac_index = gi.region0_count + 1;\n\t\t\t\t\t\tregion1Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t\tscalefac_index += gi.region1_count + 1;\n\t\t\t\t\t\tregion2Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < bigv; i += 2 ) {\n\t\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\t\tif ( i < region1Start ) {\n\t\t\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tif ( i < region2Start ) {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[1];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[2];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* get huffman code */\n\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\tif ( tableindex!= 0 ) {\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttablezeros += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t}\n\t\tbvbits = bitsWritten;\n\n\t\t/* 2: Write count1 area */\n\t\tint tableindex = gi.count1table_select + 32;\n\n\t\tcount1End = bigv + count1;\n\t\tfor (int i = bigv; i < count1End; i += 4 ) {\n\t\t\tv = ix[i];\n\t\t\tw = ix[i+1];\n\t\t\tx = ix[i+2];\n\t\t\ty = ix[i+3];\n\t\t\tbitsWritten += huffman_coder_count1(tableindex);\n\t\t}\n\n\t\t// c1bits = bitsWritten - bvbits;\n\t\t// if ( (stuffingBits = gi.part2_3_length - gi.part2_length - bitsWritten) != 0 ) {\n\t\t// int stuffingWords = stuffingBits / 32;\n\t\t// int remainingBits = stuffingBits % 32;\n\t\t//\n\t\t// /*\n\t\t// Due to the nature of the Huffman code\n\t\t// tables, we will pad with ones\n\t\t// */\n\t\t// while ( stuffingWords-- != 0){\n\t\t// mn.add_entry( -1, 32 );\n\t\t// }\n\t\t// if ( remainingBits!=0 )\n\t\t// mn.add_entry( -1, remainingBits );\n\t\t// bitsWritten += stuffingBits;\n\t\t//\n\t\t// }\n\t\treturn bitsWritten;\n\t}",
"private Vector<Node> sortCodes()\n\t{\n\t\tVector<Node> nodes = new Vector<Node>();\n\t\tfor(int i = 0; i < prioQ.size(); i++)\n\t\t{\n\t\t\tNode n = new Node(prioQ.get(i).getData(),\n\t\t\t\t\tprioQ.get(i).getCount());\n\t\t\tnodes.add(n);\n\t\t}\n\t\n\t\tCollections.sort(nodes, new Comparator() {\n\t public int compare(Object o1, Object o2) {\n\t Integer x1 = ((Node) o1).getCount();\n\t Integer x2 = ((Node) o2).getCount();\n\t int sComp = x1.compareTo(x2);\n\n\t if (sComp != 0) {\n\t return sComp;\n\t } else {\n\t Integer a1 = ((Node) o1).getData();\n\t Integer a2 = ((Node) o2).getData();\n\t return a1.compareTo(a2);\n\t }\n\t }\n\t });\n\t\t\n\t\treturn nodes;\n\t}",
"private int percolateUpLeaf(){\n\t\treturn percolateUp(heap.size()-1);// TODO: A one-line function that calls percolateUp()\n\t}",
"public static void sort(Comparable[] pq) {\n int n = pq.length;\n \n /*\n * Fill in this method! Use the code on p. 324 of the book as a model,\n * but change it so each node in the heap has 3 children instead of 2.\n */\n }",
"void decode(){\n int bit = -1; // next bit from compressed file: 0 or 1. no more bit: -1\r\n int k = 0; // index to the Huffman tree array; k = 0 is the root of tree\r\n int n = 0; // number of symbols decoded, stop the while loop when n == filesize\r\n int numBits = 0; // number of bits in the compressed file\r\n FileOutputStream file = null;\r\n try {\r\n file = new FileOutputStream(\"uncompressed.txt\");\r\n } catch (FileNotFoundException ex) {\r\n System.err.println(\"Could not open file to write to.\");\r\n }\r\n while ((bit = inputBit()) >= 0){\r\n k = codetree[k][bit];\r\n numBits++;\r\n if (codetree[k][0] == 0){ // leaf\r\n try {\r\n file.write(codetree[k][1]);\r\n } catch (IOException ex) {\r\n System.err.println(\"Failed to write to file.\");\r\n }\r\n System.out.write(codetree[k][1]);\r\n if (n++ == filesize) break; // ignore any additional bits\r\n k = 0;\r\n }\r\n }\r\n System.out.printf(\"\\n\\n------------------------------\\n\" +\r\n \"%d bytes in uncompressed file.\\n\", filesize);\r\n System.out.printf(\"%d bytes in compressed file.\\n\", numBits / 8);\r\n System.out.printf(\"Compression ratio of %f.\", (double)numBits / (double)filesize);\r\n System.out.flush();\r\n }",
"MinHeapNode newNode(char data, int freq)\r\n\t{\r\n\t MinHeapNode temp = new MinHeapNode();\r\n\t temp.left = temp.right = null;\r\n\t temp.data = data;\r\n\t temp.freq = freq;\r\n\t return temp;\r\n\t}",
"VectorArray getPhsCHar();",
"public HuffmanCode(Scanner input) {\n this.front = new HuffmanNode();\n while (input.hasNextLine()) {\n int character = Integer.parseInt(input.nextLine());\n String location = input.nextLine();\n ScannerHuffmanCodeCreator(this.front, location, (char) character);\n }\n }",
"public LinkedList<BST> readHeader() {\n\t\tLinkedList<BST> leaves = new LinkedList<>();\n\t\n\t\tint codesProcessed;\t\t//Number of look-up items added to tree\n\n\t\t/*\n\t\t * Basic check: does header start with SOH byte?\n\t\t */\n\t\tgrabBits(8);\n\t\tif (!proc.equals(\"00000001\")) {\n\t\t\tSystem.out.println(\"File is corrupted or not compressed\");\n\t\t\treturn null;\n\t\t}\n\t\tSystem.out.println(proc);\n\t\tclear();\n\n\t\t/*\n\t\t * Determine number of codes to process.\n\t\t * Offset by +2 to allow for 257 unique codes.\n\t\t */\n\t\tgrabBits(8);\n\t\tint numCodes = Integer.parseInt(proc, 2) + 2;\n\t\tSystem.out.println(proc);\n\t\tclear();\n\n\t\t/*\n\t\t * Process look-up codes, reading NULL byte first\n\t\t */\n\t\tfor (int i = 0; i < numCodes; i++) {\n\t\t\t/* Get bitstring character code */\n\t\t\tif (i == 0) {\n\t\t\t\tgrabBits(4);\t//Null byte\n\t\t\t} else {\n\t\t\t\tgrabBits(8);\t//Regular byte\n\t\t\t}\n\t\t\tString bitstring = proc;\n\t\t\tSystem.out.print(bitstring + \"\\t\");\n\t\t\tclear();\n\n\t\t\t/* Get Huffman code length */\n\t\t\tgrabBits(8);\n\t\t\tint length = Integer.parseInt(proc, 2);\n\t\t\tSystem.out.print(length + \"\\t\");\n\t\t\tclear();\n\n\t\t\t/* Get Huffman code */\n\t\t\tgrabBits(length);\n\t\t\tString code = proc;\n\t\t\tSystem.out.println(code);\n\t\t\tclear();\n\n\t\t\t/* Build BST leaf for letter */\n\t\t\tBST leaf = new BST();\n\t\t\tBits symbol = new Bits(bitstring);\n\t\t\tsymbol.setCode(code);\n\t\t\tleaf.update(symbol);\n\t\t\tleaves.add(leaf);\n\t\t}\n\n\t\t/*\n\t\t * Does header end with STX byte?\n\t\t */\n\t\tgrabBits(8);\n\t\tif (!proc.equals(\"00000010\")) {\n\t\t\tSystem.out.println(\"Header corrupt: end of header without STX\");\n\t\t\treturn null;\n\t\t}\n\t\tclear();\n\n\t\treturn leaves;\n\t}",
"public void arrayToHeap(int[] array) {\r\n\t\tHeapTreesArray = new HeapNode[32];\r\n\t\tthis.min = null;\r\n\t\tthis.size = 0;\r\n\t\tthis.empty = true;\r\n\t\tfor (int i : array) {\r\n\t\t\tinsert(i);\r\n\t\t}\r\n\t}",
"public int arrayToHeap(DHeap_Item[] array1) \n {\n \tthis.size= array1.length;\n \tthis.array=array1.clone();\n \tint compCnt=0;\n \tfor (int i=parent(this.getSize()-1, this.d); i>=0; i--) {\n \t\tcompCnt+=heapifyDown(this ,i);\n \t}\n return compCnt;\n }",
"public static void heapify() {\n //배열을 heap 자료형으로 만든다.\n // 1d 2d 2d 3d 3d 3d 3d 4d\n// int[] numbers = {9, 12, 1, 3, 6, 2, 8, 4};\n // 1depth의 자식노드 numbers[2i], numbers[2i+1]\n int[] numbers = {4, 1, 3, 2, 16, 9, 10, 14, 8, 7};\n int i = 1;\n while (true) {\n int target = numbers[i-1];\n int left = numbers[2*i-1];\n\n if (2*i == numbers.length) {\n if (left > target){\n numbers[i-1] = left;\n numbers[2*i-1] = target;\n }\n print(numbers);\n break;\n }\n int right =numbers[2*i];\n\n if (left > right) {\n if(left > target) {\n numbers[i-1] = left;\n numbers[2*i-1] = target;\n }\n }else if (right > left) {\n if (right > target) {\n numbers[i-1] = right;\n numbers[2*i] = target;\n }\n }\n i++;\n\n print(numbers);\n }\n\n }",
"public void buildHeap(int[] arr) {\n int size = arr.length;\n\n for (int i = getParentIndex(size); i >= 0; i--) {\n minHeapify(i);\n }\n }",
"public BinaryHeap() {\n }",
"public int preprocessCompress(InputStream in) throws IOException {\n try {\n // Count the characters\n int counted = CharCounter.countAll(in); \n int[] countedArray = CharCounter.countValues();\n // Build the huffman tree\n TreeBuilder countedTree = new TreeBuilder();\n countedTree.buildTree(countedArray);\n // Create the huffman character codes\n HuffEncoder.huffEncode(countedTree.getRoot());\n return counted;\n } catch (IOException e) {\n throw e;\n }\n }",
"public static int upHeap(char[] heap, int size, int i, CharComparator c) {\n/* 90 */ assert i < size;\n/* 91 */ char e = heap[i];\n/* 92 */ if (c == null) {\n/* 93 */ while (i != 0) {\n/* 94 */ int parent = i - 1 >>> 1;\n/* 95 */ char t = heap[parent];\n/* 96 */ if (t <= e)\n/* */ break; \n/* 98 */ heap[i] = t;\n/* 99 */ i = parent;\n/* */ } \n/* */ } else {\n/* 102 */ while (i != 0) {\n/* 103 */ int parent = i - 1 >>> 1;\n/* 104 */ char t = heap[parent];\n/* 105 */ if (c.compare(t, e) <= 0)\n/* */ break; \n/* 107 */ heap[i] = t;\n/* 108 */ i = parent;\n/* */ } \n/* 110 */ } heap[i] = e;\n/* 111 */ return i;\n/* */ }",
"public static void main(String[] args) {\n int[] freqNums = scanFile(args[0]);\n HuffmanNode[] nodeArr = createNodes(freqNums);\n nodeArr = freqSort(nodeArr);\n HuffmanNode top = createTree(nodeArr);\n String empty = \"\";\n String[] encodings = new String[94];\n encodings = getCodes(top, empty, false, encodings, true);\n printEncoding(encodings, freqNums);\n writeFile(args[0], args[1], encodings);\n }",
"private void heapSort() {\n\n\t\tint queueSize = priorityQueue.size();\n\n\t\tfor (int j = 0; j < queueSize; j++) {\n\n\t\t\theapified[j] = binaryHeap.top(priorityQueue);\n\t\t\tbinaryHeap.outHeap(priorityQueue);\n\n\t\t}\n\n\t}",
"@Before\n public void setUpBinaryMinHeaps() {\n empty = new BinaryMinHeap<>();\n emptyArr = new ArrayList<>();\n \n multipleElements = new BinaryMinHeap<>();\n multipleElements.insert(7);\n multipleElements.insert(8);\n multipleElements.insert(5);\n multipleElements.insert(3);\n multipleElements.insert(2);\n multipleElements.insert(6);\n \n multiArr = new ArrayList<>();\n multiArr.add(2);\n multiArr.add(3);\n multiArr.add(6);\n multiArr.add(8);\n multiArr.add(5);\n multiArr.add(7);\n \n }",
"public HuffmanNode(int freq, int ascii){\r\n this.freq = freq;\r\n this.ascii = ascii;\r\n }",
"public void buildHuffmanList(File inputFile){\n try{\n Scanner sc = new Scanner(inputFile);\n while(sc.hasNextLine()){\n\n String line = sc.nextLine();\n for(int i =0;i<line.length();i++){\n \n if(freqTable.isEmpty())\n freqTable.put(line.charAt(i),1);\n else{\n if(freqTable.containsKey(line.charAt(i)) == false)\n freqTable.put(line.charAt(i),1);\n else{\n int oldValue = freqTable.get(line.charAt(i));\n freqTable.replace(line.charAt(i),oldValue+1);\n }\n }\n }\n }\n }\n catch(FileNotFoundException e){\n System.out.println(\"Can't find the file\");\n }\n }",
"private void fixHeap(){\r\n int i = 1;\r\n int v = array[i].value.getYear();\r\n while(hasChildren(i)){\r\n Node left = array[getLeftChildIndex(i)];\r\n Node right = array[getRightChildIndex(i)];\r\n if(left != null){\r\n if(right != null){\r\n if(left.value.getYear() < right.value.getYear()){\r\n if(v > left.value.getYear()){\r\n swap(array[i], left);\r\n i = getLeftChildIndex(i);\r\n continue;\r\n }\r\n else{\r\n break;\r\n }\r\n }\r\n else{\r\n if(v > right.value.getYear()){\r\n swap(array[i], right);\r\n i = getRightChildIndex(i);\r\n continue;\r\n }\r\n else{\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n if(v > left.value.getYear()){\r\n swap(array[i], left);\r\n i = getLeftChildIndex(i);\r\n continue;\r\n }\r\n else{\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n break;\r\n }\r\n }\r\n\r\n }",
"public void encodeData() {\n frequencyTable = new FrequencyTableBuilder(inputPath).buildFrequencyTable();\n huffmanTree = new Tree(new HuffmanTreeBuilder(new FrequencyTableBuilder(inputPath).buildFrequencyTable()).buildTree());\n codeTable = new CodeTableBuilder(huffmanTree).buildCodeTable();\n encodeMessage();\n print();\n }",
"public static Object PQupheap(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"5hhoge8azwixhuw1r6f1ae6d\"); // PQupheap(int k)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"7e1sq1127wt16hr7o0andcwob\"); // snode* x = pq[k];\nUNSUPPORTED(\"7bfu0p9xmzkty10xv4n4l5cqs\"); // int v = x->n_val;\nUNSUPPORTED(\"1j1bbq23z0qzohezignztjo66\"); // int next = k/2;\nUNSUPPORTED(\"ae5pat4mp4l6k25pvk8saz8c7\"); // snode* n;\nUNSUPPORTED(\"70492o1szwz9au93c3is2goa\"); // while ((n = pq[next])->n_val < v) {\nUNSUPPORTED(\"4i53ezzk69bsmpugd2h8bo35\"); // pq[k] = n;\nUNSUPPORTED(\"iolnc8pg22pbme3zbdim1eqy\"); // (n)->n_idx = k;\nUNSUPPORTED(\"8fpdpgwovt0k58t5u167v63is\"); // k = next;\nUNSUPPORTED(\"eqtnhenyor3dwsa6on9crthdd\"); // next /= 2;\nUNSUPPORTED(\"7ijd6pszsxnoopppf6xwo8wdl\"); // }\nUNSUPPORTED(\"1lxwoekai0i8v3rg0vrg6ahmx\"); // pq[k] = x;\nUNSUPPORTED(\"7ss0wudteh17yswf0ihopig7z\"); // (x)->n_idx = k;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}",
"public static void createTree(ArrayList<HuffmanNode> tree) {\n\t\n\t\t//loops through until the tree.\n\t\twhile(tree.size() > 1) {\n\t\t\tCollections.sort(tree);\n\t\t\tHuffmanNode left = tree.get(0);\n\t\t\tHuffmanNode right = tree.get(1);\n\t\t\t\n\t\t\t/*creates the new node and adds it to the arrayList, and removes the two lowest frequency nodes\n\t\t\t * then recursively calls the create method again\n\t\t\t */\n\t\t\ttree.add(new HuffmanNode((right.frequency + left.frequency), left, right));\n\t\t\ttree.remove(0);\n\t\t\ttree.remove(0);\n\t\t\tcreateTree(tree);\n\t\t}\n\t}",
"public ArrayHeapMinPQ() {\n heapArray = new ArrayList<>();\n itemMap = new HashMap<>();\n heapArray.add(null); //alway set index 0 null and heap starts from index 1.\n nextIndex = 1;\n }",
"public static void main(String[] args) {\n\t\tHuffmanCodes MyHuffmanCodes = new HuffmanCodes();\n\t\tMyHuffmanCodes.run();\n\t}",
"private BinaryTree<Character> constructTree(){\n if(pq.size() == 1) return pq.poll().data;\n if(pq.size() == 0) return null;\n // Poll the lowest two trees, combine them, then stick them back in the queue.\n Helper<BinaryTree<Character>> temp0 = pq.poll(), temp1 = pq.poll(),\n result = new Helper<>(temp0.priority + temp1.priority, new BinaryTree<>(temp0.data, null , temp1.data));\n pq.add(result);\n // Call again to keep constructing.\n return constructTree();\n }",
"private void setMinHeap() {\n // parentIndex is the last leaf node parentIndex\n int parentIndex = (array.length - 2) / 2;\n // from last parentIndex down on the depth path to the root\n // convert to minHeap\n while (parentIndex >= 0) { // when parentIndex = 0, the root\n minHeapify(parentIndex, array.length);\n // go to next index(parentIndex) on that level\n parentIndex--;\n }\n }",
"public static Object PQdownheap(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"5jo6sukhc9upf5qv4eukh8kop\"); // PQdownheap (int k)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"dd3235mkocimg2v70ln8ixz3k\"); // snode* x = pq[k];\nUNSUPPORTED(\"e0wd4mp2k58ml2bf01e6mtxfc\"); // int v = (x)->n_val;\nUNSUPPORTED(\"b9pl90rstqz0jhnw3ttda3kx5\"); // int lim = PQcnt/2;\nUNSUPPORTED(\"917ffzmzxsh6kw3txaqow8dv0\"); // snode* n;\nUNSUPPORTED(\"zrgst5t0lhf2kxrym9g7gvsn\"); // int j;\nUNSUPPORTED(\"7bbx1rekibyh3hyxh24lprwwk\"); // while (k <= lim) {\nUNSUPPORTED(\"disb3eax2r4wgge9im541y9hv\"); // j = k+k;\nUNSUPPORTED(\"e4w7jx4o3i4gav8ujef2bapbn\"); // n = pq[j];\nUNSUPPORTED(\"4yles8zr6ozg2g0df2jefc1l2\"); // if (j < PQcnt) {\nUNSUPPORTED(\"77cupwd0hd3zp8he6wd4tm6nx\"); // if ((n)->n_val < (pq[j+1])->n_val) {\nUNSUPPORTED(\"1jeqo15tfc6vbefwf85bniwfn\"); // j++;\nUNSUPPORTED(\"1sglut5nbxcoto9tvzxs3eixh\"); // n = pq[j];\nUNSUPPORTED(\"dquo3qofk56ds5xl95lhvcthf\"); // }\nUNSUPPORTED(\"dvgyxsnyeqqnyzq696k3vskib\"); // }\nUNSUPPORTED(\"3hshbuqs95898wh95e2fdh5uz\"); // if (v >= (n)->n_val) break;\nUNSUPPORTED(\"4i53ezzk69bsmpugd2h8bo35\"); // pq[k] = n;\nUNSUPPORTED(\"iolnc8pg22pbme3zbdim1eqy\"); // (n)->n_idx = k;\nUNSUPPORTED(\"8lpwfkimmel90007dlp5eqpbh\"); // k = j;\nUNSUPPORTED(\"7ijd6pszsxnoopppf6xwo8wdl\"); // }\nUNSUPPORTED(\"1lxwoekai0i8v3rg0vrg6ahmx\"); // pq[k] = x;\nUNSUPPORTED(\"7ss0wudteh17yswf0ihopig7z\"); // (x)->n_idx = k;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}",
"public HuffmanTree(HuffmanPair element) {\r\n\t\tsuper(element);\r\n\t}",
"public Heap(int capacity) {\n\t\t this.capacity = capacity;\n\t\t data = new Integer[this.capacity];\t\n\t\t size = 0;\n\t }",
"private void createHammed()\n\t{\n\t\tint j=0;\n\t\tboolean skip = false;\n\t\t\n\t\t\n\t\tfor (int i=0;i<binaryCode.length; i++)\n\t\t{\t\n\t\t\t//checks to see if the bit is a parity bit\n\t\t\tfor (int k=0; k<PARITY.length;k++)\n\t\t\t{\n\t\t\t\t//if it is a parity bit, it skips\n\t\t\t\tif (i==PARITY[k])\n\t\t\t\t{\n\t\t\t\t\tskip=true;\n\t\t\t\t} \n\n\t\t\t}\n\t\t\t\n\t\t\tif (skip)\n\t\t\t{\n\t\t\t\tskip=false;\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//if it is not a parity bit, it places the value into the bit position\n\t\t\t\tbinaryCode[i]=binaryNumber.getBitValue(j);\n\t\t\t\tj++;\n\t\t\t}\n\n\t\t}\n\t}",
"public static void main(String[] args) {\n// heap.replace(5);\n// heap.printHeap();\n\t \n\t int[] numbers = {5, 3, 50, 2, 16, 1};\n\t BinaryTreeNode binaryTreeHead = BuildBinarySearchTree.buildBinarySearchTree(numbers);\n\t BinaryTreeTraversals.printLevelOrder(binaryTreeHead);\n\t System.out.println(\"\\n\\n\");\n\t BinaryTreeTraversals.printInorderNonRecursive(binaryTreeHead);\n }",
"private static void buildHeap(int arr[], int n) \n\t\t{\n\t\t\tfor(int i=n;i>=0;i++)\n\t\t\t\theapify(arr,n,i);\n\t\t\t\n\t\t}",
"public BinHeap()\n {\n // allocate heap to hold 100 items\n arr = (T[]) new Comparable[100];\n // set size of heap to 0\n size = 0;\n }",
"public HuffmanTreeNode deleteFromHeapAt(int index) {\n\t\tHuffmanTreeNode[] heap = swap(this.getHuffmanHeap(), index, this.getHuffmanHeap().length - 1);\n\t\tHuffmanTreeNode deletedNode = heap[heap.length - 1];\n\t\tHuffmanTreeNode[] newHeap = new HuffmanTreeNode[heap.length - 1];\n\t\n\t\tfor (int i = 0; i < newHeap.length; i++)\n\t\t\tnewHeap[i] = heap[i];\n\t\t\n\t\tnewHeap = heapSort(newHeap);\n\t\tthis.setHuffmanHeap(newHeap);\n\t\t\n\t\treturn deletedNode;\n\t}",
"public BinaryHeap(int maxCapacity) {\n\tpq = new Comparable[maxCapacity];\n\tsize = 0;\n }",
"int HuffmanCode(int table_select, int x, int y ) {\n\t\tint signx = 0, signy = 0, linbitsx, linbitsy, linbits, xlen, ylen, idx;\n\n\t\tcbits = 0;\n\t\txbits = 0;\n\t\tcode = 0;\n\t\text = 0;\n\n\t\tif(table_select==0) return 0;\n\n\t\t// signx = (x > 0)? 0: 1;\n\t\t// signy = (y > 0)? 0: 1;\n\t\t//x = Math.abs( x );\n\t\t//y = Math.abs( y );\n\n\t\tif(x < 0) {x = -x; signx = 1;}\n\t\tif(y < 0) {y = -y; signy = 1;}\n\n\t\txlen = this.xlen[table_select];\n\t\tylen = this.ylen[table_select];\n\t\tlinbits = this.linbits[table_select];\n\t\tlinbitsx = linbitsy = 0;\n\n\t\tif ( table_select > 15 ) { /* ESC-table is used */\n\t\t\tif ( x > 14 ) {\n\t\t\t\tlinbitsx = x - 15;\n\t\t\t\tx = 15;\n\t\t\t}\n\t\t\tif ( y > 14 ) {\n\t\t\t\tlinbitsy = y - 15;\n\t\t\t\ty = 15;\n\t\t\t}\n\n\t\t\tidx = (x * ylen) + y;\n\t\t\tcode = table[table_select][idx];\n\t\t\tcbits = hlen [table_select][idx];\n\t\t\tif ( x > 14 ) {\n\t\t\t\text |= linbitsx;\n\t\t\t\txbits += linbits;\n\t\t\t}\n\t\t\tif ( x != 0 ) {\n\t\t\t\text <<= 1;\n\t\t\t\text |= signx;\n\t\t\t\txbits += 1;\n\t\t\t}\n\t\t\tif ( y > 14 ) {\n\t\t\t\text <<= linbits;\n\t\t\t\text |= linbitsy;\n\t\t\t\txbits += linbits;\n\t\t\t}\n\t\t\tif ( y != 0 ) {\n\t\t\t\text <<= 1;\n\t\t\t\text |= signy;\n\t\t\t\txbits += 1;\n\t\t\t}\n\t\t} else { /* No ESC-words */\n\t\t\tidx = (x * ylen) + y;\n\t\t\tcode = table[table_select][idx];\n\t\t\tcbits += hlen[table_select][ idx ];\n\n\t\t\tif ( x != 0 ) {\n\t\t\t\tcode <<= 1;\n\t\t\t\tcode |= signx;\n\t\t\t\tcbits ++;\n\t\t\t}\n\t\t\tif ( y != 0 ) {\n\t\t\t\tcode <<= 1;\n\t\t\t\tcode |= signy;\n\t\t\t\tcbits ++;\n\t\t\t}\n\t\t}\n\n\t\treturn cbits + xbits;\n\t}"
] | [
"0.69321525",
"0.6516903",
"0.6486174",
"0.63072354",
"0.62683284",
"0.62192714",
"0.6136043",
"0.6123995",
"0.61110705",
"0.610073",
"0.600579",
"0.59733063",
"0.5947394",
"0.59392744",
"0.5912014",
"0.5815266",
"0.5807434",
"0.58021456",
"0.5779957",
"0.5724183",
"0.5687864",
"0.56755793",
"0.5647629",
"0.559847",
"0.5572094",
"0.5536228",
"0.5532874",
"0.55002093",
"0.5499875",
"0.5485379",
"0.54833674",
"0.5480627",
"0.547761",
"0.54659504",
"0.5446891",
"0.54273593",
"0.53950936",
"0.5392431",
"0.5390309",
"0.5384631",
"0.5383999",
"0.53512996",
"0.53239864",
"0.5322041",
"0.53099376",
"0.527793",
"0.5257433",
"0.5249615",
"0.52465993",
"0.5244584",
"0.52366054",
"0.52354944",
"0.52354854",
"0.5197581",
"0.5187167",
"0.518287",
"0.5109683",
"0.51095396",
"0.5108651",
"0.5091294",
"0.5085162",
"0.50528634",
"0.5037262",
"0.50039834",
"0.4998073",
"0.49836498",
"0.49816522",
"0.49756986",
"0.49747726",
"0.49679494",
"0.49646637",
"0.49605873",
"0.4957371",
"0.49552992",
"0.49494192",
"0.4940577",
"0.48950428",
"0.48903334",
"0.4884036",
"0.4878099",
"0.48743463",
"0.48650447",
"0.48649374",
"0.48624104",
"0.48528463",
"0.4849931",
"0.48446068",
"0.48396957",
"0.48375905",
"0.48238194",
"0.48133522",
"0.4777959",
"0.47708258",
"0.47547987",
"0.4750019",
"0.47436133",
"0.47388378",
"0.47380543",
"0.4737023",
"0.47353357"
] | 0.57765144 | 19 |
Method for making the a Huffman Tree from a PQHeap. Runs the Huffman Algorithm which extracts the two smallest elements from the PQHeap and merges these into a new element, which is then inserted into the PQHeap. This is done n1 = 255 times. Typecasting from Element.data (Object) to HuffmanTempTree is used. | private HuffmanTempTree makeTree() {
PQHeap queue = makeQueue();
for (int i = 0; i < frequency.length - 1; i++) {
HuffmanTempTree zTree = new HuffmanTempTree(0);
Element x = queue.extractMin();
Element y = queue.extractMin();
int zFreq = x.key + y.key;
zTree.merge((HuffmanTempTree) x.data, (HuffmanTempTree) y.data);
queue.insert(new Element(zFreq, zTree));
}
return (HuffmanTempTree) queue.extractMin().data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createHuffmanTree() {\n\t\twhile (pq.getSize() > 1) {\n\t\t\tBinaryTreeInterface<HuffmanData> b1 = pq.removeMin();\n\t\t\tBinaryTreeInterface<HuffmanData> b2 = pq.removeMin();\n\t\t\tHuffmanData newRootData =\n\t\t\t\t\t\t\tnew HuffmanData(b1.getRootData().getFrequency() +\n\t\t\t\t\t\t\t\t\t\t\tb2.getRootData().getFrequency());\n\t\t\tBinaryTreeInterface<HuffmanData> newB =\n\t\t\t\t\t\t\tnew BinaryTree<HuffmanData>(newRootData,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b1,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b2);\n\t\t\tpq.add(newB);\n\t\t}\n\t\thuffmanTree = pq.getMin();\n\t}",
"public void constructTree(){\n PriorityQueue<HCNode> queue=new PriorityQueue<HCNode>();\n \n for(int i=0;i<MAXSIZE;i++){\n if(NOZERO){\n if(occTable[i]!=0){\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }else{\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }\n //constructing the Huffman Tree\n HCNode n1=null,n2=null;\n while(((n2=queue.poll())!=null) && ((n1=queue.poll())!=null)){\n HCNode nnode=new HCNode(n1.str+n2.str,n1.occ+n2.occ, null);\n nnode.left=n1;nnode.right=n2;\n n1.parent=nnode;n2.parent=nnode;\n queue.add(nnode);\n }\n if(n1==null&&n2==null){\n System.out.println(\"oops\");\n }\n if(n1!=null)\n root=n1;\n else\n root=n2;\n }",
"private PQHeap makeQueue(){\n \tPQHeap queue = new PQHeap(frequency.length);\n \tfor (int i = 0; i < frequency.length; i++) {\n \t\tqueue.insert(new Element(frequency[i], new HuffmanTempTree(i)));\n \t}\n \treturn queue;\n \t}",
"public void makeTree(){\n //convert Hashmap into charList\n for(Map.Entry<Character,Integer> entry : freqTable.entrySet()){\n HuffmanNode newNode = new HuffmanNode(entry.getKey(),entry.getValue());\n charList.add(newNode);\n }\n \n if(charList.size()==0)\n return;\n \n if(charList.size()==1){\n HuffmanNode onlyNode = charList.get(0);\n root = new HuffmanNode(null,onlyNode.getFrequency());\n root.setLeft(onlyNode);\n return;\n }\n \n Sort heap = new Sort(charList);\n heap.heapSort();\n \n while(heap.size()>1){\n \n HuffmanNode leftNode = heap.remove(0);\n HuffmanNode rightNode = heap.remove(0);\n \n HuffmanNode newNode = merge(leftNode,rightNode);\n heap.insert(newNode);\n heap.heapSort();\n }\n \n charList = heap.getList();\n root = charList.get(0);\n }",
"private HuffmanTreeNode[] heapify(int freq[][]) {\n\t\tHuffmanTreeNode[] heap = new HuffmanTreeNode[freq.length];\n\t\tfor (int i = 0; i < freq.length; i++)\n\t\t{\n\t\t\theap[i] = new HuffmanTreeNode(freq[i][1], freq[i][0], null, null);\n\t\t}\n\t\t\n\t\theap = heapSort(heap);\n\n\t\treturn heap;\n\t}",
"public CS232LinkedBinaryTree<Integer, Character> buildHuffTree() {\n\n\t\twhile (huffBuilder.size() > 1) {// Until one tree is left...\n\n\t\t\t// Make references to the important trees\n\t\t\tCS232LinkedBinaryTree<Integer, Character> newTree = new CS232LinkedBinaryTree<Integer, Character>();\n\t\t\tCS232LinkedBinaryTree<Integer, Character> firstSubTree = huffBuilder.remove();\n\t\t\tCS232LinkedBinaryTree<Integer, Character> secondSubTree = huffBuilder.remove();\n\n\t\t\t// Create the new root on the new joined tree. Use the character of higher priority.\n\t\t\tCharacter newTreeRootValue = this.getPriorityCharacter(firstSubTree.root.value, secondSubTree.root.value);\n\t\t\tnewTree.add(firstSubTree.root.key + secondSubTree.root.key, newTreeRootValue);\n\n\t\t\t// Join the new root's right side with the first tree\n\t\t\tnewTree.root.right = firstSubTree.root;\n\t\t\tfirstSubTree.root.parent = newTree.root;\n\n\t\t\t// Join the new root's left side with the second tree\n\t\t\tnewTree.root.left = secondSubTree.root;\n\t\t\tsecondSubTree.root.parent = newTree.root;\n\n\t\t\t// put the newly created tree back into the priority queue\n\t\t\thuffBuilder.add(newTree); \n\t\t}\n\t\t/*\n\t\t * At the end of the whole process, we have one final mega-tree. return\n\t\t * it and finally empty the queue!\n\t\t */\n\t\treturn huffBuilder.remove();\n\t}",
"private HuffmanNode buildTree(int n) {\r\n \tfor (int i = 1; i <= n; i++) {\r\n \t\tHuffmanNode node = new HuffmanNode();\r\n \t\tnode.left = pQueue.poll();\r\n \t\tnode.right = pQueue.poll();\r\n \t\tnode.frequency = node.left.frequency + node.right.frequency;\r\n \t\tpQueue.add(node);\r\n \t}\r\n return pQueue.poll();\r\n }",
"public void buildTree(HuffData[] symbols) {\n //Create a new priorityqueue of type BinaryTree<HuffData> the size of \n //the number of symbols passed in\n Queue<BinaryTree<HuffData>> theQueue = new PriorityQueue<BinaryTree<HuffData>>(symbols.length, new CompareHuffmanTrees());\n //For each symbol in the symbols array\n for (HuffData nextSymbol : symbols) {\n //Create a new binary tree with the symbol\n BinaryTree<HuffData> aBinaryTree = new BinaryTree<HuffData>(nextSymbol, null, null);\n //Offer the new binary tree to the queue\n theQueue.offer(aBinaryTree);\n }\n //While there are still more than one items in the queue\n while(theQueue.size() > 1) {\n BinaryTree<HuffData> left = theQueue.poll(); //Take the top off the queue\n BinaryTree<HuffData> right = theQueue.poll(); //Take the new top off the queue\n int wl = left.getData().weight; //Get the weight of the left BinaryTree\n int wr = left.getData().weight; //Get the weight of the right BinaryTree\n //Create a new HuffData object with the weight as the sum of the left\n //and right and a null symbol\n HuffData sum = new HuffData(wl + wr, null); \n //Create a new BinaryTree with the sum HuffData and the left and right\n //as the left and right children\n BinaryTree<HuffData> newTree = new BinaryTree<HuffData>(sum, left, right);\n //Offer the sum binarytree back to the queue\n theQueue.offer(newTree);\n }\n //Take the last item off the queue\n huffTree = theQueue.poll();\n \n //Initalize the EncodeData array to be the same length as the passed in symbols\n encodings = new EncodeData[symbols.length];\n }",
"private void buildBinaryTree() {\n log.info(\"Constructing priority queue\");\n Huffman huffman = new Huffman(cache.vocabWords());\n huffman.build();\n\n log.info(\"Built tree\");\n\n }",
"private void buildTree() {\n\t\tfinal TreeSet<Tree> treeSet = new TreeSet<Tree>();\n\t\tfor (char i = 0; i < 256; i++) {\n\t\t\tif (characterCount[i] > 0) {\n\t\t\t\ttreeSet.add(new Tree(i, characterCount[i]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge the trees to one Tree\n\t\tTree left;\n\t\tTree right;\n\t\twhile (treeSet.size() > 1) {\n\t\t\tleft = treeSet.pollFirst();\n\t\t\tright = treeSet.pollFirst();\n\t\t\ttreeSet.add(new Tree(left, right));\n\t\t}\n\n\t\t// There is only our final tree left\n\t\thuffmanTree = treeSet.pollFirst();\n\t}",
"public HuffmanTree(Queue<Node> queue) {\r\n while (queue.size() > 1) {\r\n Node left = queue.poll();\r\n Node right = queue.poll();\r\n Node node = new Node('-', left.f + right.f, left, right);\r\n queue.add(node);\r\n }\r\n this.root = queue.peek();\r\n\r\n //initial two maps\r\n this.initialTable(this.root, \"\");\r\n\r\n }",
"public static Node buildHuffManTree(PriorityQueue<Node> queue) {\n\t\t\n\t\twhile(queue.size()>1) {\n\t\t\t\n\t\t\tNode left = queue.poll();\n\t\t\tNode right = queue.poll();\n\t\t\t\n\t\t\tNode root = new Node(left.frequency + right.frequency);\n\t\t\troot.left = left;\n\t\t\troot.right = right;\n\t\t\t\n\t\t\tqueue.add(root);\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn queue.poll();\n\t\t\n\t}",
"public static HuffmanNode createTree(HuffmanNode[] nodeArr){\n HuffmanNode[] garbageArr = nodeArr;\n while(garbageArr.length != 1){\n HuffmanNode[] tempArr = new HuffmanNode[garbageArr.length-1];\n tempArr[0] = combineNodes(garbageArr[0], garbageArr[1]);\n for(int i = 1; i < garbageArr.length-1; i++){\n tempArr[i] = garbageArr[i+1];\n }\n garbageArr = freqSort(tempArr);\n }\n return garbageArr[0];\n }",
"public static Node make_huffmann_tree(List li){\n //Sorting list in increasing order of its letter frequency \n li.sort(new comp());\n Node temp=null;\n Iterator it=li.iterator();\n //System.out.println(li.size());\n //Loop for making huffman tree till only single node remains in list\n while(true){\n temp=new Node();\n //a and b are Node which are to be combine to make its parent\n Node a=new Node(),b=new Node();\n a=null;b=null;\n //checking if list is eligible for combining or not\n //here first assignment of it.next in a will always be true as list till end will\n //must have atleast one node\n a=(Node)it.next();\n //Below condition is to check either list has 2nd node or not to combine \n //If this condition will be false, then it means construction of huffman tree is completed\n if(it.hasNext()){b=(Node)it.next();}\n //Combining first two smallest nodes in list to make its parent whose frequncy \n //will be equals to sum of frequency of these two nodes \n if(b!=null){\n temp.freq=a.freq+b.freq;a.data=0;b.data=1;//assigining 0 and 1 to left and right nodes\n temp.left=a;temp.right=b;\n //after combing, removing first two nodes in list which are already combined\n li.remove(0);//removes first element which is now combined -step1\n li.remove(0);//removes 2nd element which comes on 1st position after deleting first in step1\n li.add(temp);//adding new combined node to list\n //print_list(li); //For visualizing each combination step\n }\n //Sorting after combining to again repeat above on sorted frequency list\n li.sort(new comp()); \n it=li.iterator();//resetting list pointer to first node (head/root of tree)\n if(li.size()==1){return (Node)it.next();} //base condition ,returning root of huffman tree \n }\n}",
"public void setPriorityQueue() {\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tif (leafEntries[i].getFrequency() > 0)\n\t\t\t\tpq.add(new BinaryTree<HuffmanData>(leafEntries[i]));\n\t\t}\n\t}",
"public Node buildTree(int[] frequency)\n {\n /* Initialize the priority queue */\n pq=new PriorityQueue<Node>(c.size(),comp); \n p=new PriorityQueue<Node>(c.size(),comp); \n /* Create leaf node for each unique character in the string */\n for(int i = 0; i < c.size(); i++)\n { \n pq.offer(new Node(c.get(i), frequency[i], null, null));\n } \n createCopy(pq); \n /* Until there is only one node in the priority queue */\n while(pq.size() > 1)\n { \n /* Minimum frequency is kept in the left */\n Node left = pq.poll();\n /* Next minimum frequency is kept in the right */\n Node right = pq.poll();\n /* Create a new internal node as the parent of left and right */\n pq.offer(new Node('\\0', left.frequency+right.frequency, left, right)); \n } \n /* Return the only node which is the root */\n return pq.poll();\n }",
"private BinaryTree<Character> constructTree(){\n if(pq.size() == 1) return pq.poll().data;\n if(pq.size() == 0) return null;\n // Poll the lowest two trees, combine them, then stick them back in the queue.\n Helper<BinaryTree<Character>> temp0 = pq.poll(), temp1 = pq.poll(),\n result = new Helper<>(temp0.priority + temp1.priority, new BinaryTree<>(temp0.data, null , temp1.data));\n pq.add(result);\n // Call again to keep constructing.\n return constructTree();\n }",
"private static Node binomialHeapMerge(BinomialHeap h1, BinomialHeap h2) {\n\t\t\n\t\t// checking for null values\n\t\tif(h1.head == null)\n\t\t\treturn h2.head;\n\t\tif(h2.head == null)\n\t\t\treturn h1.head;\n\t\t\n\t\t// initialize pointers\n\t\t// initialize the first pointer based on smallest node in both heaps\n\t\tNode first = null;\n\t\tNode curr = null;\n\t\tNode currh1 = h1.head;\n\t\tNode currh2 = h2.head;\n\t\tif (currh1.degree < currh2.degree) { \n first = currh1;\n currh1 = currh1.rightSibling;\n }\n else {\n \tfirst = currh2;\n currh2 = currh2.rightSibling;\n }\n\t\t\n\t\t// loop over remaining values by attaching the smallest degree element\n\t\t// one at a time until one of the pointers becomes null\n\t\tcurr = first;\n\t\twhile (currh1!=null && currh2!=null) {\n\t if (currh1.degree < currh2.degree) { \n\t curr.rightSibling = currh1;\n\t currh1 = currh1.rightSibling;\n\t }\n\t else {\n\t curr.rightSibling = currh2;\n\t currh2 = currh2.rightSibling;\n\t }\n\t \n\t curr = curr.rightSibling;\n\t }\n\t \n\t\t// attach the remaining of the other list to current list's right\n\t if (currh1!=null)\n\t curr.rightSibling = currh1;\n\t else\n\t curr.rightSibling = currh2;\n\n\t //return the head of newly formed list of heaps\n\t return first;\n\t}",
"public static void createTree(ArrayList<HuffmanNode> tree) {\n\t\n\t\t//loops through until the tree.\n\t\twhile(tree.size() > 1) {\n\t\t\tCollections.sort(tree);\n\t\t\tHuffmanNode left = tree.get(0);\n\t\t\tHuffmanNode right = tree.get(1);\n\t\t\t\n\t\t\t/*creates the new node and adds it to the arrayList, and removes the two lowest frequency nodes\n\t\t\t * then recursively calls the create method again\n\t\t\t */\n\t\t\ttree.add(new HuffmanNode((right.frequency + left.frequency), left, right));\n\t\t\ttree.remove(0);\n\t\t\ttree.remove(0);\n\t\t\tcreateTree(tree);\n\t\t}\n\t}",
"private Queue<HuffmanNode> ArrayHuffmanCodeCreator(Queue<HuffmanNode> frequencies) {\n while (frequencies.size() > 1) {\n HuffmanNode first = frequencies.poll();\n HuffmanNode second = frequencies.poll();\n HuffmanNode tempNode = new \n HuffmanNode(first.getFrequency() + second.getFrequency());\n tempNode.left = first;\n tempNode.right = second;\n frequencies.add(tempNode);\n }\n return frequencies;\n }",
"public static HuffmanNode huffmanAlgo() {\r\n\t\tHuffmanNode root;\r\n\t\t\r\n\t\twhile(nodeArrList.size() > 1) {\r\n\t\t\tif(nodeArrList.get(0).frequency == 0) {\r\n\t\t\t\tnodeArrList.remove(0);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tHuffmanNode left = nodeArrList.remove(0);\r\n\t\t\t\tHuffmanNode right = nodeArrList.remove(0);\r\n\t\t\t\tHuffmanNode replacement = new HuffmanNode(null, left.frequency + right.frequency);\r\n\t\t\t\treplacement.left = left;\r\n\t\t\t\treplacement.right = right;\r\n\t\t\t\tnodeArrList.add(replacement);\r\n\t\t\t}\r\n\t\t}\r\n\t\troot = nodeArrList.get(0);\r\n\t\treturn root;\r\n\t}",
"public HuffmanTree() {\r\n\t\tsuper();\r\n\t}",
"MinHeapNode newNode(char data, int freq)\r\n\t{\r\n\t MinHeapNode temp = new MinHeapNode();\r\n\t temp.left = temp.right = null;\r\n\t temp.data = data;\r\n\t temp.freq = freq;\r\n\t return temp;\r\n\t}",
"public void buildHeap() {\n\t\tthis.makeComplete();\n\t\tfor(int i = this.size/2; i >= 1; i--)\n\t\t\tthis.heapify(i);\n\t}",
"private static <T extends Comparable<T>> void buildHeap(T[] table)\n {\n int n = 1;\n while (n < table.length)\n {\n n++;\n int child = n-1;\n int parent = (child - 1) / 2;\n while (parent >=0 && table[parent].compareTo(table[child]) < 0)\n {\n swap (table, parent, child);\n child = parent;\n parent = (child - 1) / 2;\n }//end while\n }//end while\n }",
"public HuffmanTree(ArrayOrderedList<HuffmanPair> pairsList) {\r\n\r\n\t\t\t\r\n\t\tArrayOrderedList<HuffmanTree> buildList = new ArrayOrderedList<HuffmanTree>();\r\n\t\tIterator<HuffmanPair> iterator = pairsList.iterator();\r\n\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\tbuildList.add(new HuffmanTree(iterator.next()));\r\n//\t\t\t\tif(buildList.first().getRoot().getElement().getCharacter() == iterator.next().getCharacter())i++;\r\n\t\t\t}\r\n//\t\t\tif (i == buildList.size()) {\r\n//\t\t\t\tArrayOrderedList<HuffmanTree> new_buildList = new ArrayOrderedList<HuffmanTree>();\r\n//\t\t\t\tnew_buildList.add(buildList.first());\r\n//\t\t\t\tbuildList = new_buildList;\r\n//\t\t\t}\r\n//\t\t\telse {\t\r\n\t\t\twhile (buildList.size() > 1) {\r\n\t\t\t\tHuffmanTree lefttree = buildList.removeFirst(); HuffmanTree righttree = buildList.removeFirst();\r\n\t\t\t\t//totalFre = the total weights of both trees.\r\n\t\t\t\tint totalFre = lefttree.getRoot().getElement().getFrequency() + righttree.getRoot().getElement().getFrequency();\r\n\t\t\t\tHuffmanPair root = new HuffmanPair(totalFre);\r\n\t\t\t\tbuildList.add(new HuffmanTree(root, lefttree, righttree));\r\n\t\t\t}\r\n\t\tthis.setRoot(buildList.first().getRoot());\r\n\t}",
"public void makeHeap() {\r\n\t\t//for (int i = (theHeap.size() >> 1) - 1; i >= 0; i--) {\r\n\t\tfor (int i = (theHeap.size() - 1) >> 1; i >= 0; i--) {\r\n\t\t\tsiftDown(i);\r\n\t\t}\r\n\t}",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tMap<Character, Integer> frequencyMap = new HashMap<>();\n\t\tint textLength = text.length();\n\n\t\tfor (int i = 0; i < textLength; i++) {\n\t\t\tchar character = text.charAt(i);\n\t\t\tif (!frequencyMap.containsKey(character)) {\n\t\t\t\tfrequencyMap.put(character, 1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tint newFreq = frequencyMap.get(character) + 1;\n\t\t\t\tfrequencyMap.replace(character, newFreq);\n\t\t\t}\n\t\t}\n\n\t\tPriorityQueue<Node> queue = new PriorityQueue<>();\n\n\t\tIterator iterator = frequencyMap.entrySet().iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMap.Entry<Character, Integer> pair = (Map.Entry<Character, Integer>) iterator.next();\n\t\t\tNode node = new Node(null, null, pair.getKey(), pair.getValue());\n\t\t\tqueue.add(node);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tNode node1 = queue.poll();\n\t\t\tNode node2 = queue.poll();\n\t\t\tNode parent = new Node(node1, node2, '\\t', node1.getFrequency() + node2.getFrequency());\n\t\t\tqueue.add(parent);\n\t\t}\n\t\thuffmanTree = queue.poll();\n\t\tSystem.out.println(\"firstNode: \"+ huffmanTree);\n\t\tcodeTable(huffmanTree);\n\n\t\t//Iterator iterator1 = encodingTable.entrySet().iterator();\n\n\t\t/*\n\t\twhile (iterator1.hasNext()) {\n\t\t\tMap.Entry<Character, String> pair = (Map.Entry<Character, String>) iterator1.next();\n\t\t\tSystem.out.println(pair.getKey() + \" : \" + pair.getValue() + \"\\n\");\n\t\t}\n\t\t*/\n\n\t\t//System.out.println(\"Hashmap.size() : \" + frequencyMap.size());\n\n\t}",
"public void insertIntoHeap(HuffmanTreeNode node) {\n\n\t\tHuffmanTreeNode[] heap = this.getHuffmanHeap();\n\t\tHuffmanTreeNode[] newHeap = new HuffmanTreeNode[heap.length + 1];\n\t\t\n\t\tfor (int i = 0; i < heap.length; i++)\n\t\t{\n\t\t\tnewHeap[i] = heap[i];\n\t\t}\n\t\t\n\t\tnewHeap[heap.length] = node;\n\t\tnewHeap = heapSort(newHeap);\n\t\tthis.setHuffmanHeap(newHeap);\n\t}",
"private static void generateHuffmanTree(){\n try (BufferedReader br = new BufferedReader(new FileReader(_codeTableFile))) {\n String line;\n while ((line = br.readLine()) != null) {\n // process the line.\n if(!line.isEmpty() && line!=null){\n int numberData = Integer.parseInt(line.split(\" \")[0]);\n String code = line.split(\" \")[1];\n Node traverser = root;\n for (int i = 0; i < code.length() - 1; i++){\n char c = code.charAt(i); \n if (c == '0'){\n //bit is 0\n if(traverser.getLeftPtr() == null){\n traverser.setLeftPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getLeftPtr();\n }\n else{\n //bit is 1\n if(traverser.getRightPtr() == null){\n traverser.setRightPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getRightPtr();\n }\n }\n //Put data in the last node by creating a new leafNode\n char c = code.charAt(code.length() - 1);\n if(c == '0'){\n traverser.setLeftPtr(new LeafNode(9999999, numberData, null, null));\n }\n else{\n traverser.setRightPtr(new LeafNode(9999999, numberData, null, null));\n }\n }\n }\n } \n catch (IOException ex) {\n Logger.getLogger(FrequencyTableBuilder.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public HuffmanTree(HuffmanPair element) {\r\n\t\tsuper(element);\r\n\t}",
"public Node createHuffmanTree(File f) throws FileNotFoundException {\r\n File file = f;\r\n FileInputStream fi = new FileInputStream(file);\r\n List<Node> nodes = new LinkedList<>();\r\n\r\n// Creating a map, where the key is characters and the values are the number of characters in the file\r\n Map<Character, Integer> charsMap = new LinkedHashMap<>();\r\n try (Reader reader = new InputStreamReader(fi);) {\r\n int r;\r\n while ((r = reader.read()) != -1) {\r\n char nextChar = (char) r;\r\n\r\n if (charsMap.containsKey(nextChar))\r\n charsMap.compute(nextChar, (k, v) -> v + 1);\r\n else\r\n charsMap.put(nextChar, 1);\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n//// Sort the map by value and create a list\r\n// charsMap = charsMap.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));\r\n\r\n// Creating a list of Nodes from a map\r\n for (Character ch : charsMap.keySet()) {\r\n nodes.add(new Node(ch, charsMap.get(ch), null, null));\r\n }\r\n\r\n// Creating a Huffman tree\r\n while (nodes.size() > 1) {\r\n Node firstMin = nodes.stream().min(Comparator.comparingInt(n -> n.count)).get();\r\n nodes.remove(firstMin);\r\n Node secondMin = nodes.stream().min(Comparator.comparingInt(n -> n.count)).get();\r\n nodes.remove(secondMin);\r\n\r\n Node newNode = new Node(null, firstMin.count + secondMin.count, firstMin, secondMin);\r\n newNode.left.count = null;\r\n newNode.right.count = null;\r\n nodes.add(newNode);\r\n nodes.remove(firstMin);\r\n nodes.remove(secondMin);\r\n }\r\n\r\n// Why first? See algorithm!\r\n nodes.get(0).count = null;\r\n return nodes.get(0);\r\n }",
"void buildHeap() {\n\tfor(int i=parent(size-1); i>=0; i--) {\n\t percolateDown(i);\n\t}\n }",
"public void deleteMin() {\r\n\t\tif (empty())\r\n\t\t\treturn;\r\n\t\telse {\r\n\t\t\tif (this.size > 0) {\r\n\t\t\t\tthis.size--;\r\n\t\t\t}\r\n\t\t\tif (this.size == 0) {\r\n\t\t\t\tthis.empty = true;\r\n\t\t\t}\r\n\r\n\t\t\tHeapNode hN = this.min;\r\n\t\t\tint rnkCount = 0;\r\n\t\t\tHeapNode hNIterator = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\trnkCount++;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t}\r\n\t\t\tthis.HeapTreesArray[rnkCount] = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\trnkCount--;\r\n\t\t\tBinomialHeap bH = new BinomialHeap();\r\n\t\t\tif (hNIterator != null) {\r\n\t\t\t\tbH.empty = false;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\tbH.HeapTreesArray[rnkCount] = hNIterator;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t\tbH.HeapTreesArray[rnkCount].rightBrother = null;\r\n\t\t\t\tif (hNIterator != null) {\r\n\t\t\t\t\thNIterator.leftBrother = null;\r\n\t\t\t\t}\r\n\t\t\t\trnkCount = rnkCount - 1;\r\n\t\t\t}\r\n\t\t\tthis.min = null;\r\n\t\t\tfor (int i = 0; i < this.HeapTreesArray.length; i++) {\r\n\t\t\t\tif (this.min == null) {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tif (this.HeapTreesArray[i].value < this.min.value) {\r\n\t\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!bH.empty()) {\r\n\t\t\t\tfor (int i = 0; i < bH.HeapTreesArray.length; i++) {\r\n\t\t\t\t\tif (bH.min == null) {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tif (bH.HeapTreesArray[i].value < bH.min.value) {\r\n\t\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.meld(bH);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"public void loadInitQueue() {\n\t\t// go through every character\n\t\tfor (int i = 0; i < frequencyCount.length; i++) { \n\t\t\t// check to see if it has appeared at least once.\n\t\t\tif (frequencyCount[i] != 0) { \n\t\t\t\t// if so, make a tree for it and add it to the priority queue.\n\t\t\t\tCS232LinkedBinaryTree<Integer, Character> curTree = new CS232LinkedBinaryTree<Integer, Character>();\n\t\t\t\tcurTree.add(frequencyCount[i], (char) i);\n\t\t\t\thuffBuilder.add(curTree);\n\t\t\t}\n\t\t}\n\t}",
"public Huffman(String input) {\n\t\t\n\t\tthis.input = input;\n\t\tmapping = new HashMap<>();\n\t\t\n\t\t//first, we create a map from the letters in our string to their frequencies\n\t\tMap<Character, Integer> freqMap = getFreqs(input);\n\n\t\t//we'll be using a priority queue to store each node with its frequency,\n\t\t//as we need to continually find and merge the nodes with smallest frequency\n\t\tPriorityQueue<Node> huffman = new PriorityQueue<>();\n\t\t\n\t\t/*\n\t\t * TODO:\n\t\t * 1) add all nodes to the priority queue\n\t\t * 2) continually merge the two lowest-frequency nodes until only one tree remains in the queue\n\t\t * 3) Use this tree to create a mapping from characters (the leaves)\n\t\t * to their binary strings (the path along the tree to that leaf)\n\t\t * \n\t\t * Remember to store the final tree as a global variable, as you will need it\n\t\t * to decode your encrypted string\n\t\t */\n\t\t\n\t\tfor (Character key: freqMap.keySet()) {\n\t\t\tNode thisNode = new Node(key, freqMap.get(key), null, null);\n\t\t\thuffman.add(thisNode);\n\t\t}\n\t\t\n\t\twhile (huffman.size() > 1) {\n\t\t\tNode leftNode = huffman.poll();\n\t\t\tNode rightNode = huffman.poll();\n\t\t\tint parentFreq = rightNode.freq + leftNode.freq;\n\t\t\tNode parent = new Node(null, parentFreq, leftNode, rightNode);\n\t\t\thuffman.add(parent);\n\t\t}\n\t\t\n\t\tthis.huffmanTree = huffman.poll();\n\t\twalkTree();\n\t}",
"public void HuffmanCode()\n {\n String text=message;\n /* Count the frequency of each character in the string */\n //if the character does not exist in the list add it\n for(int i=0;i<text.length();i++)\n {\n if(!(c.contains(text.charAt(i))))\n c.add(text.charAt(i));\n } \n int[] freq=new int[c.size()];\n //counting the frequency of each character in the text\n for(int i=0;i<c.size();i++)\n for(int j=0;j<text.length();j++)\n if(c.get(i)==text.charAt(j))\n freq[i]++;\n /* Build the huffman tree */\n \n root= buildTree(freq); \n \n }",
"public Word[] encode(Word[] heap) {\n\t\theapLast = heap.length - 1;\n\t\tArrays.sort(heap);\n\n\t\tfor (int i = 0; i < heap.length - 1; i++) {\n\t\t\tWord<String> word1 = (Word<String>) removeRoot(heap, 0, heapLast--);\n\t\t\tWord<String> word2 = (Word<String>) removeRoot(heap, 0, heapLast--);\n\n\t\t\tint weight = word1.weight + word2.weight;\n\t\t\tString str = word1.str + word2.str;\n\t\t\tWord word = new Word(weight, str);\n\n\t\t\theapLast = heapLast + 3;\n\t\t\tinsert(heap, word, 0, heapLast);\n\t\t}\n\t\t\n\t\treturn heap;\n\t}",
"public Tree getHuffmanTree() {\n return huffmanTree;\n }",
"void buildHeap() {\n for (int i = parent(size - 1); i >= 0; i--) {\n percolateDown(i);\n }\n }",
"private void heapify(int left, int right) {\r\n\t\tint k = 2 * left;\r\n\r\n\t\tif (k > right)\r\n\t\t\treturn;\r\n\r\n\t\tif ((k + 1) > right) {\r\n\t\t\tif (c[k - 1].compareTo(c[left - 1]) > 0)\r\n\t\t\t\tswitchElements(left - 1, k - 1);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (c[k - 1].compareTo(c[k]) < 0)\r\n\t\t\tk++;\r\n\r\n\t\tif (c[left - 1].compareTo(c[k - 1]) < 0) {\r\n\t\t\tswitchElements(left - 1, k - 1);\r\n\t\t\theapify(k, right);\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\r\n\t\tint [][] arr = new int[][] {\r\n\t\t\t{8,9,10,12},\r\n\t\t\t{2,5,9,12},\r\n\t\t\t{3,6,10,11},\r\n\t\t\t{1,4,7,8}\r\n\t\t};\t\t\r\n\t\t\r\n\t\tPriorityQueue<HeapNode> heap = new PriorityQueue<>();\r\n\t\tfor(int i=0;i<arr.length;i++)\r\n\t\t{\r\n\t\t\theap.offer(new HeapNode(arr[i][0], i, 0));\r\n\t\t}\r\n\t\tint count=0;\r\n\t\twhile(count<16)\r\n\t\t{\r\n\t\t\tHeapNode min = heap.poll();\r\n\t\t\tSystem.out.println(min.value);\r\n\t\t\tcount++;\r\n\t\t\tint value=0;\r\n\t\t\tint nextIndex=min.index+1;\r\n\t\t\tif(nextIndex < arr[min.k].length)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tvalue=arr[min.k][nextIndex];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvalue=Integer.MAX_VALUE;\r\n\t\t\t}\r\n\t\t\theap.offer(new HeapNode(value, min.k, nextIndex));\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public HuffmanCompressor(){\n charList = new ArrayList<HuffmanNode>();\n }",
"public static void makeHeap(char[] heap, int size, CharComparator c) {\n/* 124 */ int i = size >>> 1;\n/* 125 */ while (i-- != 0)\n/* 126 */ downHeap(heap, size, i, c); \n/* */ }",
"public BinaryHeap(int maxCapacity) {\n\tpq = new Comparable[maxCapacity];\n\tsize = 0;\n }",
"public static Object PQupheap(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"5hhoge8azwixhuw1r6f1ae6d\"); // PQupheap(int k)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"7e1sq1127wt16hr7o0andcwob\"); // snode* x = pq[k];\nUNSUPPORTED(\"7bfu0p9xmzkty10xv4n4l5cqs\"); // int v = x->n_val;\nUNSUPPORTED(\"1j1bbq23z0qzohezignztjo66\"); // int next = k/2;\nUNSUPPORTED(\"ae5pat4mp4l6k25pvk8saz8c7\"); // snode* n;\nUNSUPPORTED(\"70492o1szwz9au93c3is2goa\"); // while ((n = pq[next])->n_val < v) {\nUNSUPPORTED(\"4i53ezzk69bsmpugd2h8bo35\"); // pq[k] = n;\nUNSUPPORTED(\"iolnc8pg22pbme3zbdim1eqy\"); // (n)->n_idx = k;\nUNSUPPORTED(\"8fpdpgwovt0k58t5u167v63is\"); // k = next;\nUNSUPPORTED(\"eqtnhenyor3dwsa6on9crthdd\"); // next /= 2;\nUNSUPPORTED(\"7ijd6pszsxnoopppf6xwo8wdl\"); // }\nUNSUPPORTED(\"1lxwoekai0i8v3rg0vrg6ahmx\"); // pq[k] = x;\nUNSUPPORTED(\"7ss0wudteh17yswf0ihopig7z\"); // (x)->n_idx = k;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}",
"public HuffmanCodes() {\n\t\thuffBuilder = new PriorityQueue<CS232LinkedBinaryTree<Integer, Character>>();\n\t\tfileData = new ArrayList<char[]>();\n\t\tfrequencyCount = new int[127];\n\t\thuffCodeVals = new String[127];\n\t}",
"public void meld(BinomialHeap heap2) {\r\n\t\tthis.size = this.size + heap2.size;\r\n\t\tif (heap2.min != null && this.min != null && heap2.min.value < this.min.value) {\r\n\t\t\tthis.min = heap2.min;\r\n\t\t}\r\n\t\tif (heap2.min != null && this.min == null) {\r\n\t\t\tthis.min = heap2.min;\r\n\t\t}\r\n\t\tHeapNode[] heap2Arr = heap2.HeapTreesArray;\r\n\t\tif (this.empty() && !heap2.empty()) {\r\n\t\t\tthis.min = heap2.min;\r\n\t\t\tthis.empty = false;\r\n\t\t}\r\n\t\tfor (int i = 0; i < heap2Arr.length; i++) {\r\n\t\t\tif (heap2Arr[i] != null && this.HeapTreesArray[i] == null) {\r\n\t\t\t\tthis.HeapTreesArray[i] = heap2Arr[i];\r\n\t\t\t} else if (heap2Arr[i] != null && this.HeapTreesArray[i] != null) {\r\n\t\t\t\tHeapNode hN = merge(heap2Arr[i], this.HeapTreesArray[i]);\r\n\t\t\t\tHeapTreesArray[i] = null;\r\n\t\t\t\tint j = i + 1;\r\n\t\t\t\twhile (this.HeapTreesArray[j] != null) {\r\n\t\t\t\t\thN = merge(hN, this.HeapTreesArray[j]);\r\n\t\t\t\t\tHeapTreesArray[j] = null;\r\n\t\t\t\t\tj++;\r\n\t\t\t\t}\r\n\t\t\t\tHeapTreesArray[j] = hN;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"public static void HuffmanTree(String input, String output) throws Exception {\n\t\tFileReader inputFile = new FileReader(input);\n\t\tArrayList<HuffmanNode> tree = new ArrayList<HuffmanNode>(200);\n\t\tchar current;\n\t\t\n\t\t// loops through the file and creates the nodes containing all present characters and frequencies\n\t\twhile((current = (char)(inputFile.read())) != (char)-1) {\n\t\t\tint search = 0;\n\t\t\tboolean found = false;\n\t\t\twhile(search < tree.size() && found != true) {\n\t\t\t\tif(tree.get(search).inChar == (char)current) {\n\t\t\t\t\ttree.get(search).frequency++; \n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t\tsearch++;\n\t\t\t}\n\t\t\tif(found == false) {\n\t\t\t\ttree.add(new HuffmanNode(current));\n\t\t\t}\n\t\t}\n\t\tinputFile.close();\n\t\t\n\t\t//creates the huffman tree\n\t\tcreateTree(tree);\n\t\t\n\t\t//the huffman tree\n\t\tHuffmanNode sortedTree = tree.get(0);\n\t\t\n\t\t//prints out the statistics of the input file and the space saved\n\t\tFileWriter newVersion = new FileWriter(\"C:\\\\Users\\\\Chris\\\\workspace\\\\P2\\\\src\\\\P2_cxt240_Tsuei_statistics.txt\");\n\t\tprintTree(sortedTree, \"\", newVersion);\n\t\tspaceSaver(newVersion);\n\t\tnewVersion.close();\n\t\t\n\t\t// codes the file using huffman encoding\n\t\tFileWriter outputFile = new FileWriter(output);\n\t\ttranslate(input, outputFile);\n\t}",
"public HuffmanNode(int freq, HuffmanNode left, HuffmanNode right){\r\n this.freq = freq;\r\n this.left = left;\r\n this.right = right;\r\n }",
"public WBLeftistHeapPriorityQueueFIFO() {\n\t\theap = new WBLeftistHeap<>();\n\t}",
"private void fixHeap(){\r\n int i = 1;\r\n int v = array[i].value.getYear();\r\n while(hasChildren(i)){\r\n Node left = array[getLeftChildIndex(i)];\r\n Node right = array[getRightChildIndex(i)];\r\n if(left != null){\r\n if(right != null){\r\n if(left.value.getYear() < right.value.getYear()){\r\n if(v > left.value.getYear()){\r\n swap(array[i], left);\r\n i = getLeftChildIndex(i);\r\n continue;\r\n }\r\n else{\r\n break;\r\n }\r\n }\r\n else{\r\n if(v > right.value.getYear()){\r\n swap(array[i], right);\r\n i = getRightChildIndex(i);\r\n continue;\r\n }\r\n else{\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n if(v > left.value.getYear()){\r\n swap(array[i], left);\r\n i = getLeftChildIndex(i);\r\n continue;\r\n }\r\n else{\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n break;\r\n }\r\n }\r\n\r\n }",
"public static void main(String[] args) throws FileNotFoundException, IOException {\n\t\tString input = \"\";\r\n\r\n\t\t//읽어올 파일 경로\r\n\t\tString filePath = \"C:/Users/user/Desktop/data13_huffman.txt\";\r\n\r\n\t\t//파일에서 읽어옴\r\n\t\ttry(FileInputStream fStream = new FileInputStream(filePath);){\r\n\t\t\tbyte[] readByte = new byte[fStream.available()];\r\n\t\t\twhile(fStream.read(readByte) != -1);\r\n\t\t\tfStream.close();\r\n\t\t\tinput = new String(readByte);\r\n\t\t}\r\n\r\n\t\t//빈도수 측정 해시맵 생성\r\n\t\tHashMap<Character, Integer> frequency = new HashMap<>();\r\n\t\t//최소힙 생성\r\n\t\tList<Node> nodes = new ArrayList<>();\r\n\t\t//테이블 생성 해시맵\r\n\t\tHashMap<Character, String> table = new HashMap<>();\r\n\r\n\t\t//노드와 빈도수 측정\r\n\t\tfor(int i = 0; i < input.length(); i++) {\r\n\t\t\tif(frequency.containsKey(input.charAt(i))) {\r\n\t\t\t\t//이미 있는 값일 경우 빈도수를 1 증가\r\n\t\t\t\tchar currentChar = input.charAt(i);\r\n\t\t\t\tfrequency.put(currentChar, frequency.get(currentChar) + 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//키를 생성해서 넣어줌\r\n\t\t\t\tfrequency.put(input.charAt(i), 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//최소 힙에 저장\r\n\t\tfor(Character key : frequency.keySet()) \r\n\t\t\tnodes.add(new Node(key, frequency.get(key), null, null));\r\n\t\t\t\t\r\n\t\t//최소힙으로 정렬\r\n\t\tbuildMinHeap(nodes);\r\n\r\n\t\t//huffman tree를 만드는 함수 실행\r\n\t\tNode resultNode = huffman(nodes);\r\n\r\n\t\t//파일에 씀 (table)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_table.txt\")){\r\n\t\t\tmakeTable(table, resultNode, \"\");\r\n\t\t\tfor(Character key : table.keySet()) {\r\n\t\t\t\t//System.out.println(key + \" : \" + table.get(key));\r\n\t\t\t\tfw.write(key + \" : \" + table.get(key) + \"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//파일에 씀 (encoded code)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_encoded.txt\")){\r\n\t\t\tString allString = \"\";\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < input.length(); i++)\r\n\t\t\t\tallString += table.get(input.charAt(i));\r\n\r\n\t\t\t//System.out.println(allString);\r\n\t\t\tfw.write(allString);\r\n\t\t}\r\n\t}",
"@Before\n public void setUpBinaryMinHeaps() {\n empty = new BinaryMinHeap<>();\n emptyArr = new ArrayList<>();\n \n multipleElements = new BinaryMinHeap<>();\n multipleElements.insert(7);\n multipleElements.insert(8);\n multipleElements.insert(5);\n multipleElements.insert(3);\n multipleElements.insert(2);\n multipleElements.insert(6);\n \n multiArr = new ArrayList<>();\n multiArr.add(2);\n multiArr.add(3);\n multiArr.add(6);\n multiArr.add(8);\n multiArr.add(5);\n multiArr.add(7);\n \n }",
"private void heapifyRemove() {\n // this is called after the item at the bottom-left has been put at the root\n // we need to see if this item should swap down\n int node = 0;\n int left = 1;\n int right = 2;\n int next;\n\n // store the item at the root in temp\n T temp = heap[node];\n\n // find out where we might want to swap root \n if ((heap[left] == null) && (heap[right] == null)) {\n next = count; // no children, so no swapping\n return;\n } else if (heap[right] == null) {\n next = left; // we will check left child\n } else if (((Comparable) heap[left]).compareTo(heap[right]) > 0) { // figure out which is the biggest of the two children\n next = left; // left is bigger than right, so check left child\n } else {\n next = right; // check right child\n }\n\n // compare heap[next] to item temp, if bigger, swap, and then repeat process\n while ((next < count) && (((Comparable) heap[next]).compareTo(temp) > 0)) {\n heap[node] = heap[next];\n node = next;\n left = 2 * node + 1; // left child of current node\n right = 2 * (node + 1); // right child of current node\n if ((heap[left] == null) && (heap[right] == null)) {\n next = count;\n } else if (heap[right] == null) {\n next = left;\n } else if (((Comparable) heap[left]).compareTo(heap[right]) > 0) {\n next = left;\n } else {\n next = right;\n }\n }\n heap[node] = temp;\n\n }",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\ttextArray = text.toCharArray();\n\n\t\tPriorityQueue<Leaf> queue = new PriorityQueue<>(new Comparator<Leaf>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Leaf a, Leaf b) {\n\t\t\t\tif (a.frequency > b.frequency) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (a.frequency < b.frequency) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfor (char c : textArray) {\n\t\t\tif (chars.containsKey(c)) {\n\t\t\t\tint freq = chars.get(c);\n\t\t\t\tfreq = freq + 1;\n\t\t\t\tchars.remove(c);\n\t\t\t\tchars.put(c, freq);\n\t\t\t} else {\n\t\t\t\tchars.put(c, 1);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"tree print\");\t\t\t\t\t\t\t\t// print method begin\n\n\t\tfor(char c : chars.keySet()){\n\t\t\tint freq = chars.get(c);\n\t\t\tSystem.out.println(c + \" \" + freq);\n\t\t}\n\n\t\tint total = 0;\n\t\tfor(char c : chars.keySet()){\n\t\t\ttotal = total + chars.get(c);\n\t\t}\n\t\tSystem.out.println(\"total \" + total);\t\t\t\t\t\t\t// ends\n\n\t\tfor (char c : chars.keySet()) {\n\t\t\tLeaf l = new Leaf(c, chars.get(c), null, null);\n\t\t\tqueue.offer(l);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tLeaf a = queue.poll();\n\t\t\tLeaf b = queue.poll();\n\n\t\t\tint frequency = a.frequency + b.frequency;\n\n\t\t\tLeaf leaf = new Leaf('\\0', frequency, a, b);\n\n\t\t\tqueue.offer(leaf);\n\t\t}\n\n\t\tif(queue.size() == 1){\n\t\t\tthis.root = queue.peek();\n\t\t}\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic MinHeap() { \r\n\t\theap = new MinHeapNode[1]; \r\n\t }",
"public PriorityQueue(int initialCapacity, HeapType type) {\n super(PriorityQueueElement.class, initialCapacity, type);\n elementsMap = new HashMap<V, PriorityQueueElement<P, V>>();\n }",
"public BinaryHeap(int maxCapacity) {\n pq = new Comparable[maxCapacity];\n size = 0;\n }",
"@Test\r\n public void testEncode() throws Exception {\r\n System.out.println(\"encode\");\r\n String message = \"furkan\";\r\n \r\n HuffmanTree Htree = new HuffmanTree();\r\n\r\n HuffmanTree.HuffData[] symbols = {\r\n new HuffmanTree.HuffData(186, '_'),\r\n new HuffmanTree.HuffData(103, 'e'),\r\n new HuffmanTree.HuffData(80, 't'),\r\n new HuffmanTree.HuffData(64, 'a'),\r\n new HuffmanTree.HuffData(63, 'o'),\r\n new HuffmanTree.HuffData(57, 'i'),\r\n new HuffmanTree.HuffData(57, 'n'),\r\n new HuffmanTree.HuffData(51, 's'),\r\n new HuffmanTree.HuffData(48, 'r'),\r\n new HuffmanTree.HuffData(47, 'h'),\r\n new HuffmanTree.HuffData(32, 'b'),\r\n new HuffmanTree.HuffData(32, 'l'),\r\n new HuffmanTree.HuffData(23, 'u'),\r\n new HuffmanTree.HuffData(22, 'c'),\r\n new HuffmanTree.HuffData(21, 'f'),\r\n new HuffmanTree.HuffData(20, 'm'),\r\n new HuffmanTree.HuffData(18, 'w'),\r\n new HuffmanTree.HuffData(16, 'y'),\r\n new HuffmanTree.HuffData(15, 'g'),\r\n new HuffmanTree.HuffData(15, 'p'),\r\n new HuffmanTree.HuffData(13, 'd'),\r\n new HuffmanTree.HuffData(8, 'v'),\r\n new HuffmanTree.HuffData(5, 'k'),\r\n new HuffmanTree.HuffData(1, 'j'),\r\n new HuffmanTree.HuffData(1, 'q'),\r\n new HuffmanTree.HuffData(1, 'x'),\r\n new HuffmanTree.HuffData(1, 'z')\r\n };\r\n\r\n Htree.buildTree(symbols);\r\n \r\n String expResult = \"1100110000100101100001110100111\";\r\n String result = Htree.encode(message, Htree.huffTree);\r\n \r\n assertEquals(expResult, result);\r\n \r\n }",
"private void makePrioQ()\n\t{\n\t\tprioQ = new PrioQ();\n\t\t\n\t\tfor(int i = 0; i < canonLengths.length; i++)\n\t\t{\n\t\t\tif(canonLengths[i] == 0)\n\t\t\t\tcontinue;\n\t\t\tNode node = new Node(i, canonLengths[i]);\n\t\t\tprioQ.insert(node);\n\t\t}\n\t}",
"public FastMinHeap() {\r\n\t\tthis.objectHeap = (E[]) new Object[DEFAULT_CAPACITY];\r\n\t\tthis.costHeap = new double[DEFAULT_CAPACITY];\r\n\t\tthis.size = 0;\r\n\t\tthis.capacity = DEFAULT_CAPACITY;\r\n\t\tthis.locations = new FastHashMap();\r\n\t}",
"public HuffmanNode (HuffmanNode left, HuffmanNode right) {\n \ttotalFrequency = left.totalFrequency + right.totalFrequency;\n \ttokens = new ArrayList<HuffmanToken>();\n \ttokens.addAll(left.tokens);\n \ttokens.addAll(right.tokens);\n \tfor(HuffmanToken node: left.tokens)\n \t\tnode.prependBitToCode(false);\n \tfor(HuffmanToken node: right.tokens)\n \t\tnode.prependBitToCode(true);\n \tthis.left = left;\n \tthis.right = right;\n \tCollections.sort(tokens, new HuffmanTokenComparator());\n }",
"public HeapIntPriorityQueue() {\n elementData = new int[10];\n size = 0;\n }",
"public static String huffmanCoder(String inputFileName, String outputFileName){\n File inputFile = new File(inputFileName+\".txt\");\n File outputFile = new File(outputFileName+\".txt\");\n File encodedFile = new File(\"encodedTable.txt\");\n File savingFile = new File(\"Saving.txt\");\n HuffmanCompressor run = new HuffmanCompressor();\n \n run.buildHuffmanList(inputFile);\n run.makeTree();\n run.encodeTree();\n run.computeSaving(inputFile,outputFile);\n run.printEncodedTable(encodedFile);\n run.printSaving(savingFile);\n return \"Done!\";\n }",
"private void heapSort() {\n\n\t\tint queueSize = priorityQueue.size();\n\n\t\tfor (int j = 0; j < queueSize; j++) {\n\n\t\t\theapified[j] = binaryHeap.top(priorityQueue);\n\t\t\tbinaryHeap.outHeap(priorityQueue);\n\n\t\t}\n\n\t}",
"public PriorityQueue(int size){\n heap = new Element[size];\n }",
"public MinHeap() {\n// contents = new HashMap<>();\n contents= new ArrayList<>();\n backwards = new HashMap<>();\n contents = new ArrayList<>();\n contents.add(null);\n\n// contents.put(0, null);\n backwards.put(null, 0);\n// setContents = new HashSet<>();\n }",
"public Hashtable<Character,Code> getHuffmanCodes(int numberOfCodes,Hashtable<String,Character> revCodes) throws IOException {\r\n\t\tbyte[] b;\r\n\t\tHashtable<Character,Code> codes = new Hashtable<>();\r\n\t\t for (int i = 0 ; i < numberOfCodes ; i++) {\r\n\t\t\t System.out.println(\"i = \" + i);\r\n\t\t\t // i create a stringBuilder that will hold the code for each character\r\n\t\t\t StringBuilder c = new StringBuilder();\r\n\t\t\t // read the integer (4 bytes)\r\n\t\t\t b = new byte[4];\r\n\t\t\t in.read(b);\r\n\t\t\t // will hold the 4 bytes\r\n\t\t\t int code = 0;\r\n\t\t\t \r\n\t\t\t /* beacuse we wrote the integer reversed in the head\r\n\t\t\t * so the first 2 bytes from the left will hold the huffman's code\r\n\t\t\t * we get the second one then stick it to the (code) value we shift it to the left \r\n\t\t\t * then we get the first one and stick it to the (code) without shifting it\r\n\t\t\t * so actually we swipe the first 2 bytes because they are reversed\r\n\t\t\t */\r\n\t\t\t code |= (b[1] & 0xFF);\r\n\t\t\t code <<= 8;\r\n\t\t\t code |= (b[0] & 0xFF);\r\n\t\t\t \r\n\t\t\t // this loop go throw the (code) n bits where n is the length of the huff code that stored in the 2nd index of the array\r\n\t\t\t for (int j = 0 ; j < (b[2] & 0xFF) ; j++) {\r\n\t\t\t\t /*\r\n\t\t\t\t * each loop we compare the first bit from the right using & operation ans if it 1 so insert 1 to he first of the (c) which hold the huff it self\r\n\t\t\t\t * and if it zero we will insert zero as a string for both zero or 1\r\n\t\t\t\t */\r\n\t\t\t\t if ((code & 1) == 1) {\r\n\t\t\t\t\t c.insert(0, \"1\");\r\n\t\t\t\t } else \r\n\t\t\t\t\t c.insert(0, \"0\");\r\n\t\t\t\t code >>>= 1;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t// codes.put((char)(b[3] & 0xFF), new Code((char)(b[3] & 0xFF),c.toString(),rep2[b[0] & 0xFF]));\r\n\t\t\t System.out.println(\"c = \" + c);\r\n\t\t\t \r\n\t\t\t // we store the huff code as a key in the hash and its value will be the character that in the index 3\r\n\t\t\t revCodes.put(c.toString(), (char)(b[3] & 0xFF));\r\n\t\t\t \r\n\t\t }\r\n\t\t return codes;\r\n\t}",
"private void heapifyAdd() {\n // TODO. The general idea of this method is that we are checking whether the \n // most recently added item, which has been put at the end of the array, \n //needs to be swapped with its parent. We do this in a loop, until a swap isn’t needed or we reach the root. This is not recursive.\n\n // Pseudocode:\n // assign newly added item to a temp var.\n // use an index variable to keep track of the index where that value was added\n // while the index isn’t pointing at the root, and while the node at this index is greater than the node at its parent:\n // copy the parent node to the index location (move parent node down the heap)\n // set the index to the parent index\n // when we are at the root, or the parent of current index isn’t bigger, we are done\n // copy the temp variable to the location of the current index. \n T temp;\n int next = count - 1;\n\n temp = heap[next];\n\n while ((next != 0) && (((Comparable) temp).compareTo(heap[(next - 1) / 2]) > 0)) {\n heap[next] = heap[(next - 1) / 2];\n next = (next - 1) / 2;\n }\n heap[next] = temp;\n }",
"public Http2PriorityTree() {\n this.rootNode = new Http2PriorityNode(0, 0);\n nodesByID.put(0, this.rootNode);\n this.evictionQueue = new int[10]; //todo: make this size customisable\n }",
"public HeapPriorityQueue () \n\t{\n\t\tthis(DEFAULT_SIZE);\n\t}",
"public LeftistHeap() {\n root = null;\n }",
"public NodeHeap () {\n // Stupid Java doesn't allow init generic arrays\n heap = new Node[DEFAULT_SIZE];\n size = 0;\n }",
"public Heap() {\r\n\t\tthis(DEFAULT_INITIAL_CAPACITY, null);\r\n\t}",
"public static void main(String args[])\n {\n Scanner s = new Scanner(System.in).useDelimiter(\"\");\n List<node> freq = new SinglyLinkedList<node>();\n \n // read data from input\n while (s.hasNext())\n {\n // s.next() returns string; we're interested in first char\n char c = s.next().charAt(0);\n if (c == '\\n') continue;\n // look up character in frequency list\n node query = new node(c);\n node item = freq.remove(query);\n if (item == null)\n { // not found, add new node\n freq.addFirst(query);\n } else { // found, increment node\n item.frequency++;\n freq.addFirst(item);\n }\n }\n \n // insert each character into a Huffman tree\n OrderedList<huffmanTree> trees = new OrderedList<huffmanTree>();\n for (node n : freq)\n {\n trees.add(new huffmanTree(n));\n }\n \n // merge trees in pairs until one remains\n Iterator ti = trees.iterator();\n while (trees.size() > 1)\n {\n // construct a new iterator\n ti = trees.iterator();\n // grab two smallest values\n huffmanTree smallest = (huffmanTree)ti.next();\n huffmanTree small = (huffmanTree)ti.next();\n // remove them\n trees.remove(smallest);\n trees.remove(small);\n // add bigger tree containing both\n trees.add(new huffmanTree(smallest,small));\n }\n // print only tree in list\n ti = trees.iterator();\n Assert.condition(ti.hasNext(),\"Huffman tree exists.\");\n huffmanTree encoding = (huffmanTree)ti.next();\n encoding.print();\n }",
"public static void heapify() {\n //배열을 heap 자료형으로 만든다.\n // 1d 2d 2d 3d 3d 3d 3d 4d\n// int[] numbers = {9, 12, 1, 3, 6, 2, 8, 4};\n // 1depth의 자식노드 numbers[2i], numbers[2i+1]\n int[] numbers = {4, 1, 3, 2, 16, 9, 10, 14, 8, 7};\n int i = 1;\n while (true) {\n int target = numbers[i-1];\n int left = numbers[2*i-1];\n\n if (2*i == numbers.length) {\n if (left > target){\n numbers[i-1] = left;\n numbers[2*i-1] = target;\n }\n print(numbers);\n break;\n }\n int right =numbers[2*i];\n\n if (left > right) {\n if(left > target) {\n numbers[i-1] = left;\n numbers[2*i-1] = target;\n }\n }else if (right > left) {\n if (right > target) {\n numbers[i-1] = right;\n numbers[2*i] = target;\n }\n }\n i++;\n\n print(numbers);\n }\n\n }",
"private void heapify() {\n\t\tint currIndex = 0;\n\t\twhile (currIndex < heapSize) {\n\t\t\tT val = lstEle.get(currIndex);\n\t\t\tint leftSubtreeIndex = getLeftSubtree(currIndex);\n\t\t\tint rightSubtreeIndex = getRightSubtree(currIndex);\n\t\t\tT leftChildVal = leftSubtreeIndex < heapSize ? lstEle.get(leftSubtreeIndex) : null;\n\t\t\tT rightChildVal = rightSubtreeIndex < heapSize ? lstEle.get(rightSubtreeIndex) : null;\n\t\t\t\n\t\t\tT minVal = null;\n\t\t\tint minValIndex = -1;\n\t\t\tif(leftChildVal != null && rightChildVal != null){\n\t\t\t\tint compVal = leftChildVal.compareTo(rightChildVal); \n\t\t\t\tif(compVal < 0){\n\t\t\t\t\tminVal = leftChildVal;\n\t\t\t\t\tminValIndex = leftSubtreeIndex;\n\t\t\t\t}else {\n\t\t\t\t\tminVal = rightChildVal;\n\t\t\t\t\tminValIndex = rightSubtreeIndex;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(leftChildVal != null && leftChildVal.compareTo(val) < 0){\n\t\t\t\t\tminValIndex = leftSubtreeIndex;\n\t\t\t\t\tminVal = leftChildVal;\n\t\t\t\t}else if (rightChildVal != null && rightChildVal.compareTo(val) < 0 ){\n\t\t\t\t\tminValIndex = rightSubtreeIndex;\n\t\t\t\t\tminVal = rightChildVal;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\tMin Val : \" +minVal +\" --> \" +minValIndex);\n\t\t\t\n\t\t\tlstEle.set(currIndex, minVal);\n\t\t\tcurrIndex = minValIndex;\n\t\t\tlstEle.set(minValIndex, val);\n\t\t\t\n\t\t}\n\n\t}",
"public Node binomialHeapExtractMin() {\n\t\tNode x = this.deleteMin();\n\t\t\n\t\t// make a new heap\n\t\t// reverse the child list of x and assign it to the head of new heap.\n\t\tBinomialHeap hPrime = new BinomialHeap();\n\t\thPrime.head = reverseLinkedList(x.leftChild);\n\t\t\n\t\t// perform union on the child tree list of x and the original heap\n\t\tBinomialHeap h = this.binomialHeapUnion(hPrime);\n\t\tthis.head = h.head;\n\t\t\n\t\t// return the minimum node\n\t\treturn x;\n\t}",
"public HuffmanTree removeMin();",
"public FastMinHeap(int initialSize) {\r\n\t\tif (initialSize < 1) {\r\n\t\t\tthrow new RuntimeException(\"Initial size of heap must be >= 1\");\r\n\t\t}\r\n\t\tthis.objectHeap = (E[]) new Object[initialSize];\r\n\t\tthis.costHeap = new double[initialSize];\r\n\t\tthis.size = 0;\r\n\t\tthis.capacity = initialSize;\r\n\t\tthis.locations = new FastHashMap();\r\n\t}",
"public static Object PQdownheap(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"5jo6sukhc9upf5qv4eukh8kop\"); // PQdownheap (int k)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"dd3235mkocimg2v70ln8ixz3k\"); // snode* x = pq[k];\nUNSUPPORTED(\"e0wd4mp2k58ml2bf01e6mtxfc\"); // int v = (x)->n_val;\nUNSUPPORTED(\"b9pl90rstqz0jhnw3ttda3kx5\"); // int lim = PQcnt/2;\nUNSUPPORTED(\"917ffzmzxsh6kw3txaqow8dv0\"); // snode* n;\nUNSUPPORTED(\"zrgst5t0lhf2kxrym9g7gvsn\"); // int j;\nUNSUPPORTED(\"7bbx1rekibyh3hyxh24lprwwk\"); // while (k <= lim) {\nUNSUPPORTED(\"disb3eax2r4wgge9im541y9hv\"); // j = k+k;\nUNSUPPORTED(\"e4w7jx4o3i4gav8ujef2bapbn\"); // n = pq[j];\nUNSUPPORTED(\"4yles8zr6ozg2g0df2jefc1l2\"); // if (j < PQcnt) {\nUNSUPPORTED(\"77cupwd0hd3zp8he6wd4tm6nx\"); // if ((n)->n_val < (pq[j+1])->n_val) {\nUNSUPPORTED(\"1jeqo15tfc6vbefwf85bniwfn\"); // j++;\nUNSUPPORTED(\"1sglut5nbxcoto9tvzxs3eixh\"); // n = pq[j];\nUNSUPPORTED(\"dquo3qofk56ds5xl95lhvcthf\"); // }\nUNSUPPORTED(\"dvgyxsnyeqqnyzq696k3vskib\"); // }\nUNSUPPORTED(\"3hshbuqs95898wh95e2fdh5uz\"); // if (v >= (n)->n_val) break;\nUNSUPPORTED(\"4i53ezzk69bsmpugd2h8bo35\"); // pq[k] = n;\nUNSUPPORTED(\"iolnc8pg22pbme3zbdim1eqy\"); // (n)->n_idx = k;\nUNSUPPORTED(\"8lpwfkimmel90007dlp5eqpbh\"); // k = j;\nUNSUPPORTED(\"7ijd6pszsxnoopppf6xwo8wdl\"); // }\nUNSUPPORTED(\"1lxwoekai0i8v3rg0vrg6ahmx\"); // pq[k] = x;\nUNSUPPORTED(\"7ss0wudteh17yswf0ihopig7z\"); // (x)->n_idx = k;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}",
"public ArrayHeapMinPQ() {\n heapArray = new ArrayList<>();\n itemMap = new HashMap<>();\n heapArray.add(null); //alway set index 0 null and heap starts from index 1.\n nextIndex = 1;\n }",
"public LinkedMinHeap(MinHeap<T> other){\r\n\t\tif (other.isEmpty()) {\r\n\t\t\tthis.root = null;\r\n\t\t\tthis.size = 0;\r\n\t\t} else if (other.size() == 1) {\r\n\t\t\ttry {\r\n\t\t\t\tthis.root = new Node(other.getMin());\r\n\t\t\t} catch (EmptyHeapException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tthis.size = 1;\r\n\t\t} else {\r\n\t\t\tArrayList<T> temp = new ArrayList<T>();\r\n\t\t\tT val = null;\r\n\t\t\t\r\n\t\t\twhile (!other.isEmpty()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tval = other.deleteMin();\r\n\t\t\t\t} catch (EmptyHeapException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttemp.add(val);\r\n\t\t\t\tinsert(val);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor (T obj: temp) {\r\n\t\t\t\tother.insert(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tmodificationFlag = false;\r\n\t}",
"public PriorityQueue()\n {\n // initialise instance variables\n heap = new PriorityCustomer[100];\n size = 0;\n }",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tif (text.length() <= 1)\n\t\t\treturn;\n\n\t\t//Create a the frequency huffman table\n\t\tHashMap<Character, huffmanNode> countsMap = new HashMap<>();\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tchar c = text.charAt(i);\n\t\t\tif (countsMap.containsKey(c))\n\t\t\t\tcountsMap.get(c).huffmanFrequency++;\n\t\t\telse\n\t\t\t\tcountsMap.put(c, new huffmanNode(c, 1));\n\t\t}\n\n\t\t//Build the frequency tree\n\t\tPriorityQueue<huffmanNode> countQueue = new PriorityQueue<>(countsMap.values());\n\t\twhile (countQueue.size() > 1) {\n\t\t\thuffmanNode left = countQueue.poll();\n\t\t\thuffmanNode right = countQueue.poll();\n\t\t\thuffmanNode parent = new huffmanNode('\\0', left.huffmanFrequency + right.huffmanFrequency);\n\t\t\tparent.leftNode = left;\n\t\t\tparent.rightNode = right;\n\n\t\t\tcountQueue.offer(parent);\n\t\t}\n\n\t\thuffmanNode rootNode = countQueue.poll();\n\n\t\t//Assign the codes to each node in the tree\n\t\tStack<huffmanNode> huffmanNodeStack = new Stack<>();\n\t\thuffmanNodeStack.add(rootNode);\n\t\twhile (!huffmanNodeStack.empty()) {\n\t\t\thuffmanNode huffmanNode = huffmanNodeStack.pop();\n\n\t\t\tif (huffmanNode.huffmanValue != '\\0') {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\thuffmanNode.codeRecord.forEach(sb::append);\n\t\t\t\tString codeSb = sb.toString();\n\n\t\t\t\tencodingTable.put(huffmanNode.huffmanValue, codeSb);\n\t\t\t\tdecodingTable.put(codeSb, huffmanNode.huffmanValue);\n\t\t\t}\n\t\t\telse {\n\t\t\t\thuffmanNode.leftNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.leftNode.codeRecord.add('0');\n\t\t\t\thuffmanNode.rightNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.rightNode.codeRecord.add('1');\n\t\t\t}\n\n\t\t\tif (huffmanNode.leftNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.leftNode);\n\n\t\t\tif (huffmanNode.rightNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.rightNode);\n\t\t}\n\t}",
"public BinHeap()\n {\n // allocate heap to hold 100 items\n arr = (T[]) new Comparable[100];\n // set size of heap to 0\n size = 0;\n }",
"public HuffmanNode (HuffmanToken token) {\n \ttotalFrequency = token.getFrequency();\n \ttokens = new ArrayList<HuffmanToken>();\n \ttokens.add(token);\n \tleft = null;\n \tright = null;\n }",
"@Override\r\n public void run() {\n File huffmanFolder = newDirectoryEncodedFiles(file, encodedFilesDirectoryName);\r\n File huffmanTextFile = new File(huffmanFolder.getPath() + \"\\\\text.huff\");\r\n File huffmanTreeFile = new File(huffmanFolder.getPath() + \"\\\\tree.huff\");\r\n\r\n\r\n try (FileOutputStream textCodeOS = new FileOutputStream(huffmanTextFile);\r\n FileOutputStream treeCodeOS = new FileOutputStream(huffmanTreeFile)) {\r\n\r\n\r\n// Writing text bits to file text.huff\r\n StringBuilder byteStr;\r\n while (boolQueue.size() > 0 | !boolRead) {\r\n while (boolQueue.size() > 8) {\r\n byteStr = new StringBuilder();\r\n\r\n for (int i = 0; i < 8; i++) {\r\n String s = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(s);\r\n }\r\n\r\n if (isInterrupted())\r\n break;\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n\r\n if (fileRead && boolQueue.size() > 0) {\r\n lastBitsCount = boolQueue.size();\r\n byteStr = new StringBuilder();\r\n for (int i = 0; i < lastBitsCount; i++) {\r\n String bitStr = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(bitStr);\r\n }\r\n\r\n for (int i = 0; i < 8 - lastBitsCount; i++) {\r\n byteStr.append(\"0\");\r\n }\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n }\r\n\r\n\r\n// Writing the info for decoding to tree.huff\r\n// Writing last bits count to tree.huff\r\n treeCodeOS.write((byte)lastBitsCount);\r\n\r\n// Writing info for Huffman tree to tree.huff\r\n StringBuilder treeBitsArray = new StringBuilder();\r\n treeBitsArray.append(\r\n parser.parseByteToBinaryString(\r\n (byte) codesMap.size()));\r\n\r\n codesMap.keySet().forEach(key -> {\r\n String keyBits = parser.parseByteToBinaryString((byte) (char) key);\r\n String valCountBits = parser.parseByteToBinaryString((byte) codesMap.get(key).length());\r\n\r\n treeBitsArray.append(keyBits);\r\n treeBitsArray.append(valCountBits);\r\n treeBitsArray.append(codesMap.get(key));\r\n });\r\n if ((treeBitsArray.length() / 8) != 0) {\r\n int lastBitsCount = boolQueue.size() / 8;\r\n for (int i = 0; i < 7 - lastBitsCount; i++) {\r\n treeBitsArray.append(\"0\");\r\n }\r\n }\r\n\r\n for (int i = 0; i < treeBitsArray.length() / 8; i++) {\r\n treeCodeOS.write(parser.parseStringToByte(\r\n treeBitsArray.substring(8 * i, 8 * (i + 1))));\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public HuffmanNode(int freq){\r\n this(freq, null, null);\r\n }",
"public static <KEY extends java.lang.Comparable<KEY>, ITEM> BinomialTree<KEY, ITEM> CombinePair (\n\t\tfinal BinomialTree<KEY, ITEM> binomialTree1,\n\t\tfinal BinomialTree<KEY, ITEM> binomialTree2,\n\t\tfinal boolean minHeap)\n\t{\n\t\tif (null == binomialTree1 || null == binomialTree2)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tint order = binomialTree1.order();\n\n\t\tif (order != binomialTree2.order())\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tBinomialTree<KEY, ITEM> upTree = null;\n\t\tBinomialTree<KEY, ITEM> downTree = null;\n\t\tBinomialTree<KEY, ITEM> combinedTree = null;\n\n\t\tKEY key1 = binomialTree1.entry().key();\n\n\t\tKEY key2 = binomialTree2.entry().key();\n\n\t\tif (minHeap)\n\t\t{\n\t\t\tif (-1 != key1.compareTo (\n\t\t\t\tkey2\n\t\t\t))\n\t\t\t{\n\t\t\t\tupTree = binomialTree2;\n\t\t\t\tdownTree = binomialTree1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tupTree = binomialTree1;\n\t\t\t\tdownTree = binomialTree2;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (-1 != key1.compareTo (\n\t\t\t\tkey2\n\t\t\t))\n\t\t\t{\n\t\t\t\tupTree = binomialTree1;\n\t\t\t\tdownTree = binomialTree2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tupTree = binomialTree2;\n\t\t\t\tdownTree = binomialTree1;\n\t\t\t}\n\t\t}\n\n\t\tjava.util.List<BinomialTree<KEY, ITEM>> meldedChildren =\n\t\t\tnew java.util.ArrayList<BinomialTree<KEY, ITEM>>();\n\n\t\tjava.util.List<BinomialTree<KEY, ITEM>> upChildren = upTree.children();\n\n\t\tif (null != upChildren)\n\t\t{\n\t\t\tint upChildrenCount = upChildren.size();\n\n\t\t\tfor (int meldedChildIndex = 0;\n\t\t\t\tmeldedChildIndex < upChildrenCount;\n\t\t\t\t++meldedChildIndex)\n\t\t\t{\n\t\t\t\tmeldedChildren.add (\n\t\t\t\t\tupChildren.get (\n\t\t\t\t\t\tmeldedChildIndex\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tmeldedChildren.add (\n\t\t\tdownTree\n\t\t);\n\n\t\ttry\n\t\t{\n\t\t\tcombinedTree = new BinomialTree<KEY, ITEM> (\n\t\t\t\tnew org.drip.graph.heap.PriorityQueueEntry<KEY, ITEM> (\n\t\t\t\t\tupTree.entry().key(),\n\t\t\t\t\tupTree.entry().item()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tcatch (java.lang.Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\treturn combinedTree.setChildren (\n\t\t\tmeldedChildren\n\t\t) && downTree.setParent (\n\t\t\tcombinedTree\n\t\t) ? combinedTree : null;\n\t}",
"private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}",
"public BinaryHeap() {\n }",
"private void grow() {\n int oldCapacity = heap.length;\n // Double size if small; else grow by 50%\n int newCapacity = oldCapacity + ((oldCapacity < 64) ?\n (oldCapacity + 2) :\n (oldCapacity >> 1));\n Object[] newQueue = new Object[newCapacity];\n for (int i = 0; i < heap.length; i++) {\n newQueue[i] = heap[i];\n }\n heap = newQueue;\n }",
"public PriorityQueue() {\n\t\theap = new ArrayList<Pair<Integer, Integer>>();\n\t\tlocation = new HashMap<Integer, Integer>();\n\t}",
"public HuffmanCode(int[] frequencies) {\n Queue<HuffmanNode> nodeFrequencies = new PriorityQueue<HuffmanNode>();\n for (int i = 0; i < frequencies.length; i++) {\n if (frequencies[i] > 0) {\n nodeFrequencies.add(new HuffmanNode(frequencies[i], (char) i));\n }\n }\n nodeFrequencies = ArrayHuffmanCodeCreator(nodeFrequencies);\n this.front = nodeFrequencies.peek();\n }",
"public HuffmanTreeNode deleteFromHeapAt(int index) {\n\t\tHuffmanTreeNode[] heap = swap(this.getHuffmanHeap(), index, this.getHuffmanHeap().length - 1);\n\t\tHuffmanTreeNode deletedNode = heap[heap.length - 1];\n\t\tHuffmanTreeNode[] newHeap = new HuffmanTreeNode[heap.length - 1];\n\t\n\t\tfor (int i = 0; i < newHeap.length; i++)\n\t\t\tnewHeap[i] = heap[i];\n\t\t\n\t\tnewHeap = heapSort(newHeap);\n\t\tthis.setHuffmanHeap(newHeap);\n\t\t\n\t\treturn deletedNode;\n\t}",
"public void arrayToHeap(int[] array) {\r\n\t\tHeapTreesArray = new HeapNode[32];\r\n\t\tthis.min = null;\r\n\t\tthis.size = 0;\r\n\t\tthis.empty = true;\r\n\t\tfor (int i : array) {\r\n\t\t\tinsert(i);\r\n\t\t}\r\n\t}",
"protected void heapify(int i) {\n \tE temp;\n\t\tE left = null;\n\t\tE right = null;\n\t\tE current = internal[i];\n\n\t\tif(left(i) < heapSize) left = internal[left(i)];\n\t\tif(right(i) < heapSize ) right = internal[right(i)];\n\n\t\tif(left != null && right != null){\n\t\t\tif(compy.compare(current, right) < 0 && compy.compare(current, left) < 0){\n\t\t\t\ttemp = current;\n\t\t\t\tif(compy.compare(right, left) < 0){\n\t\t\t\t\tinternal[i] = left;\n\t\t\t\t\tinternal[left(i)] = temp;\n\t\t\t\t\theapify(left(i));\n\t\t\t\t}else{\n\t\t\t\t\tinternal[i] = right;\n\t\t\t\t\tinternal[right(i)] = temp;\n\t\t\t\t\theapify(right(i));\n\t\t\t\t}\n\t\t\t}else if(compy.compare(current, left) < 0){\n\t\t\t\ttemp = current;\n\t\t\t\tinternal[i] = internal[left(i)];\n\t\t\t\tinternal[left(i)] = temp;\n\t\t\t\theapify(left(i));\n\t\t\t}else if(compy.compare(current, right) < 0){\n\t\t\t\ttemp = current;\n\t\t\t\tinternal[i] = internal[right(i)];\n\t\t\t\tinternal[right(i)] = temp;\n\t\t\t\theapify(right(i));\n\t\t\t}\n\t\t}else if(left != null){\n\t\t\tif(compy.compare(current, left) < 0){\n\t\t\t\ttemp = current;\n\t\t\t\tinternal[i] = internal[left(i)];\n\t\t\t\tinternal[left(i)] = temp;\n\t\t\t\theapify(left(i));\n\t\t\t}\n\t\t}else if(right != null){\n\t\t\tif(compy.compare(current, right) < 0){\n\t\t\t\ttemp = current;\n\t\t\t\tinternal[i] = internal[right(i)];\n\t\t\t\tinternal[right(i)] = temp;\n\t\t\t\theapify(right(i));\n\t\t\t}\n\t\t}\n }",
"public Heap(int capacity) {\n\t\t this.capacity = capacity;\n\t\t data = new Integer[this.capacity];\t\n\t\t size = 0;\n\t }"
] | [
"0.7785362",
"0.7686242",
"0.74033266",
"0.73194766",
"0.70434946",
"0.7041031",
"0.68021464",
"0.669262",
"0.65665317",
"0.6544264",
"0.65233743",
"0.647479",
"0.63621676",
"0.62978286",
"0.6292996",
"0.6279537",
"0.62768835",
"0.61728966",
"0.61571157",
"0.6022622",
"0.6019989",
"0.59941876",
"0.5953535",
"0.5932267",
"0.589167",
"0.5832697",
"0.58269256",
"0.58227825",
"0.5822405",
"0.5792285",
"0.57625985",
"0.57477796",
"0.5728261",
"0.5727067",
"0.57269305",
"0.5724591",
"0.5719577",
"0.56560594",
"0.55955195",
"0.5585145",
"0.5558136",
"0.5554949",
"0.5508961",
"0.5469469",
"0.5421052",
"0.54202944",
"0.5408254",
"0.53968203",
"0.5391591",
"0.538988",
"0.53817075",
"0.5378691",
"0.53661186",
"0.5345007",
"0.5344153",
"0.5330888",
"0.5330166",
"0.5326363",
"0.53009146",
"0.5292876",
"0.5274565",
"0.52688044",
"0.5261858",
"0.52537763",
"0.52283436",
"0.5219148",
"0.5214596",
"0.5211008",
"0.520882",
"0.51984686",
"0.5192148",
"0.51909506",
"0.51841575",
"0.5176951",
"0.5166914",
"0.51633304",
"0.5152771",
"0.51462686",
"0.5139862",
"0.51358587",
"0.5129628",
"0.5129615",
"0.5127243",
"0.51113755",
"0.51091075",
"0.5092082",
"0.5088626",
"0.5085386",
"0.50812274",
"0.5080088",
"0.50709295",
"0.5070236",
"0.5063288",
"0.5061562",
"0.505714",
"0.5044944",
"0.50403017",
"0.5036703",
"0.50307274",
"0.5014872"
] | 0.79383606 | 0 |
Creating a new Element for each of the 256 possible bit patterns (represented as an int) and inserts it into the PQHeap. | private PQHeap makeQueue(){
PQHeap queue = new PQHeap(frequency.length);
for (int i = 0; i < frequency.length; i++) {
queue.insert(new Element(frequency[i], new HuffmanTempTree(i)));
}
return queue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public HeapIntPriorityQueue() {\n elementData = new int[10];\n size = 0;\n }",
"public PriorityQueue(int size){\n heap = new Element[size];\n }",
"void insert(int ele){\n if(heapLen>=A.length)\n {\n System.out.println(\"Heap is full\");\n }\n else\n {\n A[heapLen] = 1<< 31;\n heapLen++;\n increaseKey(heapLen, ele);\n \n \n }\n }",
"public FourCacheHeap(ArrayList<HuffManEntry> input) {\n\t\tthis(input.size());\n\t\taddAll(input);\n\t}",
"public void makeHeap() {\r\n\t\t//for (int i = (theHeap.size() >> 1) - 1; i >= 0; i--) {\r\n\t\tfor (int i = (theHeap.size() - 1) >> 1; i >= 0; i--) {\r\n\t\t\tsiftDown(i);\r\n\t\t}\r\n\t}",
"public PriorityQueue(int initialCapacity, HeapType type) {\n super(PriorityQueueElement.class, initialCapacity, type);\n elementsMap = new HashMap<V, PriorityQueueElement<P, V>>();\n }",
"public Heap(int capacity) {\n\t\t this.capacity = capacity;\n\t\t data = new Integer[this.capacity];\t\n\t\t size = 0;\n\t }",
"public BinaryHeap(E[] objects) {\n for(int i = 0; i < objects.length; i++) {\n add(objects[i]);\n }\n }",
"public Heap12()\n {\n arrayList = new ArrayList<E>(5);\n size = 0;\n isMax = false;\n cap = 5;\n }",
"public ArrayHeapMinPQ() {\n heapArray = new ArrayList<>();\n itemMap = new HashMap<>();\n heapArray.add(null); //alway set index 0 null and heap starts from index 1.\n nextIndex = 1;\n }",
"public PriorityQueue() {\n\t\theap = new ArrayList<Pair<Integer, Integer>>();\n\t\tlocation = new HashMap<Integer, Integer>();\n\t}",
"private void init() {\n _capacity = 1 << 9;\n int holderSize = _capacity << 1;\n _keyValueHolder = new int[holderSize];\n _mask = holderSize - 1;\n _maxNumEntries = (int) (_capacity * LOAD_FACTOR);\n }",
"public void buildHeap() {\n\t\tthis.makeComplete();\n\t\tfor(int i = this.size/2; i >= 1; i--)\n\t\t\tthis.heapify(i);\n\t}",
"public HeapPriorityQueue(int size)\n\t{\n\t\tstorage = new Comparable[size + 1];\n\t\tcurrentSize = 0;\n\t}",
"public static Object PQ_insert(Object... arg) {\nUNSUPPORTED(\"etrjsq5w49uo9jq5pzifohkqw\"); // int\nUNSUPPORTED(\"5eeaexrm7pigm7t9d73aqaaht\"); // PQ_insert(snode* np)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"7d2tojz8u1bqjo7uhe2jqz8ks\"); // if (PQcnt == PQsize) {\nUNSUPPORTED(\"1fnwaiyzr5fvurskinr46kklp\"); // agerr (AGERR, \"Heap overflow\\n\");\nUNSUPPORTED(\"bur99ge8gwr5q0vyjwjyk8z3b\"); // return (1);\nUNSUPPORTED(\"7ijd6pszsxnoopppf6xwo8wdl\"); // }\nUNSUPPORTED(\"d8u0aq1g7mc9qslpfsw3o3ezz\"); // PQcnt++;\nUNSUPPORTED(\"8f54fbv0205j58hpu3uq3i2ow\"); // pq[PQcnt] = np;\nUNSUPPORTED(\"f4e1yfpgiak6lx72g6gk4nyi0\"); // PQupheap (PQcnt);\nUNSUPPORTED(\"a7h72yd6f22ezx8o0izfoyyzl\"); // PQcheck();\nUNSUPPORTED(\"bid671dovx1rdiquw5vm3fttj\"); // return 0;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}",
"@Test\n\tpublic void testInsert() {\n\t\tHeap heap = new Heap(testArrayList.length + 1);\n\t\tdouble[] expected = new double[] { 1, 3, 24, 5, 15, 48, 32, 7, 36, 27, 38, 70, 53, 33, 93, 47 };\n\t\theap.build(testArrayList);\n\t\theap.insert(1);\n\t\tassertEquals(16, heap.getSize());\n\t\tassertArrayEquals(expected, heap.getKeyArray());\n\t}",
"public HeapPriorityQueue () \n\t{\n\t\tthis(DEFAULT_SIZE);\n\t}",
"private static long makeQueueElement(int value, int index)\n {\n return index | (((long) value) << 32);\n }",
"public HeapSet (int initialCapacity) {\r\n\t\tsuper (initialCapacity);\r\n\t}",
"public BinaryHeap(int maxCapacity) {\n\tpq = new Comparable[maxCapacity];\n\tsize = 0;\n }",
"@Override\n public void insert(int element) {\n if (isFull()) {\n throw new IllegalStateException(\"Heap is full.\");\n }\n\n // Percolate up\n usedSize++;\n heap[heapSize++] = element; // insert element\n heapifyUp(heapSize - 1);\n\n // Percolate down (doesn't work)\n //usedSize++;\n //heap[heapSize++] = element;\n //heapifyDown(heapSize - 1);\n }",
"private boolean buildHeap(int numPerRun){ \n\t\tTuple temp;\n\t\tint i = 0;\n\t\twhile(i < numPerRun && (temp = child.getNextTuple()) != null) {\n\t\t\tinternal.offer(temp);\n\t\t\ti++;\n\t\t}\n//\t\tSystem.out.println(\"internal heap has: \" + i + \"tuples\");\n\t\tif(i != numPerRun || i == 0) { // i == 0, heap is empty!\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public BinHeap()\n {\n // allocate heap to hold 100 items\n arr = (T[]) new Comparable[100];\n // set size of heap to 0\n size = 0;\n }",
"public static Object PQupheap(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"5hhoge8azwixhuw1r6f1ae6d\"); // PQupheap(int k)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"7e1sq1127wt16hr7o0andcwob\"); // snode* x = pq[k];\nUNSUPPORTED(\"7bfu0p9xmzkty10xv4n4l5cqs\"); // int v = x->n_val;\nUNSUPPORTED(\"1j1bbq23z0qzohezignztjo66\"); // int next = k/2;\nUNSUPPORTED(\"ae5pat4mp4l6k25pvk8saz8c7\"); // snode* n;\nUNSUPPORTED(\"70492o1szwz9au93c3is2goa\"); // while ((n = pq[next])->n_val < v) {\nUNSUPPORTED(\"4i53ezzk69bsmpugd2h8bo35\"); // pq[k] = n;\nUNSUPPORTED(\"iolnc8pg22pbme3zbdim1eqy\"); // (n)->n_idx = k;\nUNSUPPORTED(\"8fpdpgwovt0k58t5u167v63is\"); // k = next;\nUNSUPPORTED(\"eqtnhenyor3dwsa6on9crthdd\"); // next /= 2;\nUNSUPPORTED(\"7ijd6pszsxnoopppf6xwo8wdl\"); // }\nUNSUPPORTED(\"1lxwoekai0i8v3rg0vrg6ahmx\"); // pq[k] = x;\nUNSUPPORTED(\"7ss0wudteh17yswf0ihopig7z\"); // (x)->n_idx = k;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}",
"public MinHeap() {\n\tdata = new ArrayList<Integer>();\n\t}",
"Queue() {\r\n\t\telements = new int[DEFAULT_CAPACITY];\r\n\t}",
"public PriorityQueue()\r\n\t{\r\n\t\tcurrentSize = 0;\r\n\t\tlowestCurrentPriority = Integer.MAX_VALUE;\r\n\t\tpq = new DLL[MAXIMUM_PRIORITY + 1];\r\n\t\tfor (int i = 0; i < pq.length; i++)\r\n\t\t{\r\n\t\t\tpq[i] = new DLL();\r\n\t\t}\r\n\t}",
"private void heapify(int idx) {\r\n // TODO\r\n }",
"public WBLeftistHeapPriorityQueueFIFO() {\n\t\theap = new WBLeftistHeap<>();\n\t}",
"private void expand() {\n int capacity = newCapacity();\n IntIntMap h = new IntIntMap(capacity);\n for (int i = 0; i < entries.length; i += 2) {\n if (entries[i] != EMPTY) {\n h.put(entries[i], entries[i + 1]);\n }\n }\n this.entries = h.entries;\n this.threshold = h.threshold;\n this.modulo = h.modulo;\n this.modulo2 = h.modulo2;\n }",
"public void setPriorityQueue() {\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tif (leafEntries[i].getFrequency() > 0)\n\t\t\t\tpq.add(new BinaryTree<HuffmanData>(leafEntries[i]));\n\t\t}\n\t}",
"@Before\n public void setUpBinaryMinHeaps() {\n empty = new BinaryMinHeap<>();\n emptyArr = new ArrayList<>();\n \n multipleElements = new BinaryMinHeap<>();\n multipleElements.insert(7);\n multipleElements.insert(8);\n multipleElements.insert(5);\n multipleElements.insert(3);\n multipleElements.insert(2);\n multipleElements.insert(6);\n \n multiArr = new ArrayList<>();\n multiArr.add(2);\n multiArr.add(3);\n multiArr.add(6);\n multiArr.add(8);\n multiArr.add(5);\n multiArr.add(7);\n \n }",
"public BinaryHeap(int maxCapacity) {\n pq = new Comparable[maxCapacity];\n size = 0;\n }",
"public HeapSet () {\r\n\t\tsuper ();\r\n\t}",
"public void assign(int indice, T element) {\r\n\t\tif (theHeap.size() == 0 || indice > theHeap.size()) {\r\n\t\t\ttheHeap.add(element);\r\n\t\t} else {\r\n\t\t\ttheHeap.add(indice, element);\r\n\t\t}\r\n\t}",
"private HuffmanTreeNode[] heapify(int freq[][]) {\n\t\tHuffmanTreeNode[] heap = new HuffmanTreeNode[freq.length];\n\t\tfor (int i = 0; i < freq.length; i++)\n\t\t{\n\t\t\theap[i] = new HuffmanTreeNode(freq[i][1], freq[i][0], null, null);\n\t\t}\n\t\t\n\t\theap = heapSort(heap);\n\n\t\treturn heap;\n\t}",
"void buildHeap() {\n\tfor(int i=parent(size-1); i>=0; i--) {\n\t percolateDown(i);\n\t}\n }",
"public MaxPQ(int capacity){\n\t\tpq = (Key[]) new Object[capacity + 1];\n\t\tN = 0;\n\t}",
"public void binomialHeapInsert(Node x) {\n\t\tBinomialHeap h = new BinomialHeap();\n\t\th.head = x;\n\t\tBinomialHeap hPrime = this.binomialHeapUnion(h);\n\t\tthis.head = hPrime.head;\t\t\n\t}",
"private void resize(int newCapacity)\n {\n Node[] buffer = new Node[newCapacity];\n\n for (Node bucket : buckets)\n {\n if (bucket != null)\n {\n Node current = bucket;\n while (current != null)\n {\n int h = current.hashCode();\n h = h % buffer.length;\n if (h < 0) { h = -h; }\n\n buffer[h] = current;\n current = current.next;\n }\n }\n }\n buckets = buffer;\n }",
"private void makePrioQ()\n\t{\n\t\tprioQ = new PrioQ();\n\t\t\n\t\tfor(int i = 0; i < canonLengths.length; i++)\n\t\t{\n\t\t\tif(canonLengths[i] == 0)\n\t\t\t\tcontinue;\n\t\t\tNode node = new Node(i, canonLengths[i]);\n\t\t\tprioQ.insert(node);\n\t\t}\n\t}",
"public ArrayHeap() {\r\n capacity = 10;\r\n length = 0;\r\n heap = makeArrayOfT(capacity);\r\n }",
"public Heap() {\r\n\t\tthis(DEFAULT_INITIAL_CAPACITY, null);\r\n\t}",
"void buildHeap() {\n for (int i = parent(size - 1); i >= 0; i--) {\n percolateDown(i);\n }\n }",
"public MaxPQUnorderedImp(int capacity){\n pq = (Key[]) new Comparable[capacity];\n N = 0;\n }",
"public MinHeap() {\n// contents = new HashMap<>();\n contents= new ArrayList<>();\n backwards = new HashMap<>();\n contents = new ArrayList<>();\n contents.add(null);\n\n// contents.put(0, null);\n backwards.put(null, 0);\n// setContents = new HashSet<>();\n }",
"public ArrayHeapMinPQ() {\n aHeap.add(null);\n }",
"public Heap() {\n this.arr = new ArrayList<>();\n this.isMax = false;\n }",
"private void grow() {\n int oldCapacity = heap.length;\n // Double size if small; else grow by 50%\n int newCapacity = oldCapacity + ((oldCapacity < 64) ?\n (oldCapacity + 2) :\n (oldCapacity >> 1));\n Object[] newQueue = new Object[newCapacity];\n for (int i = 0; i < heap.length; i++) {\n newQueue[i] = heap[i];\n }\n heap = newQueue;\n }",
"public ArrayMaxPQ(int capacity) {\n pq = new int[capacity];\n }",
"public FixedSizedPriorityQueue(int elementsLeft) {\n\t\tsuper();\n\t\tthis.elementsLeft = elementsLeft;\n\t}",
"public void push(int elem);",
"public static void buildHeap(int[]data){\n for (int i = data.length-1; i>=0; i--){\n pushDown(data, data.length, i);\n }\n }",
"Heap(int[] arr){\n\t\tthis.heap = new int[arr.length+1];\n\t\tfor(int i=1; i<arr.length+1; i++) {\n\t\t\tthis.heap[i] = arr[i-1];\n\t\t}\n\t}",
"public IntPriorityQueue(int size) {\n initialize(size);\n }",
"@Test public void hpackUseCase() {\n BitArray b = new BitArray.FixedCapacity();\n for (int i = 0; i < 64; i++) {\n b.set(i);\n }\n assertTrue(b.get(0));\n assertTrue(b.get(1));\n assertTrue(b.get(63));\n try {\n b.get(64);\n fail();\n } catch (IllegalArgumentException expected) {\n }\n b = ((BitArray.FixedCapacity) b).toVariableCapacity();\n assertTrue(b.get(0));\n assertTrue(b.get(1));\n assertTrue(b.get(63));\n assertFalse(b.get(64));\n b.set(64);\n assertTrue(b.get(64));\n }",
"public void push(int priority, int element)\n\t{\n\t\tif(priority<0 || isPresent(element)){\n\t\t\tthrow new AssertionError();\n\t\t}\n\t\tPair newElement = new Pair<>(priority, element);\n\t\theap.add(newElement);\n\t\t//moves to correct position in heap and saves location\n\t\tint loc = percolateUpLeaf();\n\t\tlocation.put(element, loc);\n\t}",
"public PriorityQueue(HeapType type) {\n this(-1, type);\n }",
"@Override\n public void push(int value) {\n Entry newElement = new Entry(value);\n if (size == 0) {\n first = newElement;\n last = newElement;\n } else {\n first.previous = newElement;\n newElement.next = first;\n first = newElement;\n }\n size++;\n }",
"public Heap(Comparator<? super E> comp){\n super(7, comp);\n }",
"public HashTable(int size){\n\n arraySize = size;\n hashArray = new Elements[arraySize];\n nullement = new Elements(\" -1 \"); \n }",
"public HeapImp() {\n\t\tthis(10000);\n\t}",
"@Override\n public void addElement(T element) {\n // TODO. \n // Pseudocode: \n // Check if array is at capacity, if so expand it. \n // add element to the array\n // increment count\n // if this is not the first element, then call heapifyAdd to check if the newly added\n // element needs to be swapped up the heap\n if (count == heap.length) {\n expandCapacity();\n\n }\n heap[count] = element;\n count++;\n\n if (count > 1) {\n heapifyAdd();\n }\n\n }",
"private HuffmanTempTree makeTree() {\n \tPQHeap queue = makeQueue();\n \tfor (int i = 0; i < frequency.length - 1; i++) {\n \t\tHuffmanTempTree zTree = new HuffmanTempTree(0);\n \t\tElement x = queue.extractMin();\n \t\tElement y = queue.extractMin();\n \t\tint zFreq = x.key + y.key;\n \t\tzTree.merge((HuffmanTempTree) x.data, (HuffmanTempTree) y.data);\n \t\tqueue.insert(new Element(zFreq, zTree));\n \t}\n \treturn (HuffmanTempTree) queue.extractMin().data;\n \t}",
"private void growQueue() {\n Runnable[] oldQ = queue;\n int oldSize = oldQ.length;\n int newSize = oldSize << 1;\n if (newSize > MAXIMUM_QUEUE_CAPACITY)\n throw new RejectedExecutionException(\"Queue capacity exceeded\");\n Runnable[] newQ = queue = new Runnable[newSize];\n\n int b = base;\n int bf = b + oldSize;\n int oldMask = oldSize - 1;\n int newMask = newSize - 1;\n do {\n int oldIndex = b & oldMask;\n Runnable t = oldQ[oldIndex];\n if (t != null && !casSlotNull(oldQ, oldIndex, t))\n t = null;\n setSlot(newQ, b & newMask, t);\n } while (++b != bf);\n pool.signalWork();\n }",
"public Heap(int maxSize, int[] _dist, int[] _hPos) \r\n {\r\n N = 0;\r\n h = new int[maxSize + 1];\r\n dist = _dist;\r\n hPos = _hPos;\r\n }",
"DS (int size) {sz = size; p = new int [sz]; for (int i = 0; i < sz; i++) p[i] = i; R = new int[sz];}",
"public void addTo(Integer element, int i)\n\t\t{buckets.get(i).add(element);}",
"public void insertToBucket()\n {\n int value = 0;\n value = valueCheck(value);\n \n //inserts value in the array to the buckets\n if(value == 0)\n {\n zero.add(a[k]);\n a[k] = 0;\n }\n if(value == 1)\n {\n one.add(a[k]);\n a[k] = 0;\n }\n if(value == 2)\n {\n two.add(a[k]);\n a[k] = 0;\n }\n if(value == 3)\n {\n three.add(a[k]);\n a[k] = 0;\n }\n if(value == 4)\n {\n four.add(a[k]);\n a[k] = 0;\n }\n if(value == 5)\n {\n five.add(a[k]);\n a[k] = 0;\n }\n if(value == 6)\n {\n six.add(a[k]);\n a[k] = 0;\n }\n if(value == 7)\n {\n seven.add(a[k]);\n a[k] = 0;\n }\n if(value == 8)\n {\n eight.add(a[k]);\n a[k] = 0;\n }\n if(value == 9)\n {\n nine.add(a[k]);\n a[k] = 0;\n }\n \n k++;\n }",
"public Heap(int initialCapacity) {\r\n\t\tthis(initialCapacity, null);\r\n\t}",
"public static void main(String[] args) {\n\r\n\t\tint [][] arr = new int[][] {\r\n\t\t\t{8,9,10,12},\r\n\t\t\t{2,5,9,12},\r\n\t\t\t{3,6,10,11},\r\n\t\t\t{1,4,7,8}\r\n\t\t};\t\t\r\n\t\t\r\n\t\tPriorityQueue<HeapNode> heap = new PriorityQueue<>();\r\n\t\tfor(int i=0;i<arr.length;i++)\r\n\t\t{\r\n\t\t\theap.offer(new HeapNode(arr[i][0], i, 0));\r\n\t\t}\r\n\t\tint count=0;\r\n\t\twhile(count<16)\r\n\t\t{\r\n\t\t\tHeapNode min = heap.poll();\r\n\t\t\tSystem.out.println(min.value);\r\n\t\t\tcount++;\r\n\t\t\tint value=0;\r\n\t\t\tint nextIndex=min.index+1;\r\n\t\t\tif(nextIndex < arr[min.k].length)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tvalue=arr[min.k][nextIndex];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvalue=Integer.MAX_VALUE;\r\n\t\t\t}\r\n\t\t\theap.offer(new HeapNode(value, min.k, nextIndex));\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public Ch705DesignHashset() {\n data = new LinkedList[BASE];\n for (int i = 0; i < BASE; ++i) {\n data[i] = new LinkedList<Integer>();\n }\n }",
"public void generate()\n {\n System.out.println(\"Initial allocated space for Set: Not supported\");\n// System.out.println(\"Initial allocated space for Set: \" + theMap.capacity());\n final long startTime = TimeUtils.nanoTime();\n Mnemonic m = new Mnemonic(123456789L);\n// GridPoint2 gp = new GridPoint2(0, 0);\n for (int x = -width; x < width; x++) {\n for (int y = -height; y < height; y++) {\n// for (int z = -height; z < height; z++) {\n\n// long z = (x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL);\n// z = ((z & 0x00000000ffff0000L) << 16) | ((z >>> 16) & 0x00000000ffff0000L) | (z & 0xffff00000000ffffL);\n// z = ((z & 0x0000ff000000ff00L) << 8 ) | ((z >>> 8 ) & 0x0000ff000000ff00L) | (z & 0xff0000ffff0000ffL);\n// z = ((z & 0x00f000f000f000f0L) << 4 ) | ((z >>> 4 ) & 0x00f000f000f000f0L) | (z & 0xf00ff00ff00ff00fL);\n// z = ((z & 0x0c0c0c0c0c0c0c0cL) << 2 ) | ((z >>> 2 ) & 0x0c0c0c0c0c0c0c0cL) | (z & 0xc3c3c3c3c3c3c3c3L);\n// z = ((z & 0x2222222222222222L) << 1 ) | ((z >>> 1 ) & 0x2222222222222222L) | (z & 0x9999999999999999L);\n// theMap.put(z, null); // uses 23312536 bytes of heap\n// long z = szudzik(x, y);\n// theMap.put(z, null); // uses 18331216 bytes of heap?\n// unSzudzik(pair, z);\n// theMap.put(0xC13FA9A902A6328FL * x ^ 0x91E10DA5C79E7B1DL * y, null); // uses 23312576 bytes of heap\n// theMap.put((x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL), null); // uses 28555456 bytes of heap\n theMap.add(new Vector2(x - width * 0.5f, y - height * 0.5f)); // crashes out of heap with 720 Vector2\n// gp.set(x, y);\n// theMap.add(gp.hashCode());\n// long r, s;\n// r = (x ^ 0xa0761d65L) * (y ^ 0x8ebc6af1L);\n// s = 0xa0761d65L * (z ^ 0x589965cdL);\n// r -= r >> 32;\n// s -= s >> 32;\n// r = ((r ^ s) + 0xeb44accbL) * 0xeb44acc8L;\n// theMap.add((int)(r - (r >> 32)));\n\n// theMap.add(m.toMnemonic(szudzik(x, y)));\n }\n }\n// }\n// final GridPoint2 gp = new GridPoint2(x, y);\n// final int gpHash = gp.hashCode(); // uses the updated GridPoint2 hashCode(), not the current GDX code\n// theMap.put(gp, gpHash | 0xFF000000); //value doesn't matter; this was supposed to test ObjectMap\n //theMap.put(gp, (53 * 53 + x + 53 * y) | 0xFF000000); //this is what the hashCodes would look like for the current code\n \n //final int gpHash = x * 0xC13F + y * 0x91E1; // updated hashCode()\n //// In the updated hashCode(), numbers are based on the plastic constant, which is\n //// like the golden ratio but with better properties for 2D spaces. These don't need to be prime.\n \n //final int gpHash = 53 * 53 + x + 53 * y; // equivalent to current hashCode()\n long taken = TimeUtils.timeSinceNanos(startTime);\n System.out.println(taken + \"ns taken, about 10 to the \" + Math.log10(taken) + \" power.\");\n// System.out.println(\"Post-assign allocated space for Set: \" + theMap.capacity());\n System.out.println(\"Post-assign allocated space for Set: Not supported\");\n }",
"AdaptiveProbMap(int n, int rate) \n {\n this.rate = rate;\n this.data = new int[n*33];\n\n for (int i=0, k=0; i<n; i++, k+=33)\n {\n for (int j=0; j<33; j++)\n this.data[k+j] = (i == 0) ? Global.squash((j-16)<<7) << 4 : this.data[j];\n }\n }",
"public AssistantsHeap(int assistants)\n\t{\t\t\n\t\tthis.assistants = assistants;\n\t}",
"public MinHeap(){\r\n nextAvail = 1;\r\n }",
"public void heapInsert(int key) throws Exception{\n\t\tn = n+1;\n\t\tint[] newArray = new int[n];\n\t\tfor(int i = 0; i< a.length; i++){\n\t\t\tnewArray[i] = a[i];\n\t\t}\n\t\tnewArray[n-1] = Integer.MIN_VALUE;\n\t\tthis.a = newArray;\n\t\theapIncreaseKey(n-1,key);\n\t}",
"private void heapify(T[] array) \n\t{\n\t\tfor (int i=0; i < array.length; i++)\n\t\t{\n\t\t\tinsert(array[i], i);\n\t\t}\n\t}",
"public MaxHeap() {\n this(64);\n }",
"private void expandCapacity() {\n heap = Arrays.copyOf(heap, heap.length * 2);\n }",
"void genPromote(Collection ret, int from, int to, int bits) {\n\tfor (char i = KNIGHT; i <= QUEEN; ++i) {\n\tBouger g = new Bouger(from, to, i, (bits | 32), 'P');\n\tg.setScore(1000000 + (i * 10));\n\tret.add(g);\n\t}\n\t}",
"public void heapify(int[] A) {\n int len = A.length;\n int temp;\n //构建堆\n for (int i = len / 2 - 1; i >= 0; i--) {\n keepSmallHeap(A, i, len);\n }\n }",
"public MinPriorityQueue(int cap)\r\n {\r\n heap = (Item[]) new Comparable[cap+1]; // reservamos un espacio adicional\r\n // para el dummy en la posicion 0\r\n size = 0;\r\n }",
"@Test\n public void testInsertAndSize() {\n this.iPQ.insert(1);\n assertEquals(\"Integer PQHeap size is: \",\n 1, this.iPQ.size());\n }",
"public int insert(int data)\n {\n boolean inserted = false;\n int position;\n int currentValue;\n int moves = 0;\n resized = false;\n currentHash = 1;\n\n if(data == 0)\n return -1; // invalid value\n\n if(contains(data))\n return -1;\n\n // Check if threshold would be reached\n if((numElements+1.0)/(2.0*n) >= threshold)\n {\n resize();\n resized = true;\n }\n\n elements.add(data);\n\n while(!inserted)\n {\n position = doHash(data);\n currentValue = getArrayValue(position);\n if(currentValue == 0)\n {\n setArrayValue(position, data);\n inserted = true;\n numElements++;\n }\n else\n {\n setArrayValue(position,data);\n data = currentValue;\n switchHashAndArray();\n moves += 1;\n }\n if(moves >= chainLength)\n {\n resize();\n resized = true;\n moves = 0;\n }\n\n }\n\n return data;\n\n }",
"public PriorityQueue()\n {\n // initialise instance variables\n heap = new PriorityCustomer[100];\n size = 0;\n }",
"@Test\n\tpublic void testHeapify() {\n\t\tHeap heap = new Heap(testArrayList);\n\t\theap.heapify(0);\n\t\tArrayList<Integer> expected = new ArrayList<>(\n\t\t\t\tArrays.asList(3, 5, 33, 36, 15, 70, 24, 47, 7, 27, 38, 48, 53, 32, 93));\n\t\tassertEquals(expected, heap.getHeapArray());\n\t}",
"public MyHashMap() {\n map = new ArrayList<>();\n for (int i = 0;i<255;i++)\n map.add(new Entry());\n }",
"public VectorHeapb()\n\t// post: constructs a new priority queue\n\t{\n\t\tdata = new Vector<E>();\n\t}",
"public PriorityQueue(int capacity) { \r\n this.capacity=capacity;\r\n this.currentSize=0;\r\n this.queue=new NodeBase[capacity];\r\n }",
"public void arrayToHeap(int[] array) {\r\n\t\tHeapTreesArray = new HeapNode[32];\r\n\t\tthis.min = null;\r\n\t\tthis.size = 0;\r\n\t\tthis.empty = true;\r\n\t\tfor (int i : array) {\r\n\t\t\tinsert(i);\r\n\t\t}\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n void expand()\n {\n // Remember the old table.\n Object[] old = this.buckets;\n\n // Figure out the capacity of the new table, making it somewhat\n // unpredictable.\n int newCapacity = 2 * this.buckets.length + rand.nextInt(10);\n\n // Create a new table of that capacity.\n this.buckets = new Object[newCapacity];\n\n // Reset the size since we'll be adding elements in a moment.\n this.size = 0;\n\n // Move all the values from the old table to their appropriate\n // location in the new table.\n for (int i = 0; i < old.length; i++)\n {\n AssociationList<K, V> bucket = (AssociationList<K, V>) old[i];\n if (bucket != null)\n {\n AssociationList<K, V>.Node current = bucket.front.next;\n while (current != null)\n {\n this.set(current.key, current.value);\n current = current.next;\n } // while\n } // if (bucket != null)\n } // for\n }",
"public static void insertHeap(int x)\n {\n if(s.isEmpty()){\n s.add(x);\n }\n else if(x>s.peek()){\n g.add(x);\n }\n else if(g.isEmpty()){\n g.add(s.poll());\n s.add(x);\n }\n else {\n s.add(x);\n }\n balanceHeaps();\n \n }",
"private static void buildHeap(int arr[], int n) \n\t\t{\n\t\t\tfor(int i=n;i>=0;i++)\n\t\t\t\theapify(arr,n,i);\n\t\t\t\n\t\t}",
"public static int elementSizeBits_entries_id() {\n return 8;\n }",
"public HeapCacheBuilder() {\n this.name = \"imcache-heap-cache-\" + cacheNumber.incrementAndGet();\n }",
"void push(int element);",
"public BetterParkingLot( int size )\n\t{\n\t\tsuper(size);\n queue = new PriorityQueue<Integer>(size);\n\n // add all available parking slots in zero-indexed form\n for(int i=0; i <= size; i++) // this is my only problem. It HAS to be O(n) here.\n queue.add(i);\n\t}",
"void enqueue(int x, int p){\n for(int i=0;i<size;i++){\n if(values[i]==(-1)){\n values[i] = x;\n priorities[i] = p;\n break;\n }\n }\n }",
"public void loadInitQueue() {\n\t\t// go through every character\n\t\tfor (int i = 0; i < frequencyCount.length; i++) { \n\t\t\t// check to see if it has appeared at least once.\n\t\t\tif (frequencyCount[i] != 0) { \n\t\t\t\t// if so, make a tree for it and add it to the priority queue.\n\t\t\t\tCS232LinkedBinaryTree<Integer, Character> curTree = new CS232LinkedBinaryTree<Integer, Character>();\n\t\t\t\tcurTree.add(frequencyCount[i], (char) i);\n\t\t\t\thuffBuilder.add(curTree);\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.6559816",
"0.5847551",
"0.5825631",
"0.57383686",
"0.56036854",
"0.5598112",
"0.5549415",
"0.55398476",
"0.5507131",
"0.5453983",
"0.54534876",
"0.54003763",
"0.5384657",
"0.538135",
"0.53736067",
"0.53734726",
"0.53650314",
"0.53271466",
"0.5323979",
"0.5310369",
"0.5294233",
"0.529314",
"0.5283376",
"0.5274467",
"0.52604795",
"0.52602094",
"0.5252492",
"0.5231811",
"0.52137667",
"0.52088577",
"0.5208495",
"0.5200943",
"0.5181789",
"0.51680124",
"0.5161496",
"0.51581645",
"0.5155734",
"0.51478344",
"0.5137673",
"0.5131368",
"0.51173925",
"0.5110591",
"0.5108651",
"0.5108005",
"0.51073396",
"0.5100502",
"0.50976723",
"0.50955266",
"0.5090463",
"0.5088236",
"0.50718653",
"0.5070028",
"0.506334",
"0.5063106",
"0.5049397",
"0.5046076",
"0.50373966",
"0.5031627",
"0.50283",
"0.50236595",
"0.5018239",
"0.5003239",
"0.4998035",
"0.49972734",
"0.49873814",
"0.4984472",
"0.49843",
"0.49736682",
"0.49726334",
"0.49711886",
"0.49631396",
"0.49615955",
"0.49608853",
"0.49549282",
"0.4949745",
"0.4932036",
"0.4930369",
"0.4929606",
"0.4928077",
"0.49235532",
"0.49168754",
"0.4913869",
"0.4911265",
"0.49109682",
"0.49042878",
"0.4904095",
"0.4893215",
"0.48868102",
"0.4886803",
"0.48855883",
"0.48813352",
"0.48779467",
"0.48766553",
"0.4873098",
"0.48681733",
"0.48653448",
"0.48602372",
"0.48595703",
"0.48572272",
"0.48566762"
] | 0.6480918 | 1 |
removeProperty Adds a source to the link. | public boolean addSource(Entity source) {
boolean result = IServer.associationHasSource().add(this, source);
IServer.fireLinkUpdated(new LinkEvent(this));
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteProperties(String sourceInstance, String property)\r\n\t{\r\n\t\tOntResource si = this.obtainOntResource(sourceInstance);\r\n\t\tProperty prop = this.obtainOntProperty(property);\r\n\t\tsi.removeAll(prop);\r\n\t}",
"public void unsetSource()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(SOURCE$30);\n }\n }",
"public NameValue<String, String> removeSourceURL() {\n return removeURL(mSourceMap);\n }",
"public boolean removeSource(Entity source) {\r\n boolean result = IServer.associationHasSource().remove(this, source);\r\n IServer.fireLinkUpdated(new LinkEvent(this));\r\n return result;\r\n }",
"private void removeSource(String sourceName) {\n\t\t\n\t}",
"void relRemoveProperty( long relId, int propertyKey );",
"public void removeProperty(TLProperty element);",
"void graphRemoveProperty( int propertyKey );",
"void removeSource(McastRoute route, HostId source);",
"public void deleteOntProperty(String sourceInstance, String property, String destInstance)\r\n\t{\r\n\t\tOntResource si = this.obtainOntResource(sourceInstance);\r\n\t\tOntResource di = this.obtainOntResource(destInstance);\r\n\t\tProperty prop = this.obtainOntProperty(property);\t\r\n\t\tsi.removeProperty(prop, di);\r\n\t}",
"public void unsetSource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(SOURCE$0, 0);\r\n }\r\n }",
"PropertiesTask removeProperty( String key );",
"void nodeRemoveProperty( long nodeId, int propertyKey );",
"void removePropertyListener(PropertyListener listener);",
"public final GetHTTP removeUrl() {\n properties.remove(URL_PROPERTY);\n return this;\n }",
"public void removeProperty(Object key) {\r\n\t\tproperties.remove(key);\r\n\t}",
"public Object removeProperty( String key );",
"public void removeProperty(String key) {\n\t\tthis.properties.remove(key);\n\t}",
"public void removeProperty(DAGObject dagObj, String key) {\r\n\r\n\t}",
"public static void removeProperty(String aKey) {\n checkArgument(!isNullOrEmpty(aKey), \"aKey cannot be null or empty\");\n \n loadPropertiesFile();\n if (props.containsKey(aKey))\n props.remove(aKey);\n storePropsFile();\n }",
"public void removeUserDefinedProperty(String propertyName);",
"public String removeStringProperty(String propertyName);",
"boolean removeLink(Link link);",
"void removeSources(McastRoute route);",
"void clearProperty(String key);",
"void clearProperty(String key);",
"@Override\n\t\tpublic Object removeProperty(String key) {\n\t\t\treturn null;\n\t\t}",
"Form removeProperty(String key);",
"public void removePaymentURL(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(this.model, this.getResource(), PAYMENTURL, value);\r\n\t}",
"Property removeValue(PropertyValue<?, ?> value);",
"public void removeOfficialAudioSourceWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"public void removeOfficialAudioSourceWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"public void removeVariableFromTable(Property remove) {\n\t\tthis.getItems().remove(remove);\n\t\tproperties.remove(remove.getName());\n\t}",
"void resetLink(Link link, Node source, Node target, Dependency type) {\n\t\tlinks.remove(link);\n\t\tlinks.add(new Link(source, target, type, source));\n\t}",
"public void remove(String key) {\n\t\t\tproperties.remove(key);\n\t\t}",
"@DELETE\n @Path(\"/source/{id}\")\n @Consumes(\"application/json;charset=UTF-8\")\n @RolesAllowed(Roles.ADMIN)\n @GZIP\n @NoCache\n public void deleteSource(@PathParam(\"id\") Integer id) throws Exception {\n log.info(\"Deleting source \" + id);\n sourceService.deleteSource(id);\n }",
"public void removeSemanticLink(IBusinessObject dest, LinkKind type)\n throws OculusException;",
"private void removeTempProperty(final UUID uuid){\n TraversalDescription tempTraversal = this.database.traversalDescription()\n .depthFirst()\n .uniqueness(Uniqueness.RELATIONSHIP_GLOBAL);\n String uuidString = \"flw-\"+uuid.toString();\n Transaction tx = database.beginTx();\n try {\n for(Relationship r : tempTraversal.traverse(this.nSource)\n .relationships()){\n if (r.hasProperty(\"weight\"))\n r.removeProperty(uuidString);\n }\n tx.success();\n } catch (Exception e) {\n System.err.println(\"MaximumFlow.removeTempProperty: \" + e);\n tx.failure();\n } finally {\n tx.close();\n }\n }",
"public abstract void removePropertyChangeListener(PropertyChangeListener listener, String kenaiHostUrl);",
"public void removeListener(PropertyChangeListener listener, String propertyType);",
"void removeHadithUrl(Object oldHadithUrl);",
"public void removeRuntimeProperty(String name) {\n if (_properties != null) {\n _properties.remove(name);\n }\n }",
"void removeSources(McastRoute route, Set<ConnectPoint> sources);",
"@Override\r\n\tpublic boolean delSource(int resourceid) {\n\t\treturn this.excuteDb(\"delete from resource where resource_id=?\",new Object[]{\r\n\t\t\t\tresourceid \r\n\t\t} );\r\n\t}",
"public void removePaymentURL( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), PAYMENTURL, value);\r\n\t}",
"public void set_source(EndpointID source) {\r\n\t\tsource_ = source;\r\n\t}",
"private void linkRemoved(Link link) {\n\n\t}",
"public NameValue<String, String> removeDestURL() {\n return removeURL(mDestMap);\n }",
"public void removeFromImages(final GPImageLinkComponent value)\n\t{\n\t\tremoveFromImages( getSession().getSessionContext(), value );\n\t}",
"public void removePropertyChangeListener(PropertyChangeListener l);",
"@Override\n public void removeProperty(DavPropertyName propertyName) throws DavException {\n internalRemoveProperty(propertyName);\n complete();\n }",
"public static void removeOfficialAudioSourceWebpage( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"public static void removeOfficialAudioSourceWebpage(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"Property clearAndAddValue(PropertyValue<?, ?> value);",
"public Object removeProperty( Object propertyId ) {\n return nodeProperties != null ? nodeProperties.remove(propertyId) : null;\n }",
"public void removeDataSourcesWithSameOrigin(DataSource source) {\n Iterator<DataSource> iter=datasources.iterator();\n while (iter.hasNext()) {\n DataSource old=iter.next();\n if (old.hasSameOrigin(source)) iter.remove();\n }\n }",
"@Override\n \tpublic Representation deleteResource() {\n \t\tString interId = (String) this.getRequestAttributes().get(\"interId\");\n \t\tString srcId = (String) this.getRequestAttributes().get(\"sourceId\");\n \t\t\n \t\t// On s'assure qu'il n'est plus prsent en base de donnes\n \t\n \t\tIntervention inter = Interventions.getInstance().getIntervention(interId);\n \t\tList<Source> sources = inter.getSources();\n \t\tfor (int i = 0; i < sources.size(); i++) {\n \t\t\tif (sources.get(i).getUniqueID().equals(srcId)) {\n \t\t\t\tsources.remove(sources.get(i));\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn null;\n \t}",
"@Override\n\tpublic void removePropertyChangeListener(PropertyChangeListener l) {\n\t\t//do nothing\n\t}",
"public void removePropertyChangeListener (\n String propertyName,\n PropertyChangeListener l\n ) {\n pcs.removePropertyChangeListener (propertyName, l);\n }",
"void removePropertyChangeListener(PropertyChangeListener listener);",
"void removePropertyChangeListener(PropertyChangeListener listener);",
"void remove(InstanceProperties props) {\n props.remove();\n removeListeners.fireChange();\n }",
"@JsonProperty(\"source\")\n public void setSource(Source source) {\n this.source = source;\n }",
"void removeHadithBookUrl(Object oldHadithBookUrl);",
"public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener) {\n }",
"public void unsetUrlValue()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(URLVALUE$2);\r\n }\r\n }",
"public void xsetSource(edu.umich.icpsr.ddi.FileTxtType.Source source)\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTxtType.Source target = null;\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().add_attribute_user(SOURCE$30);\n }\n target.set(source);\n }\n }",
"public void setSourceUrl(String sourceUrl) {\n this.sourceUrl = sourceUrl == null ? null : sourceUrl.trim();\n }",
"public void setSource(noNamespace.SourceType source)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.SourceType target = null;\r\n target = (noNamespace.SourceType)get_store().find_element_user(SOURCE$0, 0);\r\n if (target == null)\r\n {\r\n target = (noNamespace.SourceType)get_store().add_element_user(SOURCE$0);\r\n }\r\n target.set(source);\r\n }\r\n }",
"public void removePropertyChangeListener(PropertyChangeListener listener);",
"public boolean removeProperty(String name) {\n for(Pp property : properties){\n if(property.getId().equals(name))\n return removeProperty(property);\n }\n return false;\n }",
"public static void removePaymentURL(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(model, instanceResource, PAYMENTURL, value);\r\n\t}",
"public static void removePaymentURL( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(model, instanceResource, PAYMENTURL, value);\r\n\t}",
"public boolean removeProperty(Pp property) {\n if(properties.remove(property)){\n //Se property existe, retira o seu parentesco\n if(property != null)\n property.setParent(null);\n\n notifyRemoved(NCLElementSets.PROPERTIES, property);\n return true;\n }\n return false;\n }",
"public void unwatch(final Source source) {\n logger.debug(\"Unwatching configuration {}\", source);\n watchers.remove(source);\n }",
"private void internalRemoveProperty(DavPropertyName propertyName) throws DavException {\n if (!exists()) {\n throw new DavException(DavServletResponse.SC_NOT_FOUND);\n }\n if (JCR_MIXINNODETYPES.equals(propertyName)) {\n // remove all mixin nodetypes\n try {\n Node n = (Node)item;\n for (NodeType mixin : n.getMixinNodeTypes()) {\n n.removeMixin(mixin.getName());\n }\n } catch (RepositoryException e) {\n // NoSuchNodeTypeException, ConstraintViolationException should never occur...\n throw new JcrDavException(e);\n }\n } else {\n // all props except for mixin node types are read-only\n throw new DavException(DavServletResponse.SC_CONFLICT);\n }\n }",
"public void removeRuleRef(org.semanticwb.model.RuleRef value);",
"public void unsetComparesource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(COMPARESOURCE$2, 0);\r\n }\r\n }",
"public abstract void removePropertyChangeListener(PropertyChangeListener listener);",
"public void setSource(String source) {\n this.source = source == null ? null : source.trim();\n }",
"public void setSource(String source) {\n this.source = source == null ? null : source.trim();\n }",
"public void delete() {\n if (this.sourceInfo != null) {\n this.sourceInfo.removeSSRC(this);\n }\n }",
"@Override\n\tpublic int delLink(Link link) {\n\t\treturn 0;\n\t}",
"public void removeFromImages(final SessionContext ctx, final GPImageLinkComponent value)\n\t{\n\t\tremoveLinkedItems( \n\t\t\tctx,\n\t\t\ttrue,\n\t\t\tGpcommonaddonConstants.Relations.BRANDBAR2GPIMAGELINKRELATION,\n\t\t\tnull,\n\t\t\tCollections.singletonList(value),\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tUtilities.getMarkModifiedOverride(BRANDBAR2GPIMAGELINKRELATION_MARKMODIFIED)\n\t\t);\n\t}",
"public void setURL(String key, URL value) {\n\t\tif (value != null && !value.equals(getDefault(key)))\n\t\t\tinternal.setProperty(key, value.toString());\n\t\telse\n\t\t\tinternal.remove(key);\n\t}",
"public void removePropertyChangeListener(PropertyChangeListener listener)\n {\n }",
"public abstract void removePropertyChangeListener(IPropertyChangeListener listener);",
"public void removeActionSourceListener( ActionSourceListener l) {\n lm.removeListener(l);\n l.removeActionValueListener(this);\n }",
"private static void clearSource(Spreadsheet ss) {\r\n \t\tss.setAttribute(KEY_SRC_SHEET, null);\r\n \t\tss.setAttribute(KEY_SRC_RANGE, null);\t\t\r\n \t\tss.setHighlight(null);\r\n \t\tss.smartUpdate(\"copysrc\", false);\r\n \t}",
"public Builder clearSource() {\n \n source_ = getDefaultInstance().getSource();\n onChanged();\n return this;\n }",
"public Builder clearSource() {\n \n source_ = getDefaultInstance().getSource();\n onChanged();\n return this;\n }",
"public void setSource(String source) {\n _source = source;\n }",
"public void removeIdenticalDataSources(DataSource source) {\n Iterator<DataSource> iter=datasources.iterator();\n while (iter.hasNext()) {\n DataSource s=iter.next();\n if (s.equals(source)) iter.remove();\n } \n }",
"public void removeCommercialInformationURL(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(this.model, this.getResource(), COMMERCIALINFORMATIONURL, value);\r\n\t}",
"@Override\n public boolean removeProperties(final String id) {\n try {\n return deleteIfExists(sidecarFile(id).toPath());\n } catch (final IOException e) {\n throw new RepositoryRuntimeException(id, e);\n }\n }",
"default void removePropertyChangeListener(PropertyChangeListener listener)\r\n {\r\n }",
"public void setSourceId(String source) {\n this.sourceId = sourceId;\n }",
"@Required\n public void setAssetLinkProperty(String assetLinkProperty) {\n this.assetLinkProperty = assetLinkProperty;\n }",
"public void removeSourceData(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(SOURCEDATA$0, i);\r\n }\r\n }",
"public void removePropertyChangeListener(@NotNull PropertyChangeListener listener) {\n }",
"public void removePropertyChangeListener (PropertyChangeListener l)\n { pcs.removePropertyChangeListener (l); }"
] | [
"0.6537842",
"0.6374729",
"0.6370125",
"0.62876576",
"0.619681",
"0.61859125",
"0.61854523",
"0.6136771",
"0.60891354",
"0.60131854",
"0.5981339",
"0.5816461",
"0.580818",
"0.57975507",
"0.57927734",
"0.5754941",
"0.5704852",
"0.56014377",
"0.559993",
"0.55628157",
"0.5499992",
"0.5471532",
"0.54329824",
"0.5416944",
"0.54009897",
"0.54009897",
"0.53882736",
"0.5363084",
"0.5323727",
"0.5316651",
"0.52995735",
"0.5239916",
"0.52320397",
"0.52277017",
"0.52070594",
"0.5200161",
"0.5194514",
"0.5166848",
"0.5166307",
"0.51619846",
"0.51613224",
"0.51511055",
"0.51459146",
"0.5118622",
"0.5112428",
"0.5108082",
"0.509968",
"0.5095885",
"0.50901455",
"0.50768304",
"0.50738883",
"0.50611794",
"0.50566274",
"0.5038779",
"0.5021286",
"0.50093687",
"0.49793175",
"0.496268",
"0.49504587",
"0.49492276",
"0.49492276",
"0.49352622",
"0.49330378",
"0.49318162",
"0.49298993",
"0.49253988",
"0.49192432",
"0.49111256",
"0.49104813",
"0.49070477",
"0.4905103",
"0.4904896",
"0.49040085",
"0.4897272",
"0.4891011",
"0.48784932",
"0.4866659",
"0.48327675",
"0.48234528",
"0.48211843",
"0.48211843",
"0.48120913",
"0.48083258",
"0.48028567",
"0.4800881",
"0.47828773",
"0.47764668",
"0.47602627",
"0.47429994",
"0.47396803",
"0.47396803",
"0.47337785",
"0.4731569",
"0.47264546",
"0.4726198",
"0.4725772",
"0.47241476",
"0.4717673",
"0.47176623",
"0.47110352",
"0.47013095"
] | 0.0 | -1 |
addSource Removes a source from the link. | public boolean removeSource(Entity source) {
boolean result = IServer.associationHasSource().remove(this, source);
IServer.fireLinkUpdated(new LinkEvent(this));
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void removeSource(String sourceName) {\n\t\t\n\t}",
"void removeSource(McastRoute route, HostId source);",
"public void setSource(noNamespace.SourceType source)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.SourceType target = null;\r\n target = (noNamespace.SourceType)get_store().find_element_user(SOURCE$0, 0);\r\n if (target == null)\r\n {\r\n target = (noNamespace.SourceType)get_store().add_element_user(SOURCE$0);\r\n }\r\n target.set(source);\r\n }\r\n }",
"public boolean addSource(Entity source) {\r\n boolean result = IServer.associationHasSource().add(this, source);\r\n IServer.fireLinkUpdated(new LinkEvent(this));\r\n return result;\r\n }",
"public void unsetSource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(SOURCE$0, 0);\r\n }\r\n }",
"public void setSource(String source) {\n _source = source;\n }",
"public void setSource(String source) {\n this.source = source;\n }",
"public void setSource(String source) {\n this.source = source;\n }",
"public void setSource(String source) {\r\n this.source = source;\r\n }",
"public void unsetSource()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(SOURCE$30);\n }\n }",
"public void setSourceId(String source) {\n this.sourceId = sourceId;\n }",
"void removeSources(McastRoute route);",
"public void xsetSource(edu.umich.icpsr.ddi.FileTxtType.Source source)\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTxtType.Source target = null;\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().add_attribute_user(SOURCE$30);\n }\n target.set(source);\n }\n }",
"public void addDataSource(DataSource source) {\n if (!containsDataSource(source)) datasources.add(source);\n }",
"public void setSource(Source s)\n\t{\n\t\tsource = s;\n\t}",
"public NameValue<String, String> removeSourceURL() {\n return removeURL(mSourceMap);\n }",
"public void setSource(String source);",
"public noNamespace.SourceType addNewSource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.SourceType target = null;\r\n target = (noNamespace.SourceType)get_store().add_element_user(SOURCE$0);\r\n return target;\r\n }\r\n }",
"public void setSourceUrl(String sourceUrl) {\n this.sourceUrl = sourceUrl == null ? null : sourceUrl.trim();\n }",
"public void setSource(String source) {\n this.source = source == null ? null : source.trim();\n }",
"public void setSource(String source) {\n this.source = source == null ? null : source.trim();\n }",
"public void setSource (String source);",
"@NonNull\n\t\tBuilder addSource(@NonNull ConfigSource source);",
"@DELETE\n @Path(\"/source/{id}\")\n @Consumes(\"application/json;charset=UTF-8\")\n @RolesAllowed(Roles.ADMIN)\n @GZIP\n @NoCache\n public void deleteSource(@PathParam(\"id\") Integer id) throws Exception {\n log.info(\"Deleting source \" + id);\n sourceService.deleteSource(id);\n }",
"public void resetSource(String sourceId) {\n\t}",
"public void set_source(EndpointID source) {\r\n\t\tsource_ = source;\r\n\t}",
"public native final String SRC_ADD() /*-{\n\t\treturn this.SRC_ADD;\n\t}-*/;",
"boolean removeLink(Link link);",
"public void replaceDataSource(DataSource newsource) {\n removeDataSourcesWithSameOrigin(newsource);\n datasources.add(newsource);\n }",
"void resetLink(Link link, Node source, Node target, Dependency type) {\n\t\tlinks.remove(link);\n\t\tlinks.add(new Link(source, target, type, source));\n\t}",
"void removeSources(McastRoute route, Set<ConnectPoint> sources);",
"public void addPreferredDataSource(DataSource source) { \n if (!containsDataSource(source)) datasources.add(0,source);\n }",
"public void removeActionSourceListener( ActionSourceListener l) {\n lm.removeListener(l);\n l.removeActionValueListener(this);\n }",
"public void addInput(@Nonnull Source source) {\r\n source.init(this);\r\n inputs.add(source);\r\n }",
"@Override\r\n\tpublic boolean delSource(int resourceid) {\n\t\treturn this.excuteDb(\"delete from resource where resource_id=?\",new Object[]{\r\n\t\t\t\tresourceid \r\n\t\t} );\r\n\t}",
"public void setSource(String value) {\n/* 304 */ setValue(\"source\", value);\n/* */ }",
"public void setSourceNode(String sourceNode) {\n this.sourceNode = sourceNode;\n }",
"public void addSource(Source src, boolean allowOverwrite) throws AlreadyExistingException {\n src.setResource(this);\n if (!allowOverwrite && sources.contains(src)) {\n throw new AlreadyExistingException();\n }\n if (allowOverwrite && sources.contains(src)) {\n // If source file is going to be overwritten, it should be actually re-add it.\n sources.remove(src);\n // Changing the SourceBase in the ExtensionMapping object from the mapping list.\n for (ExtensionMapping ext : this.getMappings()) {\n if (ext.getSource().equals(src)) {\n ext.setSource(src);\n }\n }\n }\n sources.add(src);\n }",
"public void removeOfficialAudioSourceWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"public void add(ConfigSource oConfig) throws SnarferException\r\n {\r\n Source oSource = new Source(oConfig);\r\n add(oSource);\r\n }",
"public native final HistoryClass SRC_ADD(String val) /*-{\n\t\tthis.SRC_ADD = val;\n\t\treturn this;\n\t}-*/;",
"public void addSource(ReplicaCatalogEntry rce) {\n List<ReplicaCatalogEntry> l = null;\n if (mSourceMap.containsKey(rce.getResourceHandle())) {\n // add the url to the existing list\n l = (List) mSourceMap.get(rce.getResourceHandle());\n // add the entry to the list\n l.add(rce);\n } else {\n // add a new list\n l = new ArrayList(3);\n l.add(rce);\n mSourceMap.put(rce.getResourceHandle(), l);\n }\n }",
"@PostMapping(path = \"/source\")\r\n\tpublic ResponseEntity<SourceBO> addSource(@RequestBody SourceBO source) {\r\n\t\tSourceBO src = this.bl.save(source);\r\n\t\treturn ResponseEntity.status(HttpStatus.OK).body(src);\r\n\t}",
"public void setSourceAttribute(String id) {\n this.sourceAttribute = id;\n }",
"public void setSource(edu.umich.icpsr.ddi.FileTxtType.Source.Enum source)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SOURCE$30);\n }\n target.setEnumValue(source);\n }\n }",
"public Builder addSourcepath(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureSourcepathIsMutable();\n sourcepath_.add(value);\n onChanged();\n return this;\n }",
"public void setSource(String value) {\n configuration.put(ConfigTag.SOURCE, value);\n }",
"public void addSource(NameValue<String, String> nv) {\n this.addSource(nv.getKey(), nv.getValue());\n }",
"public void removeOfficialAudioSourceWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"public void setSource(String Source) {\r\n this.Source = Source;\r\n }",
"@JsonProperty(\"source\")\n public void setSource(Source source) {\n this.source = source;\n }",
"private void linkRemoved(Link link) {\n\n\t}",
"public void removeDataSourcesWithSameOrigin(DataSource source) {\n Iterator<DataSource> iter=datasources.iterator();\n while (iter.hasNext()) {\n DataSource old=iter.next();\n if (old.hasSameOrigin(source)) iter.remove();\n }\n }",
"@PUT\n @Path(\"/source/{id}\")\n @Consumes(\"application/json;charset=UTF-8\")\n @Produces(\"application/json;charset=UTF-8\")\n @RolesAllowed(Roles.ADMIN)\n @GZIP\n @NoCache\n public SourceVo updateSource(\n @PathParam(\"id\") Integer id,\n SourceVo source) throws Exception {\n\n if (!Objects.equals(id, source.getId())) {\n throw new WebApplicationException(400);\n }\n\n log.info(\"Updating source \" + source);\n return sourceService.updateSource(new Source(source))\n .toVo(DataFilter.get());\n }",
"@Override\r\n\tpublic boolean addSource(Resource resource) {\n\t\treturn this.excuteDb(\"insert into resource (style_id,title,size,language,banben,text,inputtime,res_add,image_add) values(?,?,?,?,?,?,?,?,?)\",new Object[]{\r\n\t\t\t\tresource.getStyleid(),\r\n\t\t\t\tresource.getTitle(),\r\n\t\t\t\tresource.getSize(),\r\n\t\t\t\tresource.getLanguage(),\r\n\t\t\t\tresource.getBanben(),\r\n\t\t\t\tresource.getText(),\r\n\t\t\t\tresource.getInputtime(),\r\n\t\t\t\tresource.getResadd(),\r\n\t\t\t\tresource.getImageadd()\r\n\t\t} );\r\n\t}",
"final void removeSourceEvents(Object source) {\n\tToolkit toolkit = Toolkit.getDefaultToolkit();\n if (toolkit instanceof SunToolkit) {\n\t ((SunToolkit)toolkit).flushPendingEvents();\n\t}\n\n synchronized (this) {\n\t for (int i = 0; i < NUM_PRIORITIES; i++) {\n\t EventQueueItem entry = queues[i].head;\n\t\tEventQueueItem prev = null;\n\t\twhile (entry != null) {\n\t\t if (entry.event.getSource() == source) {\n\t\t if (prev == null) {\n\t\t\t queues[i].head = entry.next;\n\t\t\t} else {\n\t\t\t prev.next = entry.next;\n\t\t\t}\n\t\t } else {\n\t\t prev = entry;\n\t\t }\n\t\t entry = entry.next;\n\t\t}\n\t\tqueues[i].tail = prev;\n\t }\n\t}\n }",
"public void setSource(Object o) {\n\t\tsource = o;\n\t}",
"public Builder clearSourceId() {\n bitField0_ = (bitField0_ & ~0x00000001);\n sourceId_ = 0L;\n onChanged();\n return this;\n }",
"public void setSource(Byte source) {\r\n this.source = source;\r\n }",
"public void removeEntry(int source, int net)\n\t{ // this is utilizing my compareTo method, only the source and network number matter\n\t\ttable.remove(new RouteTableEntry(source, new NetworkDistancePair(net, 0), 0));\n\t\t\n\t\tparentActivity.runOnUiThread(new Runnable()\n\t\t{ \n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tuiManager.resetRoutingListAdapter();\n\t\t\t\tuiManager.resetForwardingListAdapter();\n\t\t\t} // end public method run\n\t\t}); // end runOnUiThread\n\t}",
"public void setSourceLayer(String sourceLayer) {\n nativeSetSourceLayer(sourceLayer);\n }",
"public Builder clearSource() {\n bitField0_ = (bitField0_ & ~0x00000001);\n source_ = getDefaultInstance().getSource();\n onChanged();\n return this;\n }",
"@Override\n\tpublic int addLink(Link link) {\n\t\treturn 0;\n\t}",
"void removeSources(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints);",
"public void setCurrentSource(Object source) {\r\n if (source instanceof IModelNode) {\r\n newSource = (IModelNode) source;\r\n newTarget = null;\r\n }\r\n }",
"public void setSource(org.LexGrid.commonTypes.Source[] source) {\n this.source = source;\n }",
"public void setSource(java.lang.String param) {\r\n localSourceTracker = true;\r\n\r\n this.localSource = param;\r\n\r\n\r\n }",
"public Builder setSource(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n source_ = value;\n onChanged();\n return this;\n }",
"public Builder setSource(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n source_ = value;\n onChanged();\n return this;\n }",
"public void removeSemanticLink(IBusinessObject dest, LinkKind type)\n throws OculusException;",
"public void addSourceChanger(Component component, Class sourceClass)\n {\n component.addAttribute(GlobalAttributes.Value, sourceClass.getCanonicalName().replace(\".\", \"/\"));\n component.setID(sourceClass.getSimpleName() + \"_source\");\n getSourceChanges().put(component, sourceClass);\n }",
"public Builder clearSource() {\n \n source_ = getDefaultInstance().getSource();\n onChanged();\n return this;\n }",
"public Builder clearSource() {\n \n source_ = getDefaultInstance().getSource();\n onChanged();\n return this;\n }",
"public void addSource(String site, String url) {\n this.addSource(new ReplicaCatalogEntry(url, site));\n }",
"public Builder setSource(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n source_ = value;\n onChanged();\n return this;\n }",
"public static void removeMap(MapSource source) {\n\t\tsynchronized(memoryCache) {\n\t\t\tmemoryCache.clear();\n\t\t}\n\t\tUtil.recursiveRemoveDir(new File(cacheDir + source.getName()));\n\t}",
"public void setSourceID(java.lang.Object sourceID) {\n this.sourceID = sourceID;\n }",
"public void xsetDisplaysource(org.apache.xmlbeans.XmlString displaysource)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlString target = null;\r\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(DISPLAYSOURCE$10);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(DISPLAYSOURCE$10);\r\n }\r\n target.set(displaysource);\r\n }\r\n }",
"public static void removeOfficialAudioSourceWebpage( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"@Override\n\tpublic int delLink(Link link) {\n\t\treturn 0;\n\t}",
"public static void removeOfficialAudioSourceWebpage(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"public void delete() {\n if (this.sourceInfo != null) {\n this.sourceInfo.removeSSRC(this);\n }\n }",
"public void setContent(Source source) {\n this.content = source;\n }",
"public static void addNewSource(UserInteraction interaction, FeedMetaDataManager menageMetaData, RSSReader reader,\n\t\t\tEntryWriter writer, EntryWriteRequest entryObj)\n\t\t\t\t\tthrows IllegalArgumentException, FeedException, IOException, ParseException {\n\t\tIterator<?> itEntries = reader.readRSSFeed(interaction.getLink());\n\n\t\tif (itEntries != null) {\n\t\t\t// if user choosed to add a news source.\n\t\t\twhile (itEntries.hasNext()) {\n\t\t\t\tSyndEntry entry = (SyndEntry) itEntries.next();\n\t\t\t\tif (entry != null) {\n\t\t\t\t\t// set data into a object\n\t\t\t\t\tentryObj.setlink(entry.getLink());\n\t\t\t\t\tentryObj.setTitle(entry.getTitle());\n\t\t\t\t\tentryObj.setDate(entry.getPublishedDate().toString());\n\t\t\t\t\tentryObj.setMethod(interaction.getMethod());\n\t\t\t\t\tString filePath = null;\n\t\t\t\t\tentryObj.setFilePath(filePath);\n\t\t\t\t\t// writer method to write data into file\n\t\t\t\t\twriter.writeFeedEntry(entryObj);\n\t\t\t\t\t// ask to user add or not..\n\t\t\t\t\tif (!(interaction.continueCheck() == 'y')) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tchar addControl = interaction.addOrNot();\n\t\t// user decided to add soruce in file.\n\t\tif (addControl == 'a') {\n\t\t\tString name = interaction.getName();\n\t\t\tString link = interaction.getLink();\n\t\t\tString method = interaction.getMethod();\n\t\t\t// check is source already exist.\n\t\t\tif (menageMetaData.checkSource(name, link) == true) {\n\t\t\t\tchar entryCheck = interaction.addAlreadyExistRecord();\n\t\t\t\tif (entryCheck == 'y')\n\t\t\t\t\tmenageMetaData.addSource(name, link, method);\n\t\t\t} else {\n\t\t\t\tmenageMetaData.addSource(name, link, method);\n\t\t\t}\n\t\t}\n\t\tinteraction.getUserPreferences();\n\t}",
"public void addFilterToReferencedLink(ViewerFilter filter);",
"public final void setSource(final Integer newSource) {\n this.source = newSource;\n }",
"public void removeServiceEntry(String linkName);",
"public static void delete(String source) {\n Path directory = Paths.get(source);\n try {\n Files.walkFileTree(directory, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs)\n throws IOException {\n Files.delete(file);\n return CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(final Path file, final IOException e) {\n return handleException(e);\n }\n\n private FileVisitResult handleException(final IOException e) {\n e.printStackTrace(); // replace with more robust error handling\n return TERMINATE;\n }\n\n @Override\n public FileVisitResult postVisitDirectory(final Path dir, final IOException e)\n throws IOException {\n if (e != null) {\n return handleException(e);\n }\n Files.delete(dir);\n return CONTINUE;\n }\n });\n } catch (IOException ex) {\n Logger.getLogger(FolderManager.class.getName()).log(Level.SEVERE, null, ex);\n delete(source);\n }\n }",
"public void removeEventSource(RemoveEventSourceRequest removeEventSourceRequest) {\n ExecutionContext executionContext = createExecutionContext(removeEventSourceRequest);\n AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();\n awsRequestMetrics.startEvent(Field.ClientExecuteTime);\n Request<RemoveEventSourceRequest> request = null;\n \n try {\n awsRequestMetrics.startEvent(Field.RequestMarshallTime);\n try {\n request = new RemoveEventSourceRequestMarshaller().marshall(super.beforeMarshalling(removeEventSourceRequest));\n // Binds the request metrics to the current request.\n request.setAWSRequestMetrics(awsRequestMetrics);\n } finally {\n awsRequestMetrics.endEvent(Field.RequestMarshallTime);\n }\n\n JsonResponseHandler<Void> responseHandler = new JsonResponseHandler<Void>(null);\n invoke(request, responseHandler, executionContext);\n\n } finally {\n \n endClientExecution(awsRequestMetrics, request, null, LOGGING_AWS_REQUEST_METRIC);\n }\n }",
"public void setSourceSite(String newsource) {\n sourceSite=newsource;\n }",
"public void removeSourceData(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(SOURCEDATA$0, i);\r\n }\r\n }",
"void addLink(BlockChainLink link);",
"@Test\n\tpublic void testIsSourceNoNothingAddedOrRemoved() {\n\t\t// Setup\n\t\tString added = \"-\";\n\t\tString removed = \"-\";\n\t\tString file = \"dank.tt\";\n\t\tLine line = new Line(added, removed, file);\n\t\tList<String> types = new ArrayList<String>();\n\t\ttypes.add(\"tt\");\n\n\t\t// Exercise\n\t\tboolean src = line.isSource(types);\n\n\t\t// Verify\n\t\tassertFalse(src);\n\t}",
"boolean hasSource();",
"public void removeDoc(String sourceId, String itemId, String accountId) {\n\t}",
"public void removeIdenticalDataSources(DataSource source) {\n Iterator<DataSource> iter=datasources.iterator();\n while (iter.hasNext()) {\n DataSource s=iter.next();\n if (s.equals(source)) iter.remove();\n } \n }",
"public void set_source(String name) throws ConnectorConfigException{\n\t\tsource = name.trim();\n\t\tif (source.equals(\"\"))\n\t\t\tthrow new ConnectorConfigException(\"Source of data can't be empty\");\n\t}",
"public void setText(String source)\n {\n m_srcUtilIter_.setText(source);\n m_source_ = m_srcUtilIter_;\n updateInternalState();\n }",
"public void removeRlsSourceFile(IAstRlsSourceFile rlsFile);",
"public void destroy() {\n\t\tAL10.alDeleteSources(id);\n\t}"
] | [
"0.6957234",
"0.6523635",
"0.5802395",
"0.5771873",
"0.57398283",
"0.57393825",
"0.57335764",
"0.57335764",
"0.57211715",
"0.572089",
"0.57066",
"0.5679259",
"0.56598175",
"0.5635792",
"0.5624971",
"0.5583579",
"0.55813396",
"0.55670637",
"0.554203",
"0.5538664",
"0.5538664",
"0.5517162",
"0.5487904",
"0.5440607",
"0.5397994",
"0.5348238",
"0.5319505",
"0.5318636",
"0.5306312",
"0.5295696",
"0.52505153",
"0.5213363",
"0.52086467",
"0.51916844",
"0.51590884",
"0.51414436",
"0.5137883",
"0.5136156",
"0.51252395",
"0.5117253",
"0.51135415",
"0.5104733",
"0.5102415",
"0.510224",
"0.50985163",
"0.50962776",
"0.50913167",
"0.5071062",
"0.5066863",
"0.506027",
"0.5040453",
"0.50392884",
"0.5024816",
"0.5009898",
"0.5006364",
"0.4982414",
"0.49817047",
"0.4952074",
"0.4940663",
"0.4934697",
"0.492365",
"0.4922419",
"0.49028364",
"0.4869283",
"0.48624682",
"0.4856874",
"0.48555306",
"0.48536068",
"0.48536068",
"0.48459384",
"0.4830997",
"0.48245037",
"0.48245037",
"0.48164022",
"0.47968742",
"0.4784238",
"0.47805706",
"0.4760021",
"0.4753488",
"0.47512755",
"0.47462168",
"0.4723761",
"0.4710086",
"0.47014764",
"0.46935415",
"0.4680543",
"0.46787953",
"0.4678639",
"0.46750095",
"0.4673894",
"0.46676046",
"0.4665666",
"0.4662972",
"0.4661519",
"0.46593618",
"0.46418834",
"0.46403894",
"0.46343705",
"0.46334082",
"0.46328443"
] | 0.6413439 | 2 |
removeSource Returns the link's source. | public OMCollection getSource() {
return IServer.associationHasSource().dr(this).range();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public NameValue<String, String> removeSourceURL() {\n return removeURL(mSourceMap);\n }",
"private void removeSource(String sourceName) {\n\t\t\n\t}",
"public boolean removeSource(Entity source) {\r\n boolean result = IServer.associationHasSource().remove(this, source);\r\n IServer.fireLinkUpdated(new LinkEvent(this));\r\n return result;\r\n }",
"public void unsetSource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(SOURCE$0, 0);\r\n }\r\n }",
"public void unsetSource()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(SOURCE$30);\n }\n }",
"void removeSource(McastRoute route, HostId source);",
"boolean removeLink(Link link);",
"private void linkRemoved(Link link) {\n\n\t}",
"public void delete() {\n if (this.sourceInfo != null) {\n this.sourceInfo.removeSSRC(this);\n }\n }",
"public void removeOfficialAudioSourceWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"void removeSources(McastRoute route);",
"public void removeOfficialAudioSourceWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"public void removeRlsSourceFile(IAstRlsSourceFile rlsFile);",
"private void removeActiveSource() {\n for (Iterator<HdmiCecMessage> iter = mBuffer.iterator(); iter.hasNext(); ) {\n HdmiCecMessage message = iter.next();\n if (message.getOpcode() == Constants.MESSAGE_ACTIVE_SOURCE) {\n iter.remove();\n }\n }\n }",
"public void removeLink(String link, TOSCAPlan buildPlan) {\n\t\tNodeList children = buildPlan.getBpelMainFlowLinksElement().getChildNodes();\n\t\tNode toRemove = null;\n\t\tfor (int i = 0; i < children.getLength(); i++) {\n\t\t\tif (children.item(i).getAttributes().getNamedItem(\"name\").getNodeValue().equals(link)) {\n\t\t\t\ttoRemove = children.item(i);\n\t\t\t}\n\t\t\tif (children.item(i).getAttributes().getNamedItem(\"name\").getTextContent().equals(link)) {\n\t\t\t\ttoRemove = children.item(i);\n\t\t\t}\n\n\t\t}\n\t\tif (toRemove != null) {\n\t\t\tbuildPlan.getBpelMainFlowLinksElement().removeChild(toRemove);\n\t\t}\n\n\t}",
"public void removeActionSourceListener( ActionSourceListener l) {\n lm.removeListener(l);\n l.removeActionValueListener(this);\n }",
"public NameValue<String, String> removeDestURL() {\n return removeURL(mDestMap);\n }",
"@Override\n\tpublic int delLink(Link link) {\n\t\treturn 0;\n\t}",
"void removeSWFURL(String toRemove);",
"@Override\r\n\tpublic boolean delSource(int resourceid) {\n\t\treturn this.excuteDb(\"delete from resource where resource_id=?\",new Object[]{\r\n\t\t\t\tresourceid \r\n\t\t} );\r\n\t}",
"public final GetHTTP removeUrl() {\n properties.remove(URL_PROPERTY);\n return this;\n }",
"@Override\n \tpublic Representation deleteResource() {\n \t\tString interId = (String) this.getRequestAttributes().get(\"interId\");\n \t\tString srcId = (String) this.getRequestAttributes().get(\"sourceId\");\n \t\t\n \t\t// On s'assure qu'il n'est plus prsent en base de donnes\n \t\n \t\tIntervention inter = Interventions.getInstance().getIntervention(interId);\n \t\tList<Source> sources = inter.getSources();\n \t\tfor (int i = 0; i < sources.size(); i++) {\n \t\t\tif (sources.get(i).getUniqueID().equals(srcId)) {\n \t\t\t\tsources.remove(sources.get(i));\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn null;\n \t}",
"public void removeSemanticLink(IBusinessObject dest, LinkKind type)\n throws OculusException;",
"public void removeDataSourcesWithSameOrigin(DataSource source) {\n Iterator<DataSource> iter=datasources.iterator();\n while (iter.hasNext()) {\n DataSource old=iter.next();\n if (old.hasSameOrigin(source)) iter.remove();\n }\n }",
"public void deletelink(Integer linkId);",
"public static void removeOfficialAudioSourceWebpage( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"@Transactional\n public void remove(ExtensionLinkEntity link) {\n EntityManager entityManager = entityManagerProvider.get();\n link = findById(link.getLinkId());\n if (null != link) {\n entityManager.remove(link);\n }\n }",
"public URI getSource() {\n return source;\n }",
"public String getSource() {\n return mSource;\n }",
"public void unsetComparesource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(COMPARESOURCE$2, 0);\r\n }\r\n }",
"void removeSources(McastRoute route, Set<ConnectPoint> sources);",
"public static void removeOfficialAudioSourceWebpage(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"public URL getSource() {\n return url;\n }",
"public void removeServiceEntry(String linkName);",
"void removeDataSourceListener(@Nonnull IDataSourceListener listener);",
"public noNamespace.SourceType getSource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.SourceType target = null;\r\n target = (noNamespace.SourceType)get_store().find_element_user(SOURCE$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }",
"public String getSourceUrl() {\n return sourceUrl;\n }",
"@DELETE\n @Path(\"/source/{id}\")\n @Consumes(\"application/json;charset=UTF-8\")\n @RolesAllowed(Roles.ADMIN)\n @GZIP\n @NoCache\n public void deleteSource(@PathParam(\"id\") Integer id) throws Exception {\n log.info(\"Deleting source \" + id);\n sourceService.deleteSource(id);\n }",
"public edu.umich.icpsr.ddi.FileTxtType.Source xgetSource()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTxtType.Source target = null;\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_default_attribute_value(SOURCE$30);\n }\n return target;\n }\n }",
"public void remove() {\r\n\t\theadNode.link = headNode.link.link;\r\n\t\tsize--;\r\n\t}",
"void removeHadithUrl(Object oldHadithUrl);",
"public Optional<String> getSource() {\n\t\treturn Optional.ofNullable(_source);\n\t}",
"public String get_source() {\n\t\treturn source;\n\t}",
"public void removeEntry(int source, int net)\n\t{ // this is utilizing my compareTo method, only the source and network number matter\n\t\ttable.remove(new RouteTableEntry(source, new NetworkDistancePair(net, 0), 0));\n\t\t\n\t\tparentActivity.runOnUiThread(new Runnable()\n\t\t{ \n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tuiManager.resetRoutingListAdapter();\n\t\t\t\tuiManager.resetForwardingListAdapter();\n\t\t\t} // end public method run\n\t\t}); // end runOnUiThread\n\t}",
"public String getUrl(final String sourceURL) {\n\n String result = null;\n\n if (sourceURL == null) {\n // if only one URL is configured, \"default URL\" should mean that\n // URL.\n List<String> urls = descriptor().getUrls();\n if (!urls.isEmpty()) {\n result = urls.get(0);\n }\n return result;\n }\n for (String j : descriptor().getUrls()) {\n if (j.equals(sourceURL)) {\n result = j;\n break;\n }\n }\n return result;\n }",
"public static String cleanLink(String link) {\n\t\treturn MarkupParser.cleanLink(link);\n\t}",
"public String getSource() {\n return source;\n }",
"private int handleUnlink(String name) {\n\t\tboolean succeeded = ThreadedKernel.fileSystem.remove(name);\n\t\t//if the file was not removed return error\n\t\tif(!succeeded)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}",
"public void removeDeviceServiceLink();",
"public String getSource() {\n return this.source;\n }",
"Optional<String> getSource();",
"public String getSource() {\n return source;\n }",
"public String getSource() {\n return source;\n }",
"public String getSource() {\n return source;\n }",
"public String getSource() {\n\n return source;\n }",
"public String getSourceText() {\n\t\treturn getSource().replaceAll(\"<a.*>(.*)</a>\", \"$1\");\n\t}",
"public void destroy() {\n\t\tAL10.alDeleteSources(id);\n\t}",
"public void resetSource(String sourceId) {\n\t}",
"public void unwatch(final Source source) {\n logger.debug(\"Unwatching configuration {}\", source);\n watchers.remove(source);\n }",
"public String getSource() {\r\n return source;\r\n }",
"public void setSourceUrl(String sourceUrl) {\n this.sourceUrl = sourceUrl == null ? null : sourceUrl.trim();\n }",
"public Builder clearSource() {\n bitField0_ = (bitField0_ & ~0x00000001);\n source_ = getDefaultInstance().getSource();\n onChanged();\n return this;\n }",
"public void setSource(String source) {\r\n this.source = source;\r\n }",
"public void setSource(String source) {\n this.source = source;\n }",
"public void setSource(String source) {\n this.source = source;\n }",
"String getSource();",
"public void removePaymentURL(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(this.model, this.getResource(), PAYMENTURL, value);\r\n\t}",
"public void setSource(String source) {\n _source = source;\n }",
"public static void removeMap(MapSource source) {\n\t\tsynchronized(memoryCache) {\n\t\t\tmemoryCache.clear();\n\t\t}\n\t\tUtil.recursiveRemoveDir(new File(cacheDir + source.getName()));\n\t}",
"public String sourceUri() {\n return this.sourceUri;\n }",
"public void removeSourceData(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(SOURCEDATA$0, i);\r\n }\r\n }",
"protected abstract Vector4d stopSourceDrag(Node source,\n Vector3d pos, Vector4d copy);",
"@CheckForNull\r\n protected Token pop_source(boolean linemarker)\r\n throws IOException {\r\n if (listener != null)\r\n listener.handleSourceChange(this.source, SourceChangeEvent.POP);\r\n Source s = this.source;\r\n this.source = s.getParent();\r\n /* Always a noop unless called externally. */\r\n s.close();\r\n if (listener != null && this.source != null)\r\n listener.handleSourceChange(this.source, SourceChangeEvent.RESUME);\r\n\r\n Source t = getSource();\r\n if (getFeature(Feature.LINEMARKERS)\r\n && s.isNumbered()\r\n && t != null) {\r\n /* We actually want 'did the nested source\r\n * contain a newline token', which isNumbered()\r\n * approximates. This is not perfect, but works. */\r\n return line_token(t.getLine() + 1, t.getName(), \" 2\");\r\n }\r\n\r\n return null;\r\n }",
"public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public void removeNodeAfterThis() {\r\n\t\tif ( link != null ) {\r\n\t\t\tlink = link.link;\r\n\t\t} // end precondition\r\n\t}",
"public void removeEventSource(RemoveEventSourceRequest removeEventSourceRequest) {\n ExecutionContext executionContext = createExecutionContext(removeEventSourceRequest);\n AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();\n awsRequestMetrics.startEvent(Field.ClientExecuteTime);\n Request<RemoveEventSourceRequest> request = null;\n \n try {\n awsRequestMetrics.startEvent(Field.RequestMarshallTime);\n try {\n request = new RemoveEventSourceRequestMarshaller().marshall(super.beforeMarshalling(removeEventSourceRequest));\n // Binds the request metrics to the current request.\n request.setAWSRequestMetrics(awsRequestMetrics);\n } finally {\n awsRequestMetrics.endEvent(Field.RequestMarshallTime);\n }\n\n JsonResponseHandler<Void> responseHandler = new JsonResponseHandler<Void>(null);\n invoke(request, responseHandler, executionContext);\n\n } finally {\n \n endClientExecution(awsRequestMetrics, request, null, LOGGING_AWS_REQUEST_METRIC);\n }\n }",
"public String getSourceString() {\n return null;\n }",
"public String getSource() {\r\n return Source;\r\n }",
"public void onUnlink()\n {\n getTextArea().setFocus(true);\n// clientJupiter.generate(treeOperationFactory.createLink(clientJupiter.getSiteId(),\n// getTextArea().getDocument().getSelection().getRangeAt(0), linkConfig.getUrl()));\n Console.getInstance().log(\"RTP: onUnlink\");\n }",
"final void removeSourceEvents(Object source) {\n\tToolkit toolkit = Toolkit.getDefaultToolkit();\n if (toolkit instanceof SunToolkit) {\n\t ((SunToolkit)toolkit).flushPendingEvents();\n\t}\n\n synchronized (this) {\n\t for (int i = 0; i < NUM_PRIORITIES; i++) {\n\t EventQueueItem entry = queues[i].head;\n\t\tEventQueueItem prev = null;\n\t\twhile (entry != null) {\n\t\t if (entry.event.getSource() == source) {\n\t\t if (prev == null) {\n\t\t\t queues[i].head = entry.next;\n\t\t\t} else {\n\t\t\t prev.next = entry.next;\n\t\t\t}\n\t\t } else {\n\t\t prev = entry;\n\t\t }\n\t\t entry = entry.next;\n\t\t}\n\t\tqueues[i].tail = prev;\n\t }\n\t}\n }",
"public String getSource();",
"public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n }\n }",
"public Builder clearSource() {\n \n source_ = getDefaultInstance().getSource();\n onChanged();\n return this;\n }",
"public Builder clearSource() {\n \n source_ = getDefaultInstance().getSource();\n onChanged();\n return this;\n }",
"void resetLink(Link link, Node source, Node target, Dependency type) {\n\t\tlinks.remove(link);\n\t\tlinks.add(new Link(source, target, type, source));\n\t}",
"public void setSourceId(String source) {\n this.sourceId = sourceId;\n }",
"java.lang.String getSource();",
"java.lang.String getSource();",
"public void removeFileInstance()\n {\n this.source = null;\n this.data = null;\n }",
"public void removeIdenticalDataSources(DataSource source) {\n Iterator<DataSource> iter=datasources.iterator();\n while (iter.hasNext()) {\n DataSource s=iter.next();\n if (s.equals(source)) iter.remove();\n } \n }",
"private String getSource() {\n SharedPreferences settings =\n PreferenceManager.getDefaultSharedPreferences(Collect.getInstance().getBaseContext());\n String serverUrl = settings.getString(PreferencesActivity.KEY_SERVER_URL, null);\n String source = null;\n // Remove the protocol\n if(serverUrl.startsWith(\"http\")) {\n \tint idx = serverUrl.indexOf(\"//\");\n \tif(idx > 0) {\n \t\tsource = serverUrl.substring(idx + 2);\n \t} else {\n \t\tsource = serverUrl;\n \t}\n }\n \n return source;\n }",
"public String getSource() {\n Object ref = source_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n source_ = s;\n }\n return s;\n }\n }",
"public Node getSource() {\n return this.source;\n }",
"public Object getSource() {return source;}",
"public String getSource() {\n\t\treturn (String) _object.get(\"source\");\n\t}",
"public Optional<String> src() {\n\t\t\treturn Optional.ofNullable(_source);\n\t\t}",
"public java.lang.String getSource() {\r\n return localSource;\r\n }",
"void removeStatement(Resource subject, URI predicate, String literal,\r\n\t\t\tString languageTag) throws ModelRuntimeException;",
"void removeHadithBookUrl(Object oldHadithBookUrl);",
"public void remove()\n\t\t{\n\t\t\tif(this.removeCalled || previous == null)\n\t\t\t{\n\t\t\t\tthrow new IllegalStateException();\n\t\t\t}\n\t\t\t\n\t\t\t//the data that must be removed is referenced by the node that is before the current since\n\t\t\t//the Next() method removes the pointer over after it returns what was pointed to by current\n\t\t\telse\n\t\t\t{\n\t\t\t\t//remove the data that is referenced by the first node\n\t\t\t\tif(previous == head)\n\t\t\t\t{\n\t\t\t\t\thead = previous.getNext();\n\t\t\t\t\tprevious = null; //there is no node in front of the new head of the list\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tprevious = beforePrevious;\n\t\t\t\t\tbeforePrevious.setNext(current);\n\t\t\t\t}\n\t\t\t\tthis.removeCalled = true;\n\t\t\t}\n\t\t}"
] | [
"0.7285353",
"0.70879537",
"0.687701",
"0.6710051",
"0.66982335",
"0.6485871",
"0.6163841",
"0.58600646",
"0.5759039",
"0.5572766",
"0.5564344",
"0.5556293",
"0.55232674",
"0.5491147",
"0.54230744",
"0.5385495",
"0.5357262",
"0.5351466",
"0.528553",
"0.52536464",
"0.524508",
"0.5238615",
"0.52282506",
"0.52126",
"0.5212561",
"0.51978797",
"0.5188124",
"0.51571006",
"0.51542825",
"0.5142839",
"0.5142479",
"0.5139433",
"0.51146334",
"0.5111617",
"0.5111041",
"0.51028174",
"0.50939167",
"0.50835353",
"0.507917",
"0.50737685",
"0.5068304",
"0.5044314",
"0.50306034",
"0.50157964",
"0.5006714",
"0.5004905",
"0.49936396",
"0.49918157",
"0.4991027",
"0.49793658",
"0.4971859",
"0.49664694",
"0.49664694",
"0.49664694",
"0.49658298",
"0.49644825",
"0.4963182",
"0.4954574",
"0.49542937",
"0.49533212",
"0.49519455",
"0.49504557",
"0.49453405",
"0.49451494",
"0.49451494",
"0.49446684",
"0.49411052",
"0.4938435",
"0.49379712",
"0.49191374",
"0.49167567",
"0.48955232",
"0.48765346",
"0.48762926",
"0.48762926",
"0.48748347",
"0.48736846",
"0.48681027",
"0.48680916",
"0.48632997",
"0.4862464",
"0.48620906",
"0.48593247",
"0.48569855",
"0.48569855",
"0.4851979",
"0.4847662",
"0.48468146",
"0.48468146",
"0.48349422",
"0.48340166",
"0.48300374",
"0.48297545",
"0.48280022",
"0.48275733",
"0.4825156",
"0.48122093",
"0.48120815",
"0.48059496",
"0.48043644",
"0.48029274"
] | 0.0 | -1 |
getSource Adds a target to the link. | public boolean addTarget(Entity target) {
boolean result = IServer.associationHasTarget().add(this, target);
IServer.fireLinkUpdated(new LinkEvent(this));
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateSourceTarget(String source, String target) {\n\t\titem.setText(2, source);\n\t\titem.setText(3, target);\n\t}",
"public void setSource(Source s)\n\t{\n\t\tsource = s;\n\t}",
"public void setSource(noNamespace.SourceType source)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.SourceType target = null;\r\n target = (noNamespace.SourceType)get_store().find_element_user(SOURCE$0, 0);\r\n if (target == null)\r\n {\r\n target = (noNamespace.SourceType)get_store().add_element_user(SOURCE$0);\r\n }\r\n target.set(source);\r\n }\r\n }",
"@NotNull\n Resource getTarget();",
"public noNamespace.SourceType addNewSource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.SourceType target = null;\r\n target = (noNamespace.SourceType)get_store().add_element_user(SOURCE$0);\r\n return target;\r\n }\r\n }",
"public void setSource(Object o) {\n\t\tsource = o;\n\t}",
"URL getTarget();",
"public Object getSource() {return source;}",
"public void setTarget(String target) {\n this.target = target;\n }",
"public void setTarget(java.lang.String target) {\n this.target = target;\n }",
"public abstract Source getSource();",
"void openLink(Link target);",
"public URL getSource() {\n return url;\n }",
"public void setSource(String source) {\r\n this.source = source;\r\n }",
"public void setSource(String source) {\n this.source = source;\n }",
"public void setSource(String source) {\n this.source = source;\n }",
"public URI getSource() {\n return source;\n }",
"public void setSource(String source) {\n _source = source;\n }",
"public void setSourceNode(String sourceNode) {\n this.sourceNode = sourceNode;\n }",
"public void setLink(FileNode target){\n\t\t/*link = target;\n\t\tsuper.setOffset(0);\n\t\tsuper.setLength(link.getLength());\n\t\tsuper.setSourcePath(link.getSourcePath());*/\n\t\tsuper.setVirtualSourceNode(target);\n\t\tsuper.setOffset(0);\n\t\tif(target != null){\n\t\t\tsuper.setLength(target.getLength());\n\t\t\tsuper.setSourcePath(target.getSourcePath());\n\t\t}\n\t}",
"public void xsetSource(edu.umich.icpsr.ddi.FileTxtType.Source source)\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTxtType.Source target = null;\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().add_attribute_user(SOURCE$30);\n }\n target.set(source);\n }\n }",
"T setUrlTarget(String urlTarget);",
"public void setSource (String source);",
"public void setSource(String source);",
"public boolean addSource(Entity source) {\r\n boolean result = IServer.associationHasSource().add(this, source);\r\n IServer.fireLinkUpdated(new LinkEvent(this));\r\n return result;\r\n }",
"public void setSourceAttribute(String id) {\n this.sourceAttribute = id;\n }",
"public abstract Object getSource();",
"void setTarget(java.lang.String target);",
"public String getSource();",
"String getTarget() {\r\n return this.target;\r\n }",
"public String getTarget() {\n return JsoHelper.getAttribute(jsObj, \"target\");\n }",
"public String getTarget() {\n return this.target;\n }",
"String getTarget();",
"String getTarget();",
"public void setSourceId(String source) {\n this.sourceId = sourceId;\n }",
"public abstract void addTarget(Component target);",
"public java.lang.String getTarget() {\n return target;\n }",
"public void addTarget(Target target) {\n // XXX check out for name, if null, reject!\n targets.put(target.getName(), target);\n }",
"public Link linkTo() {\n Label text = Label.of(name);\n URIObject target = FSURICodec.encode(this);\n return Link.textTarget(text, target);\n }",
"public Object getSource() {\n return source;\n }",
"public String getTarget() {\n return target;\n }",
"public String getTarget() {\n return target;\n }",
"public void setTarget(String s) { \n shortcutValue(s, GENERAL_TARGET);\n }",
"public void setTarget(Target target) {\n\t\tthis.target = target;\n\t}",
"public String getSource ();",
"public String getSource() {\n return mSource;\n }",
"String getSource();",
"public Object getSource() {\n\t\treturn source;\n\t}",
"public Object getSource() {\n\t\treturn source;\n\t}",
"void setTarget(Node target) {\n\t\tthis.target = target;\n\t}",
"public String getSource() {\r\n return source;\r\n }",
"public void processLink(String source, String qualifier, String target) throws BeaconException;",
"java.lang.String getSource();",
"java.lang.String getSource();",
"public void addTarget(Target target)\n {\n if (!targets.contains(target))\n {\n targets.add(target);\n }\n }",
"public void addTarget(Target target) {\n SocketChannel socketChannel = null;\n try {\n socketChannel = SocketChannel.open();\n socketChannel.configureBlocking(false);\n socketChannel.connect(target.address);\n target.socketChannel = socketChannel;\n target.connectStart = System.currentTimeMillis();\n synchronized (targets) {\n targets.add(target);\n }\n selector.wakeup();\n } catch (IOException e) {\n// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n if (socketChannel != null) {\n try {\n socketChannel.close();\n } catch (IOException e1) {\n e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }\n target.failure = e;\n addFinishedTarget(target);\n }\n\n }",
"public String getSource() {\n return source;\n }",
"public String getSource() {\n return this.source;\n }",
"Object getTarget();",
"Object getTarget();",
"public Node getSource() {\n return this.source;\n }",
"public String getTarget()\r\n\t{\r\n\t\treturn _target;\r\n\t}",
"public native final String SRC_ADD() /*-{\n\t\treturn this.SRC_ADD;\n\t}-*/;",
"Attribute getTarget();",
"public String getSource() {\n return source;\n }",
"public String getSource() {\n return source;\n }",
"public String getSource() {\n return source;\n }",
"java.lang.String getTarget();",
"java.lang.String getTarget();",
"public abstract String getSource();",
"public String getSource() {\n\n return source;\n }",
"public void setSource(String value) {\n configuration.put(ConfigTag.SOURCE, value);\n }",
"public void setSource(String Source) {\r\n this.Source = Source;\r\n }",
"Node getSourceNode();",
"public Resource getTargetResource();",
"public String getSource() {\r\n return Source;\r\n }",
"@Override\n\tpublic String getSource() {\n\t\treturn source;\n\t}",
"public Target getTarget() {\n return target;\n }",
"public Object getSource() { return this.s; }",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"private void buildSourceTable()\n {\n // validate\n Util.argCheckNull(_dt);\n\n // get entities\n try\n {\n DataSourceDobj ds = _dt.getSourceDataSource();\n Util.argCheckNull(ds);\n Vector entities = ds.getEntities();\n\n // iterate entities\n EntityDobj ent;\n for(int i = 0; entities != null && i < entities.size(); i++)\n {\n // get the entity\n ent = (EntityDobj)entities.elementAt(i);\n\n // add to source table if not in target table\n if(ent != null)\n {\n // search target list\n boolean inTarget = false;\n TransferEntity te;\n for(int j = 0; !inTarget && j < _lstTarget.getDefaultModel().getSize(); j++)\n {\n te = (TransferEntity)_lstTarget.getDefaultModel().getElementAt(j);\n if(te != null && te.getSourceEntityName().equalsIgnoreCase(ent.getName()))\n inTarget = true;\n }\n\n // if !inTarget add to source\n if(!inTarget)\n _lstSource.addItem(ent);\n }\n }\n }\n catch(Exception e)\n {\n throw new RuntimeException(\"TransferEntitiesPanel.buildSourceTable: \" + e.toString());\n }\n }",
"@Override\n public String getSource() {\n return this.src;\n }",
"protected void setLinkOnly(FileNode target){\n\t\t//link = target;\n\t\t//super.setSourcePath(link.getSourcePath());\n\t\tsuper.setVirtualSourceNode(target);\n\t\tif(target != null) super.setSourcePath(target.getSourcePath());\n\t}",
"public Target getTarget() {\n\n return target;\n }",
"public abstract T getSource();",
"public void addSourceChanger(Component component, Class sourceClass)\n {\n component.addAttribute(GlobalAttributes.Value, sourceClass.getCanonicalName().replace(\".\", \"/\"));\n component.setID(sourceClass.getSimpleName() + \"_source\");\n getSourceChanges().put(component, sourceClass);\n }",
"public edu.umich.icpsr.ddi.FileTxtType.Source xgetSource()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTxtType.Source target = null;\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_default_attribute_value(SOURCE$30);\n }\n return target;\n }\n }",
"public AstNode getTarget() {\n return target;\n }",
"public T getSource() {\n return source;\n }",
"public com.commercetools.api.models.common.Reference getTarget() {\n return this.target;\n }",
"ElementCircuit getSource();",
"public void setSource(String value) {\n/* 304 */ setValue(\"source\", value);\n/* */ }",
"java.lang.String getAssociatedSource();",
"public abstract URI target();",
"public Node getTarget() {\n return target;\n }",
"public String getSourceUrl() {\n return sourceUrl;\n }",
"public void setTarget(String targetToAdd) {\n if (targetToAdd.equals(\"\")) {\n throw new BuildException(\"target attribute must not be empty\");\n }\n targets.add(targetToAdd);\n targetAttributeSet = true;\n }",
"protected Source getSource() {\r\n return source;\r\n }"
] | [
"0.5903383",
"0.58928525",
"0.5707582",
"0.5623308",
"0.55846107",
"0.55829394",
"0.5543706",
"0.54691005",
"0.54324186",
"0.541972",
"0.5418117",
"0.53949153",
"0.53927976",
"0.5383903",
"0.53829277",
"0.53829277",
"0.5377642",
"0.53728366",
"0.53701484",
"0.5366631",
"0.53595996",
"0.53485954",
"0.5346709",
"0.53457236",
"0.5342602",
"0.5325643",
"0.5319975",
"0.5306267",
"0.52867895",
"0.5263226",
"0.5245105",
"0.52417",
"0.52373505",
"0.52373505",
"0.5229346",
"0.5225026",
"0.5212171",
"0.52093565",
"0.52054614",
"0.5205086",
"0.52003753",
"0.52003753",
"0.5199885",
"0.51986825",
"0.51746523",
"0.5167584",
"0.5148913",
"0.5117936",
"0.5117936",
"0.511018",
"0.5109742",
"0.5109257",
"0.51084393",
"0.51084393",
"0.51050633",
"0.51011753",
"0.5099515",
"0.50911033",
"0.5079861",
"0.5079861",
"0.5075031",
"0.50640434",
"0.50628513",
"0.505718",
"0.50542307",
"0.50542307",
"0.50542307",
"0.50510263",
"0.50510263",
"0.5046937",
"0.50257057",
"0.50231904",
"0.5022586",
"0.5021463",
"0.50131994",
"0.50097567",
"0.49949947",
"0.49887416",
"0.49807099",
"0.4979532",
"0.4979532",
"0.4979532",
"0.49705276",
"0.49572006",
"0.4950625",
"0.4943404",
"0.49354437",
"0.49289194",
"0.4923533",
"0.49205577",
"0.49188054",
"0.4914724",
"0.49036413",
"0.49024087",
"0.4901793",
"0.4893147",
"0.48902217",
"0.48715553",
"0.4868149",
"0.48615706"
] | 0.49522305 | 84 |
addTarget Removes a target from the link. | public boolean removeTarget(Entity target) {
boolean result = IServer.associationHasTarget().remove(this, target);
IServer.fireLinkUpdated(new LinkEvent(this));
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addTarget(Target target)\n {\n if (!targets.contains(target))\n {\n targets.add(target);\n }\n }",
"public abstract void removeTarget(Component target);",
"public void addTarget(Target target) {\n // XXX check out for name, if null, reject!\n targets.put(target.getName(), target);\n }",
"void unsetTarget();",
"public void addOrReplaceTarget(Target target) {\n addOrReplaceTarget(target.getName(), target);\n }",
"public void setTarget(String targetToAdd) {\n if (targetToAdd.equals(\"\")) {\n throw new BuildException(\"target attribute must not be empty\");\n }\n targets.add(targetToAdd);\n targetAttributeSet = true;\n }",
"public void remTarget(){\n rem(DmpDMSAG.__target);\n }",
"public static void add(String target)\n\t{\n\t\tif (!targets.isEmpty())\n\t\t{\t\t\n\t\t\t// if target does not exist in database\n\t\t\tif (getTargetIndex(target) == -1)\n\t\t\t{\n\t\t\t\ttargets.add(new LinkedList<String>());\n\t\t\t\ttargets.get(targets.size() - 1).add(target);\n\t\t\t}\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\ttargets.add(new LinkedList<String>());\n\t\t\ttargets.get(targets.size() - 1).add(target);\n\t\t}\n\t}",
"public void removeTargetListener(TargetListener l) {\n listenerList.remove(TargetListener.class,l);\n }",
"public abstract void addTarget(Component target);",
"public void addTarget(Target target) {\n SocketChannel socketChannel = null;\n try {\n socketChannel = SocketChannel.open();\n socketChannel.configureBlocking(false);\n socketChannel.connect(target.address);\n target.socketChannel = socketChannel;\n target.connectStart = System.currentTimeMillis();\n synchronized (targets) {\n targets.add(target);\n }\n selector.wakeup();\n } catch (IOException e) {\n// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n if (socketChannel != null) {\n try {\n socketChannel.close();\n } catch (IOException e1) {\n e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }\n target.failure = e;\n addFinishedTarget(target);\n }\n\n }",
"public void addTarget(Target target) throws BuildException {\n addTarget(target.getName(), target);\n }",
"public void setTarget(Target target) {\n\t\tthis.target = target;\n\t}",
"public void setTarget(java.lang.String target) {\n this.target = target;\n }",
"void setTarget(java.lang.String target);",
"public void setTarget(String target) {\n this.target = target;\n }",
"@Override\n\tpublic void del() {\n\t\ttarget.del();\n\t}",
"public void addFinishedTarget(Target target) {\n synchronized (finishedTargets) {\n finishedTargets.notify();\n finishedTargets.add(target);\n }\n }",
"T setUrlTarget(String urlTarget);",
"void setTarget(Node target) {\n\t\tthis.target = target;\n\t}",
"public boolean addTarget(Entity target) {\r\n boolean result = IServer.associationHasTarget().add(this, target);\r\n IServer.fireLinkUpdated(new LinkEvent(this));\r\n return result;\r\n }",
"public void setTargetUrl(String targetUrl) {\n this.targetUrl = targetUrl == null ? null : targetUrl.trim();\n }",
"public void addTarget(String targetName, Target target)\n throws BuildException {\n if (targets.get(targetName) != null) {\n throw new BuildException(\"Duplicate target: `\" + targetName + \"'\");\n }\n addOrReplaceTarget(targetName, target);\n }",
"public void setTarget(String target) {\n this.target = target == null ? null : target.trim();\n }",
"public void addOrReplaceTarget(String targetName, Target target) {\n String msg = \" +Target: \" + targetName;\n log(msg, MSG_DEBUG);\n target.setProject(this);\n targets.put(targetName, target);\n }",
"void detachFromTarget();",
"void detachFromTarget(\n @Optional @ParamName(\"sessionId\") String sessionId,\n @Deprecated @Optional @ParamName(\"targetId\") String targetId);",
"public void removeTarget(String gameUUID) {\n\t\tthis.gameTargetUUIDs.removeTarget(gameUUID);\n\t}",
"public void addConfiguredTarget(TargetElement t) {\n if (targetAttributeSet) {\n throw new BuildException(\n \"nested target is incompatible with the target attribute\");\n }\n String name = t.getName();\n if (name.equals(\"\")) {\n throw new BuildException(\"target name must not be empty\");\n }\n targets.add(name);\n }",
"public void addTargetListener(TargetListener l) {\n listenerList.add(TargetListener.class,l);\n }",
"public void addTarget(String className, String methodName) {\n\t\tshadowstr_addtarget( //\n\t\t\t\tclassName == null ? Py.None : Py.newUnicode(className),\n\t\t\t\tmethodName == null ? Py.None : Py.newUnicode(methodName));\n\t}",
"public void removeRoute(String attribute, TElement listener, String targetName);",
"public void appendTarget(String targetID)\r\n\t{\r\n\t\tif(targetID == null)\r\n\t\t\treturn;\r\n\t\t\r\n\t\tappendOrder(-1, -1, targetID);\r\n\t}",
"void addAjaxTarget(final AjaxTarget target);",
"public void remove(int idTarget){ \r\n cjtMap.remove(idTarget); \r\n }",
"public void onUnlink()\n {\n getTextArea().setFocus(true);\n// clientJupiter.generate(treeOperationFactory.createLink(clientJupiter.getSiteId(),\n// getTextArea().getDocument().getSelection().getRangeAt(0), linkConfig.getUrl()));\n Console.getInstance().log(\"RTP: onUnlink\");\n }",
"protected void setTarget(Command target) {\n\t\tproxy.setTarget(target);\n\t}",
"public void addDoneTarget(int id, Integer myTarget)\n\t\t{\n\t\t\ttargetsDone.add(myTarget);\n\t\t}",
"boolean removeLink(Link link);",
"void resetLink(Link link, Node source, Node target, Dependency type) {\n\t\tlinks.remove(link);\n\t\tlinks.add(new Link(source, target, type, source));\n\t}",
"public T remove(T target);",
"public void executeFromGui(Player target) {\r\n\t\tremoveTrail(target);\r\n\t}",
"private void linkRemoved(Link link) {\n\n\t}",
"void deleteLesson(Module module, Lesson target);",
"public void markSrvTargetNameDelete() throws JNCException {\n markLeafDelete(\"srvTargetName\");\n }",
"public void setLink(FileNode target){\n\t\t/*link = target;\n\t\tsuper.setOffset(0);\n\t\tsuper.setLength(link.getLength());\n\t\tsuper.setSourcePath(link.getSourcePath());*/\n\t\tsuper.setVirtualSourceNode(target);\n\t\tsuper.setOffset(0);\n\t\tif(target != null){\n\t\t\tsuper.setLength(target.getLength());\n\t\t\tsuper.setSourcePath(target.getSourcePath());\n\t\t}\n\t}",
"@Override\n\tpublic void setTarget(Object arg0) {\n\t\tdefaultEdgle.setTarget(arg0);\n\t}",
"public static void unregister(Object target) {\n/* 185 */ if (target != null) {\n/* 186 */ Iterator<Map.Entry<String, AnnotatedAction>> entryIter = actions.entrySet().iterator();\n/* 187 */ while (entryIter.hasNext()) {\n/* 188 */ Map.Entry<String, AnnotatedAction> entry = entryIter.next();\n/* */ \n/* 190 */ Object actionTarget = ((AnnotatedAction)entry.getValue()).getTarget();\n/* */ \n/* 192 */ if (actionTarget == null || actionTarget == target) {\n/* 193 */ entryIter.remove();\n/* */ }\n/* */ } \n/* */ } \n/* */ }",
"public boolean hasTarget() {\n return target != null;\n }",
"public void setTarget(Object t) {\n\n if (!(t instanceof UMLDiagram)) {\n // This is perfectly normal and happens among other things\n // within the call to setDiagram (below).\n LOG.debug(\"target is null in set target or \"\n\t\t + \"not an instance of UMLDiagram\");\n return;\n }\n UMLDiagram newTarget = (UMLDiagram) t;\n\n if (target != null) {\n target.removePropertyChangeListener(\"remove\", this);\n }\n \n newTarget.addPropertyChangeListener(\"remove\", this);\n\n setToolBar(newTarget.getJToolBar());\n\n // NOTE: This listener needs to always be active \n // even if this tab isn't visible\n graph.removeGraphSelectionListener(this);\n graph.setDiagram(newTarget);\n graph.addGraphSelectionListener(this);\n target = newTarget;\n }",
"public Builder clearTargetName() {\n \n targetName_ = getDefaultInstance().getTargetName();\n onChanged();\n return this;\n }",
"T remove(T target);",
"private Node remove(Node target){\n if (target != null) {\n if (target == tail) //***bug:forget to move tail when target is tail\n tail = tail.prev;\n\n target.prev.next = target.next;\n if (target.next!=null) //possible null\n target.next.prev = target.prev;\n\n target.next = null;\n target.prev = null;\n if (key2Node.containsKey(target.key))\n key2Node.remove(target.key); //***bug:forget\n }\n return target;\n }",
"public void removeElement(E targetElement){\n\r\n Node<E> curr = head;\r\n Node<E> prev = null;\r\n\r\n if(curr != null && curr.getItem() == targetElement){\r\n head = curr.getNext();\r\n }\r\n\r\n while (curr != null){\r\n\r\n if(curr.getItem() == targetElement){\r\n curr = curr.getNext();\r\n }\r\n curr = curr.getNext();\r\n }\r\n }",
"public void removeNodeAfterThis() {\r\n\t\tif ( link != null ) {\r\n\t\t\tlink = link.link;\r\n\t\t} // end precondition\r\n\t}",
"public synchronized void remove( StorageObject target )\r\n {\r\n\t if( target == null ) throw new NullPointerException(\r\n\t\t\"Illegal attempt to remove a null target from a list.\");\r\n \r\n Iterator iterator = iterator();\r\n while( iterator.has_next() )\r\n {\r\n try\r\n {\r\n if( iterator.next().equals( target ))\r\n {\r\n iterator.remove();\r\n return;\r\n }\r\n }\r\n catch( NoEntry ne )\r\n {\r\n // ignore this case\r\n }\r\n catch( Throwable e )\r\n {\r\n final String error = \"Internal error while removing a list entry.\";\r\n throw new RuntimeException( error, e );\r\n }\r\n }\r\n }",
"public void setTargetId(Long targetId) {\r\n this.targetId = targetId;\r\n }",
"public void removeSemanticLink(IBusinessObject dest, LinkKind type)\n throws OculusException;",
"public void setTargetName(String targetName) {\r\n this.targetName = targetName;\r\n }",
"public final void mT__61() throws RecognitionException {\n try {\n int _type = T__61;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:129:7: ( 'RemoveLink' )\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:129:9: 'RemoveLink'\n {\n match(\"RemoveLink\"); if (state.failed) return ;\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"void removeSource(McastRoute route, HostId source);",
"public void setTarget(Object method)\n {\n __m_Target = method;\n }",
"public void setTargetName(String targetName) {\n this.targetName = targetName;\n }",
"public void setTarget(double target)\n {\n setTarget(target, null);\n }",
"public void addConfiguredTarget(ProgressTarget target) {\n System.out.println(\"Adding progress target: \" + target.getDisplayName());\n progressTargets.add(target);\n }",
"public void deletelink(Integer linkId);",
"public void setTarget(TestExecutionTarget target) {\n this.target = target;\n }",
"public final void takeTarget(xmf xmf) {\n akcr.b(xmf, \"target\");\n super.takeTarget(xmf);\n xmf.getLifecycle().a(this);\n }",
"protected RemoveLinkAction(PointNode remove) {\n this(remove, remove);\n }",
"public void targetDeleted(long tid) throws RemoteException {\n\n\t\tlogger.create().block(\"targetDeleted\").info().level(1).msg(\n\t\t\t\t\"Adding deleteTarget request to update queue for tid: \" + tid).send();\n\n\t}",
"@Override\n\tpublic int delLink(Link link) {\n\t\treturn 0;\n\t}",
"protected void setLinkOnly(FileNode target){\n\t\t//link = target;\n\t\t//super.setSourcePath(link.getSourcePath());\n\t\tsuper.setVirtualSourceNode(target);\n\t\tif(target != null) super.setSourcePath(target.getSourcePath());\n\t}",
"@Override\r\n\tpublic void onRemove(IGameObject target) {\n\t\ttarget.speed -= flatBonus;\r\n\t\ttarget.speed /= multiplier;\r\n\t\t\r\n\t}",
"@JsonProperty(\"target\")\n public void setTarget(String target) {\n this.target = target;\n }",
"@Override\r\n public boolean remove(E target) {\r\n\r\n if (delete(target) == null) return false;\r\n return true;\r\n }",
"void removeSink(McastRoute route, HostId hostId);",
"void removeHadithUrl(Object oldHadithUrl);",
"public void addAfter(MovieNode target, Object item){\n MovieNode insert = new MovieNode(item);\n insert.next = target.next;\n target.next = insert;\n size++;\n }",
"public StockEvent setUrlTarget(String urlTarget) {\n this.urlTarget = urlTarget;\n return this;\n }",
"public void unset(String target){\n\t\tif (target == null){\n\t\t\tLog.e(NAME, \"Invalid parameters for 'unset' method!\");\n\t\t\treturn;\n\t\t}\n\t\tif (valueCache.containsKey(target)){\n\t\t\tString value = valueCache.get(target);\n\t\t\tdeleteOne(value);\n\t\t\tvalueCache.remove(target);\n\t\t}\n\t}",
"public void setCurrentTarget(Object target) {\r\n if (target instanceof IModelNode) {\r\n newSource = null;\r\n newTarget = (IModelNode) target;\r\n }\r\n }",
"void removeHitListener(HitListener hl);",
"void removeHitListener(HitListener hl);",
"void removeHitListener(HitListener hl);",
"void removeHitListener(HitListener hl);",
"public void removeTargetSetup(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(TARGETSETUP$0, i);\r\n }\r\n }",
"public void delKey(Node target, String key, String value){\n\t\tElement child = (Element) target;\n\t\tString result = child.getAttribute(key);\n\t\tresult = result.replaceFirst(value, \"\");\n\t\tchild.setAttribute(key, result);\n\t\twrite();\n\t}",
"void setTarget(IWfnTransitionAndPlace elem);",
"public void deleteLink(IHyperLink link)\n throws OculusException;",
"public void setTargetid(Integer targetid) {\n this.targetid = targetid;\n }",
"void removeOrderItem(OrderItem target);",
"public void setTarget(String newValue);",
"public void setTarget(String s) { \n shortcutValue(s, GENERAL_TARGET);\n }",
"public org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup addNewTargetSetup()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup target = null;\r\n target = (org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup)get_store().add_element_user(TARGETSETUP$0);\r\n return target;\r\n }\r\n }",
"public void setTarget(String val)\r\n\t{\r\n\t\t_target = val;\r\n\t}",
"public void AddOutgoingLink(Link l) {\r\n\t\tif (l == null) {\r\n\t\t\tSystem.out.println(\"ERROR! Attempted to link a non-existant node!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\toutgoing.addElement(l);\r\n\t\tSystem.out.println(\"Added outgoing link to Node \" + id);\r\n\t}",
"public void deadTarget(String targetID)\r\n\t{\r\n\t\t//Cannot update if we have no orders\r\n\t\tif(subOrders.size() == 0)\r\n\t\t\treturn;\t\t\r\n\t\t\r\n\t\tSubOrder o = targets.get(targetID);\r\n\t\t\r\n\t\tif(o != null)\r\n\t\t\tsubOrders.remove(o);\r\n\t}",
"public boolean addTargetField(Document document, DetailedUrl dUrl, boolean withTargetExtension) {\n boolean result = false;\n\n if (dUrl != null) {\n final String target = dUrl.getTarget(withTargetExtension);\n result = addField(document, target);\n }\n\n return result;\n }",
"public void remTargetObjectClass(){\n rem(DmpDMSAG.__targetObjectClass);\n }",
"private void removeSource(String sourceName) {\n\t\t\n\t}"
] | [
"0.67838347",
"0.6474879",
"0.6295486",
"0.6174199",
"0.59425384",
"0.58816344",
"0.57836056",
"0.5783061",
"0.577638",
"0.5772285",
"0.57236946",
"0.5680576",
"0.56654876",
"0.56624216",
"0.5622766",
"0.560491",
"0.5599662",
"0.5578754",
"0.55721307",
"0.55296516",
"0.5503505",
"0.54955167",
"0.54798746",
"0.5473786",
"0.5459106",
"0.5402524",
"0.53835005",
"0.538064",
"0.535972",
"0.5326226",
"0.5309225",
"0.5290277",
"0.52882206",
"0.5252698",
"0.5247961",
"0.5205036",
"0.5198563",
"0.5168598",
"0.51389563",
"0.51340926",
"0.512684",
"0.51026094",
"0.50879604",
"0.50213563",
"0.49993944",
"0.49991098",
"0.49988452",
"0.49553227",
"0.4949947",
"0.49334002",
"0.49304616",
"0.49148422",
"0.49142897",
"0.48998168",
"0.48951027",
"0.48919758",
"0.48882586",
"0.48788187",
"0.48787355",
"0.48756006",
"0.48742443",
"0.48671812",
"0.48400408",
"0.48364815",
"0.48221582",
"0.48090157",
"0.48035342",
"0.4790851",
"0.47870287",
"0.47850725",
"0.4771407",
"0.47668168",
"0.47643855",
"0.47622928",
"0.4760329",
"0.47346058",
"0.4734294",
"0.47259942",
"0.47247696",
"0.4721631",
"0.47162053",
"0.4679139",
"0.4679139",
"0.4679139",
"0.4679139",
"0.46769705",
"0.4671945",
"0.4663401",
"0.46611467",
"0.46524805",
"0.46462277",
"0.4643932",
"0.4629551",
"0.46271858",
"0.46184817",
"0.46019074",
"0.4599211",
"0.45833474",
"0.45806235",
"0.4579765"
] | 0.6110679 | 4 |
removeTarget Returns the link's target. | public OMCollection getTarget() {
return IServer.associationHasTarget().dr(this).range();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean removeTarget(Entity target) {\r\n boolean result = IServer.associationHasTarget().remove(this, target);\r\n IServer.fireLinkUpdated(new LinkEvent(this));\r\n return result;\r\n }",
"public abstract void removeTarget(Component target);",
"void unsetTarget();",
"public void removeTarget(String gameUUID) {\n\t\tthis.gameTargetUUIDs.removeTarget(gameUUID);\n\t}",
"public void remTarget(){\n rem(DmpDMSAG.__target);\n }",
"public void removeTargetListener(TargetListener l) {\n listenerList.remove(TargetListener.class,l);\n }",
"boolean removeLink(Link link);",
"private void linkRemoved(Link link) {\n\n\t}",
"public void deletelink(Integer linkId);",
"public void removeRoute(String attribute, TElement listener, String targetName);",
"@Override\n\tpublic void del() {\n\t\ttarget.del();\n\t}",
"public T remove(T target);",
"private Node remove(Node target){\n if (target != null) {\n if (target == tail) //***bug:forget to move tail when target is tail\n tail = tail.prev;\n\n target.prev.next = target.next;\n if (target.next!=null) //possible null\n target.next.prev = target.prev;\n\n target.next = null;\n target.prev = null;\n if (key2Node.containsKey(target.key))\n key2Node.remove(target.key); //***bug:forget\n }\n return target;\n }",
"URL getTarget();",
"public static String getTargetByLink(String link) {\n\t\tString target = Constants.BLANK_TARGET;\n\t\tif (StringUtils.isNotBlank(link)) {\n\t\t\tif (!link.toLowerCase().startsWith(Constants.PREFIX_HTTP)\n\t\t\t\t\t|| !link.toLowerCase().startsWith(Constants.PREFIX_HTTPS)) {\n\t\t\t\tif (!Constants.EXTENSION_PATTERN_LINK.matcher(link).matches() && !link.startsWith(\"#\")) {\n\t\t\t\t\ttarget = Constants.SEFL_TARGET;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t}",
"T remove(T target);",
"public String getTarget() {\n return JsoHelper.getAttribute(jsObj, \"target\");\n }",
"public void removeNodeAfterThis() {\r\n\t\tif ( link != null ) {\r\n\t\t\tlink = link.link;\r\n\t\t} // end precondition\r\n\t}",
"public void onUnlink()\n {\n getTextArea().setFocus(true);\n// clientJupiter.generate(treeOperationFactory.createLink(clientJupiter.getSiteId(),\n// getTextArea().getDocument().getSelection().getRangeAt(0), linkConfig.getUrl()));\n Console.getInstance().log(\"RTP: onUnlink\");\n }",
"public void removeDeviceServiceLink();",
"void detachFromTarget();",
"public String getTarget() {\n return this.target;\n }",
"public String getTarget() {\n return target;\n }",
"public String getTarget() {\n return target;\n }",
"@Override\n\tpublic int delLink(Link link) {\n\t\treturn 0;\n\t}",
"public java.lang.String getTarget() {\n return target;\n }",
"String getTarget() {\r\n return this.target;\r\n }",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public final void mT__61() throws RecognitionException {\n try {\n int _type = T__61;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:129:7: ( 'RemoveLink' )\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:129:9: 'RemoveLink'\n {\n match(\"RemoveLink\"); if (state.failed) return ;\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"public void removeLink(String link, TOSCAPlan buildPlan) {\n\t\tNodeList children = buildPlan.getBpelMainFlowLinksElement().getChildNodes();\n\t\tNode toRemove = null;\n\t\tfor (int i = 0; i < children.getLength(); i++) {\n\t\t\tif (children.item(i).getAttributes().getNamedItem(\"name\").getNodeValue().equals(link)) {\n\t\t\t\ttoRemove = children.item(i);\n\t\t\t}\n\t\t\tif (children.item(i).getAttributes().getNamedItem(\"name\").getTextContent().equals(link)) {\n\t\t\t\ttoRemove = children.item(i);\n\t\t\t}\n\n\t\t}\n\t\tif (toRemove != null) {\n\t\t\tbuildPlan.getBpelMainFlowLinksElement().removeChild(toRemove);\n\t\t}\n\n\t}",
"public String getTarget()\r\n\t{\r\n\t\treturn _target;\r\n\t}",
"void detachFromTarget(\n @Optional @ParamName(\"sessionId\") String sessionId,\n @Deprecated @Optional @ParamName(\"targetId\") String targetId);",
"public String getTargetUrl() {\n return targetUrl;\n }",
"public void removeElement(E targetElement){\n\r\n Node<E> curr = head;\r\n Node<E> prev = null;\r\n\r\n if(curr != null && curr.getItem() == targetElement){\r\n head = curr.getNext();\r\n }\r\n\r\n while (curr != null){\r\n\r\n if(curr.getItem() == targetElement){\r\n curr = curr.getNext();\r\n }\r\n curr = curr.getNext();\r\n }\r\n }",
"public Target getTarget() {\n return target;\n }",
"public void removeSemanticLink(IBusinessObject dest, LinkKind type)\n throws OculusException;",
"public Target getTarget() {\n\n return target;\n }",
"public com.commercetools.api.models.common.Reference getTarget() {\n return this.target;\n }",
"public void remTargetObjectClass(){\n rem(DmpDMSAG.__targetObjectClass);\n }",
"public BTreeNode<E> remove(E target) {\n\t\t//important to return the joined node if it causes a merge so the root can be set in BTree if necessary\n\n\t\tif (isLeaf()) {\n\t\t\tdata.remove(target);\n\t\t\t//if it is not the root, handle overflow\n\t\t\tif (parent != null && isUnderflow()) {\n\t\t\t\treturn handleUnderflow(); //if it rotates then it returns nothing bc void method\n\t\t\t}\n\t\t}\n\t\t//the target is an internal node\n\t\telse {\n\t\t\tint index = data.indexOf(target);\n\t\t\tBTreeNode<E> succNode = children.get(index);\n\t\t\twhile (!succNode.isLeaf()) {\n\t\t\t\tsuccNode = succNode.getChild(succNode.children.size() - 1);\n\t\t\t}\n\t\t\t//replace target data with successor data (largest data value) in target node\n\t\t\tdata.set(index, succNode.data.remove(succNode.dataSize() - 1));\n\n\t\t\t//handle underflow \n\t\t\tif (succNode.isUnderflow()) {\n\t\t\t\treturn succNode.handleUnderflow();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n public T remove(T target){\n int index = getIndex(target);\n if(index < 0 || index > size() || isEmpty()){\n throw new NullPointerException();\n } else if(index == 0){\n T element = first.element;\n first = first.successor;\n first.previous = null;\n return element;\n } else{\n DLLNode<T> current = getCurrentNode(index-1);\n T element = current.successor.element;\n current.successor = current.successor.successor;\n if(current.successor == null){\n last = current;\n } else{\n current.successor.previous = current;\n }\n return element;\n }\n }",
"void removeHadithUrl(Object oldHadithUrl);",
"public void remove() {\r\n\t\theadNode.link = headNode.link.link;\r\n\t\tsize--;\r\n\t}",
"public Node getTarget() {\n return target;\n }",
"public DvEHRURI getTarget() {\n return target;\n }",
"@ZAttr(id=775)\n public void unsetDomainAliasTargetId() throws com.zimbra.common.service.ServiceException {\n HashMap<String,Object> attrs = new HashMap<String,Object>();\n attrs.put(Provisioning.A_zimbraDomainAliasTargetId, \"\");\n getProvisioning().modifyAttrs(this, attrs);\n }",
"String getTarget();",
"String getTarget();",
"@Override\n public T remove(T target){\n if (isEmpty()) {//if list is empty, there's nothing to remove\n return null;\n }\n //if list is not empty\n DLNode<T> current = first; //a reference pointing to the first element\n int index = 0; //we need to find the index of target element with a loop\n while (current != null && !current.elem.equals(target)) {\n current = current.next;\n index++;\n }\n if (current != null && current.elem.equals(target)) {\n return remove(index); //call remove(index) method here when the require index is found\n }\n return null;\n\n }",
"@Override\n public String getTarget()\n {\n return null;\n }",
"public void remove(int idTarget){ \r\n cjtMap.remove(idTarget); \r\n }",
"Attribute getTarget();",
"public void deleteLink(IHyperLink link)\n throws OculusException;",
"java.lang.String getTarget();",
"java.lang.String getTarget();",
"public void removeTargetSetup(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(TARGETSETUP$0, i);\r\n }\r\n }",
"void deleteLesson(Module module, Lesson target);",
"public Object getTarget()\n {\n return __m_Target;\n }",
"public void removeServiceEntry(String linkName);",
"public static void removeRitualTargetItem(Item ritualItem) {\n/* 118 */ if (ritualTargetItems.contains(ritualItem)) {\n/* 119 */ ritualTargetItems.remove(ritualItem);\n/* */ }\n/* */ }",
"public void unsetSrvTargetNameValue() throws JNCException {\n delete(\"srv-target-name\");\n }",
"public final GetHTTP removeUrl() {\n properties.remove(URL_PROPERTY);\n return this;\n }",
"public String getTargetName() {\n return this.targetName;\n }",
"public NameValue<String, String> removeSourceURL() {\n return removeURL(mSourceMap);\n }",
"public AstNode getTarget() {\n return target;\n }",
"public static void unregister(Object target) {\n/* 185 */ if (target != null) {\n/* 186 */ Iterator<Map.Entry<String, AnnotatedAction>> entryIter = actions.entrySet().iterator();\n/* 187 */ while (entryIter.hasNext()) {\n/* 188 */ Map.Entry<String, AnnotatedAction> entry = entryIter.next();\n/* */ \n/* 190 */ Object actionTarget = ((AnnotatedAction)entry.getValue()).getTarget();\n/* */ \n/* 192 */ if (actionTarget == null || actionTarget == target) {\n/* 193 */ entryIter.remove();\n/* */ }\n/* */ } \n/* */ } \n/* */ }",
"public String getTargetName() {\n\t\treturn targetName;\n\t}",
"Object getTarget();",
"Object getTarget();",
"public synchronized void remove( StorageObject target )\r\n {\r\n\t if( target == null ) throw new NullPointerException(\r\n\t\t\"Illegal attempt to remove a null target from a list.\");\r\n \r\n Iterator iterator = iterator();\r\n while( iterator.has_next() )\r\n {\r\n try\r\n {\r\n if( iterator.next().equals( target ))\r\n {\r\n iterator.remove();\r\n return;\r\n }\r\n }\r\n catch( NoEntry ne )\r\n {\r\n // ignore this case\r\n }\r\n catch( Throwable e )\r\n {\r\n final String error = \"Internal error while removing a list entry.\";\r\n throw new RuntimeException( error, e );\r\n }\r\n }\r\n }",
"public String targetId() {\n return this.targetId;\n }",
"public Living getTarget();",
"void removeSource(McastRoute route, HostId source);",
"public Point getTarget()\n\t{\n\t\treturn this.target;\n\t}",
"public void removeRuleRef(org.semanticwb.model.RuleRef value);",
"public void markSrvTargetNameDelete() throws JNCException {\n markLeafDelete(\"srvTargetName\");\n }",
"@Transactional\n public void remove(ExtensionLinkEntity link) {\n EntityManager entityManager = entityManagerProvider.get();\n link = findById(link.getLinkId());\n if (null != link) {\n entityManager.remove(link);\n }\n }",
"protected void removeReference()\n {\n }",
"@Override\r\n public boolean remove(E target) {\r\n\r\n if (delete(target) == null) return false;\r\n return true;\r\n }",
"public Node target() {\n return target;\n }",
"public void unset(String target){\n\t\tif (target == null){\n\t\t\tLog.e(NAME, \"Invalid parameters for 'unset' method!\");\n\t\t\treturn;\n\t\t}\n\t\tif (valueCache.containsKey(target)){\n\t\t\tString value = valueCache.get(target);\n\t\t\tdeleteOne(value);\n\t\t\tvalueCache.remove(target);\n\t\t}\n\t}",
"public void\t\tremoveUCallbackListener(String\t\ttag);",
"public Point getTarget() {\n\t\treturn _target;\n\t}",
"public NameValue<String, String> removeDestURL() {\n return removeURL(mDestMap);\n }",
"public org.w3.x2005.sparqlResults.LinkDocument.Link getLink()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.w3.x2005.sparqlResults.LinkDocument.Link target = null;\n target = (org.w3.x2005.sparqlResults.LinkDocument.Link)get_store().find_element_user(LINK$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }",
"protected RemoveLinkAction(PointNode remove) {\n this(remove, remove);\n }",
"public boolean removeLink(L link) {\n if(links.remove(link)){\n //Se link existe, retira o seu parentesco\n if(link != null)\n link.setParent(null);\n\n notifyRemoved(NCLElementSets.LINKS, link);\n return true;\n }\n return false;\n }",
"private void onRemove() throws Exception\n {\n // get the target list selection\n Object selection[] = _lstTarget.getSelectedValues();\n\n // iterate the selection\n TransferEntity te;\n EntityDobj table;\n for(int i = 0; selection != null && i < selection.length; i++)\n {\n // get the te\n te = (TransferEntity)selection[i];\n if(te != null)\n {\n // get the associate entitydobj\n table = _dt.getSourceDataSource().getEntity(te.getSourceEntityName());\n if(table != null)\n {\n // add to the source list\n _lstSource.addItem(table);\n\n // remove from ds\n _dt.removeTransferEntity(te, true);\n }\n }\n }\n\n // remove the selection from the target list\n for(int i = 0; selection != null && i < selection.length; i++)\n {\n // get the table\n te = (TransferEntity)selection[i];\n if(te != null)\n _lstTarget.removeItem(te);\n }\n }",
"@NotNull\n Resource getTarget();",
"@Override\n\tpublic void removeGoal(Goal g) {\n\t\t\n\t}",
"protected String getTargetUrl() {\n // Get the next target URL\n String target = this.endpointUrls.get(this.nextTarget);\n LOGGER.trace(\"Current nextTarget: \\\"{}\\\", targetUrl: \\\"{}\\\"\", this.nextTarget, target);\n // Update next pointer\n this.nextTarget = this.nextTarget == this.endpointUrls.size() - 1 ? 0 : this.nextTarget + 1;\n LOGGER.trace(\"New nextTarget: \\\"{}\\\"\", this.nextTarget);\n return target;\n }",
"private int handleUnlink(String name) {\n\t\tboolean succeeded = ThreadedKernel.fileSystem.remove(name);\n\t\t//if the file was not removed return error\n\t\tif(!succeeded)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}",
"public Name getTarget() {\n\t\treturn getSingleName();\n\t}",
"public void setTargetUrl(String targetUrl) {\n this.targetUrl = targetUrl == null ? null : targetUrl.trim();\n }",
"public Long getTargetId() {\r\n return targetId;\r\n }",
"public Player getTarget() {\n return target;\n }",
"void removeListener(BotListener l);",
"public static void remove() {\n if (create()) {\n DOM.removeChild((com.google.gwt.user.client.Element) \n tag.getParentElement(), \n (com.google.gwt.user.client.Element) tag);\n tag = null;\n removed = true;\n }\n }",
"void removeSWFURL(String toRemove);"
] | [
"0.67614686",
"0.65316075",
"0.64657086",
"0.6191451",
"0.6158579",
"0.6015278",
"0.59995085",
"0.578125",
"0.5739708",
"0.5649675",
"0.56350523",
"0.5616295",
"0.5559053",
"0.5533191",
"0.5529451",
"0.54373795",
"0.53974444",
"0.537566",
"0.5364767",
"0.53427196",
"0.5335934",
"0.5316",
"0.5300719",
"0.5300719",
"0.52940303",
"0.52826816",
"0.52626723",
"0.5249541",
"0.5249541",
"0.5249541",
"0.5244848",
"0.524338",
"0.52336305",
"0.5217591",
"0.5192041",
"0.5188271",
"0.5179161",
"0.5177733",
"0.51664495",
"0.51605225",
"0.51448864",
"0.5135686",
"0.5106246",
"0.50933874",
"0.5081625",
"0.5065474",
"0.5055473",
"0.5044527",
"0.50433457",
"0.50433457",
"0.5039523",
"0.5038557",
"0.5029757",
"0.50128746",
"0.5010819",
"0.49980912",
"0.49980912",
"0.49963596",
"0.49930727",
"0.4987806",
"0.49779263",
"0.49460742",
"0.49429548",
"0.49360782",
"0.49240375",
"0.4910097",
"0.4908069",
"0.49061516",
"0.49023926",
"0.4898056",
"0.4898056",
"0.48790336",
"0.48481387",
"0.48469222",
"0.48374543",
"0.48326427",
"0.48221913",
"0.47686163",
"0.47656786",
"0.4764119",
"0.47549644",
"0.47398046",
"0.47335133",
"0.47334442",
"0.4720021",
"0.4713812",
"0.47116008",
"0.4709831",
"0.4708172",
"0.47029004",
"0.47024184",
"0.46942657",
"0.4685769",
"0.46713954",
"0.46599385",
"0.46579173",
"0.465487",
"0.46547323",
"0.46540305",
"0.46528515",
"0.46423087"
] | 0.0 | -1 |
getTarget Returns all links having a specific data object as source. | public static OMCollection getLinkBySource(Entity source) {
return IServer.associationHasSource().rr(source).domain();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static OMCollection getLinkByTarget(Entity target) {\r\n return IServer.associationHasTarget().rr(target).domain();\r\n }",
"public Hashtable getTargets() {\n return targets;\n }",
"Object getTarget();",
"Object getTarget();",
"public List<Link> getTargetConnections() {\n\t\treturn inputLinks;\n\t}",
"public OMCollection getTarget() {\r\n return IServer.associationHasTarget().dr(this).range();\r\n }",
"public List<Target> getTargets()\n {\n return targets;\n }",
"public com.commercetools.api.models.common.Reference getTarget() {\n return this.target;\n }",
"public static ArrayList<String> getTargets() {\r\n return TARGETS;\r\n }",
"@NotNull\n Resource getTarget();",
"@objid (\"3390963b-d6b2-4509-8979-45543db839db\")\n <T extends BpmnDataAssociation> List<T> getTargetOfDataAssociation(java.lang.Class<T> filterClass);",
"public Object getTargetObject() {\n return targetObject;\n }",
"URL getTarget();",
"@NotNull\n Resource getTargetContent();",
"public Living getTarget();",
"@Override\r\n\tpublic List<Targets> getTarget_info(int id) {\n\t\treturn target_infoDao.getTarget_info(id);\r\n\t}",
"public Object getTarget()\n {\n return __m_Target;\n }",
"private void linkTargets(ISequenceComponent seq) throws Exception {\n\t\tif (seq == null) {\n\t\t\tlogger.create().block(\"linkTargets\").info().level(1).msg(\"Group sequence is null, no targets to link\")\n\t\t\t\t\t.send();\n\t\t\treturn;\n\t\t}\n\t\tif (seq instanceof XIteratorComponent) {\n\t\t\t// extract from each sub-element\n\n\t\t\tXIteratorComponent xit = (XIteratorComponent) seq;\n\t\t\tList list = xit.listChildComponents();\n\t\t\tIterator ic = list.iterator();\n\t\t\twhile (ic.hasNext()) {\n\t\t\t\tISequenceComponent cseq = (ISequenceComponent) ic.next();\n\t\t\t\tlinkTargets(cseq);\n\t\t\t}\n\t\t} else if (seq instanceof XBranchComponent) {\n\t\t\t// there should be no targets in here !\n\n\t\t} else {\n\t\t\t// this is an executive - only check slew and target-select\n\n\t\t\tXExecutiveComponent xec = (XExecutiveComponent) seq;\n\t\t\tIExecutiveAction action = xec.getExecutiveAction();\n\n\t\t\tif (action instanceof ITargetSelector) {\n\t\t\t\tITarget target = ((ITargetSelector) action).getTarget();\n\t\t\t\tif (target == null)\n\t\t\t\t\tthrow new Exception(\"TargetSelector:\" + seq.getComponentName() + \" had null target\");\n\t\t\t\t// link the target to one from table\n\t\t\t\tITarget ctarget = targets.get(target.getID());\n\t\t\t\tif (ctarget == null)\n\t\t\t\t\tthrow new Exception(\"Target: \" + target.getName() + \" is not known\");\n\t\t\t\t((XTargetSelector) action).setTarget(ctarget);\n\n\t\t\t} else if (action instanceof ISlew) {\n\t\t\t\tITarget target = ((ISlew) action).getTarget();\n\t\t\t\tif (target == null)\n\t\t\t\t\tthrow new Exception(\"TargetSelector:\" + seq.getComponentName() + \" had null target\");\n\t\t\t\t// link the target to one from table\n\t\t\t\tITarget ctarget = targets.get(target.getID());\n\t\t\t\tif (ctarget == null)\n\t\t\t\t\tthrow new Exception(\"Target: \" + target.getName() + \" is not known\");\n\t\t\t\t((XSlew) action).setTarget(ctarget);\n\t\t\t}\n\t\t}\n\t}",
"String getTarget();",
"String getTarget();",
"public ArrayList<LinkedList<Node>> getTargets(){\n\t\treturn targets;\n\t}",
"public ArrayList getTargetList() {\r\n\t\treturn targetList;\r\n\t}",
"public Target getTarget() {\n return target;\n }",
"public String getTarget() {\n return this.target;\n }",
"@objid (\"ef92d9d1-93c5-49d4-9ec8-65c4eb806567\")\n EList<BpmnDataAssociation> getTargetOfDataAssociation();",
"public List getTargetConnections() {\n return new ArrayList(targetConnections);\n }",
"public java.util.Enumeration getTargets() {\n return targets.elements();\n }",
"public PyList getTargets() {\n\t\treturn (PyList) shadowstr_gettargets();\n\t}",
"public DvEHRURI getTarget() {\n return target;\n }",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"@objid (\"19651663-f981-4f11-802a-d5d7cbd6f88a\")\n Instance getTarget();",
"@InVertex\n Object getTarget();",
"public String getTarget() {\n return target;\n }",
"public String getTarget() {\n return target;\n }",
"public String getTarget() {\n return JsoHelper.getAttribute(jsObj, \"target\");\n }",
"Attribute getTarget();",
"String getTarget() {\r\n return this.target;\r\n }",
"public Set<GrouperProvisioningTarget> getViewableTargets() {\r\n \r\n GrouperObject grouperObject = null;\r\n \r\n GuiGroup guiGroup = GrouperRequestContainer.retrieveFromRequestOrCreate().getGroupContainer().getGuiGroup();\r\n GuiStem guiStem = GrouperRequestContainer.retrieveFromRequestOrCreate().getStemContainer().getGuiStem();\r\n \r\n if (guiGroup != null) {\r\n grouperObject = guiGroup.getGrouperObject();\r\n }\r\n if (guiStem != null) {\r\n grouperObject = guiStem.getGrouperObject();\r\n }\r\n \r\n Map<String, GrouperProvisioningTarget> targets = GrouperProvisioningSettings.getTargets(true);\r\n Subject loggedInSubject = GrouperUiFilter.retrieveSubjectLoggedIn();\r\n \r\n Set<GrouperProvisioningTarget> viewableTargets = new HashSet<GrouperProvisioningTarget>();\r\n \r\n for (GrouperProvisioningTarget target: targets.values()) {\r\n if (GrouperProvisioningService.isTargetViewable(target, loggedInSubject, grouperObject)) {\r\n viewableTargets.add(target);\r\n }\r\n }\r\n \r\n return viewableTargets;\r\n }",
"public String getTarget()\r\n\t{\r\n\t\treturn _target;\r\n\t}",
"public java.lang.CharSequence getTargetObjectUri() {\n return target_object_uri;\n }",
"public Target getTarget() {\n\n return target;\n }",
"public Node getTarget() {\n return target;\n }",
"public java.lang.CharSequence getTargetObjectUri() {\n return target_object_uri;\n }",
"public Resource getTargetResource();",
"public java.lang.String getTarget() {\n return target;\n }",
"List<T> getRuleTargets();",
"Object getTargetexists();",
"public List<GrouperProvisioningTarget> getEditableTargets() {\r\n \r\n GrouperObject grouperObject = null;\r\n \r\n GuiGroup guiGroup = GrouperRequestContainer.retrieveFromRequestOrCreate().getGroupContainer().getGuiGroup();\r\n GuiStem guiStem = GrouperRequestContainer.retrieveFromRequestOrCreate().getStemContainer().getGuiStem();\r\n \r\n if (guiGroup != null) {\r\n grouperObject = guiGroup.getGrouperObject();\r\n }\r\n if (guiStem != null) {\r\n grouperObject = guiStem.getGrouperObject();\r\n }\r\n \r\n Map<String, GrouperProvisioningTarget> targets = GrouperProvisioningSettings.getTargets(true);\r\n Subject loggedInSubject = GrouperUiFilter.retrieveSubjectLoggedIn();\r\n \r\n Set<GrouperProvisioningTarget> editableTargets = new HashSet<GrouperProvisioningTarget>();\r\n \r\n for (GrouperProvisioningTarget target: targets.values()) {\r\n if (GrouperProvisioningService.isTargetEditable(target, loggedInSubject, grouperObject)) {\r\n editableTargets.add(target);\r\n }\r\n }\r\n \r\n List<GrouperProvisioningTarget> editableTargetsSorted = new ArrayList<>(editableTargets);\r\n \r\n editableTargetsSorted.sort(new Comparator<GrouperProvisioningTarget>() {\r\n\r\n @Override\r\n public int compare(GrouperProvisioningTarget o1, GrouperProvisioningTarget o2) {\r\n return o1.getExternalizedName().compareTo(o2.getExternalizedName());\r\n }\r\n });\r\n \r\n return editableTargetsSorted;\r\n }",
"java.lang.String getTarget();",
"java.lang.String getTarget();",
"@Returns(\"targetInfos\")\n @ReturnTypeParameter(TargetInfo.class)\n List<TargetInfo> getTargets();",
"public abstract Object getSource();",
"public EObject getTarget() {\n\t\treturn adaptee.getTarget();\n\t}",
"public AstNode getTarget() {\n return target;\n }",
"@Override public Map<L, Integer> sources(L target) {\r\n Map<L, Integer> res= new HashMap <L, Integer>();\r\n \tif(!vertices.contains(target)) {\r\n \t\t//System.out.println(target+\" is not in the graph!\");\r\n \t\treturn res;\r\n \t}\r\n \tIterator<Edge<L>> iter=edges.iterator();\r\n \twhile(iter.hasNext()) {\r\n \t\tEdge<L> tmp=iter.next();\r\n \t\t//if(tmp.getTarget()==target)\r\n \t\tif(tmp.getTarget().equals(target))\r\n \t\t\r\n \t\t\tres.put(tmp.getSource(), tmp.getWeight());\r\n \t\t\r\n \t}\r\n \tcheckRep();\r\n \treturn res;\r\n }",
"public Object getTarget() {\n return this.endpoints;\n }",
"public IdentifierListNode getTargets()throws ClassCastException;",
"@JsonProperty(\"target\")\n public String getTarget() {\n return target;\n }",
"java.lang.String getAssociatedSource();",
"public String getTargetUrl() {\n return targetUrl;\n }",
"public Spatial getTarget() {\r\n return target;\r\n }",
"public Map<Integer, TargetDef> getTargetQueries();",
"public LibraryRef getTarget() {\n return new LibraryRef((JsonObject) json.get(\"target\"));\n }",
"private List loadTargetList(HttpServletRequest request) {\n\t\tTargetDao targetDao = (TargetDao) getBean(\"TargetDao\");\n\t\treturn targetDao.getTargets(AgnUtils.getCompanyID(request));\n\t\t\n\t}",
"public List<String> getLinks();",
"List<Link> getLinks();",
"public Name getTarget() {\n\t\treturn getSingleName();\n\t}",
"@Test\n\tpublic void testGetLinksOtherProperties() {\n\t\tList<String> results = helper.getLinks(\"drop tables; <A target=\\\"self\\\" href=\\\"test.com\\\"> junk junk\",\n\t\t\t\t\"http://www.bobbylough.com\");\n\t\tassertEquals(1, results.size());\n\t\tassertEquals(\"test.com\", results.get(0));\n\t}",
"protected String getTargetUrl() {\n // Get the next target URL\n String target = this.endpointUrls.get(this.nextTarget);\n LOGGER.trace(\"Current nextTarget: \\\"{}\\\", targetUrl: \\\"{}\\\"\", this.nextTarget, target);\n // Update next pointer\n this.nextTarget = this.nextTarget == this.endpointUrls.size() - 1 ? 0 : this.nextTarget + 1;\n LOGGER.trace(\"New nextTarget: \\\"{}\\\"\", this.nextTarget);\n return target;\n }",
"public Object getSource() {return source;}",
"@Override public Map<L, Integer> targets(L source) {\r\n \t Map<L, Integer> res= new HashMap <L, Integer>();\r\n \tif(!vertices.contains(source)) {\r\n \t\t//System.out.println(source+\" is not in the graph!\");\r\n \t\treturn res;\r\n \t}\r\n \tIterator<Edge<L>> iter=edges.iterator();\r\n \twhile(iter.hasNext()) {\r\n \t\tEdge<L> tmp=iter.next();\r\n \t\t//if(tmp.getSource()==source)\r\n \t\tif(tmp.getSource().equals(source))\r\n \t\t\tres.put(tmp.getTarget(), tmp.getWeight());\r\n \t\t\r\n \t}\r\n \tcheckRep();\r\n \treturn res;\r\n\r\n }",
"public List getLinks() {\r\n List links = getElements(\"a\");\r\n ArrayList result = new ArrayList();\r\n for (int i = 0; i < links.size(); i++) {\r\n try {\r\n StandAloneElement keep = ((StandAloneElement)links.get(i));\r\n result.add(parseUrl(keep.getAttribute(\"href\")));\r\n } catch (Exception e) {\r\n }\r\n }\r\n links = getElements(\"FRAME\");\r\n for (int i = 0; i < links.size(); i++) {\r\n try {\r\n StandAloneElement keep = ((StandAloneElement)links.get(i));\r\n result.add(parseUrl(keep.getAttribute(\"src\")));\r\n } catch (Exception e) {\r\n }\r\n }\r\n\r\n return result;\r\n }",
"Ontology getTargetOntology();",
"EValidTargetTypes getTargets();",
"private void getMyTargetsList() {\n try {\n\n String qryTargets = Constants.Targets+ \"?$filter=\" +Constants.KPIGUID+ \" eq guid'\"\n + mStrBundleKpiGUID+\"'\" ;\n ArrayList<MyTargetsBean> alMyTargets = OfflineManager.getMyTargetsList(qryTargets, mStrParnerGuid,\n mStrBundleKpiName, mStrBundleKpiCode, mStrBundleKpiGUID,\n mStrBundleCalBased, mStrBundleKpiFor,\n mStrBundleCalSource, mStrBundleRollup,mStrBundleKPICat,true);\n\n ArrayList<MyTargetsBean> alOrderValByOrderMatGrp = OfflineManager.getActualTargetByOrderMatGrp(CRSSKUGroupWiseTargetsActivity.this,mStrCPDMSDIV);\n mapMyTargetValByCRSSKU = getALOrderVal(alOrderValByOrderMatGrp);\n mapMyTargetVal = getALMyTargetList(alMyTargets);\n sortingValues();\n } catch (OfflineODataStoreException e) {\n sortingValues();\n LogManager.writeLogError(Constants.strErrorWithColon + e.getMessage());\n }\n }",
"public java.lang.Object[] getSourceAsReference() {\n return sourceAsReference;\n }",
"public String getLink();",
"com.google.protobuf.ByteString getTargetBytes();",
"public Collection<Map<String, String>> getLinks();",
"public OMCollection getSource() {\r\n return IServer.associationHasSource().dr(this).range();\r\n }",
"List<ProductLink> links();",
"public DNode getTo() { return targetnode; }",
"String getLink();",
"private Target getMatchingTarget(Element targetElement)\n {\n String targetName = targetElement.getAttribute(\"name\").getValue();\n\n for (Target target : targets)\n {\n String label = target.getName();\n\n if (label.equals(targetName))\n {\n return target;\n }\n }\n\n return null;\n }",
"public Set<URL> getTargetPageURLs(){\n\t\tSet<URL> urls = new HashSet<URL>();\n\t\tString url = \"http://www.infoq.com/news/2012/12/twemproxy;jsessionid=1652D82C3359CBAB67DA00B26BE7784B\";\n\t\turls.add(URL.valueOf(url));\n\t\treturn urls;\n\t}",
"public List<String> getTargetSubjects(int targetId) {\r\n \t\r\n \tCollection<String> targetNeighbours = jungCompleteGraph.getOutEdges(targetId);\r\n \tList<String> targetSubjects = new ArrayList<>();\r\n \tfor (String edge: targetNeighbours) {\r\n \t\t\r\n \t\tif(edge.contains(\"http://purl.org/dc/terms/subject\")){\r\n \t\t\tList<String> tokens = Arrays.asList(getURI(jungCompleteGraph.getDest(edge)).replace(\"http://dbpedia.org/resource/Category:\", \"\").split(\"_\"));\r\n \t\t\ttargetSubjects.addAll(tokens);\r\n \t\t\t}\r\n \t}\r\n \t\r\n \treturn targetSubjects;\r\n \t\r\n }",
"public Node target() {\n return target;\n }",
"public interface Link<T> {\n\n /**\n * Resolve the link and get the underlying object.\n *\n * @return the target of the link, not null\n * @throws DataNotFoundException if the link is not resolved\n */\n T resolve();\n\n /**\n * Get the type of the object that this link targets.\n *\n * @return the type of the object, not null\n */\n Class<T> getTargetType();\n\n // TODO - do we want a method to generate a resolved version of a config object e.g. new ResolvedConfigLink(resolver.resolve())\n}",
"public ObjectSequentialNumber getTarget() {\n return target;\n }",
"public EntityID getTarget() {\n\t\treturn target.getValue();\n\t}",
"public Set<String> getLinks() {\n return links;\n }",
"public ArrayList<Habitat> getTargets(Habitat source) {\r\n\t\t// return empty list if the habitat isn't inserted in the target list\r\n\t\tif (!habitatToTargetList.containsKey(source.getID()+\"\")) return new ArrayList<Habitat>();\r\n\t\t\r\n\t\t// return target list\r\n\t\treturn habitatToTargetList.get(\"\"+source.getID());\r\n\t}",
"public DomainTarget[] getDomainTargets() {\n return (DomainTarget[]) this.domainTargets.clone();\n }",
"public Object getDestination() {\n/* 339 */ return this.peer.getTarget();\n/* */ }",
"@NonNull List<SaldoLink> getLinks() {\n return links;\n }",
"public static List<SemanticGraphEdge> getTargetEdgesOnTarget(final Iterable<SemanticGraphEdge> edges,\n\t\t\tfinal GeneralPosRelationEnum targetType, final boolean isSource) {\n\t\tfinal List<SemanticGraphEdge> targetEdges = new ArrayList<SemanticGraphEdge>();\n\n\t\tfor (SemanticGraphEdge edge : edges) {\n\t\t\tif (!isSource && targetType.contains(edge.getTarget().tag())) {\n\t\t\t\ttargetEdges.add(edge);\n\t\t\t}\n\t\t\tif (isSource && targetType.contains(edge.getSource().tag())) {\n\t\t\t\ttargetEdges.add(edge);\n\t\t\t}\n\t\t}\n\t\treturn targetEdges;\n\t}",
"private List<Category> extractTargets() {\n List<String> names = getNames(\"category\");\n CategorySelectAsyncTask task = new CategorySelectAsyncTask();\n CategoryMapper mapper = new CategoryMapper();\n task.setNames(names);\n List<Category> list = new ArrayList<>();\n try {\n list.addAll(mapper.to(task.execute().get()));\n } catch (ExecutionException | InterruptedException e) {\n Log.e(TAG, \"extractTargets: \" + e.getMessage(), e);\n }\n return list;\n }",
"public String targetId() {\n return this.targetId;\n }"
] | [
"0.6409983",
"0.60997313",
"0.6072584",
"0.6072584",
"0.60067123",
"0.5871391",
"0.5858219",
"0.58404887",
"0.5758981",
"0.5729984",
"0.57293934",
"0.5724214",
"0.5714987",
"0.5699295",
"0.56602144",
"0.5646374",
"0.56362826",
"0.5627123",
"0.56271076",
"0.56271076",
"0.5599527",
"0.556695",
"0.5550666",
"0.55496585",
"0.5543639",
"0.55429554",
"0.55398035",
"0.5537212",
"0.55360276",
"0.5533021",
"0.5533021",
"0.5533021",
"0.55196476",
"0.5518992",
"0.5516946",
"0.5516946",
"0.5514279",
"0.5508052",
"0.5501721",
"0.5493633",
"0.5490038",
"0.54884857",
"0.547336",
"0.54726666",
"0.546577",
"0.5464101",
"0.54493886",
"0.5428241",
"0.54152817",
"0.5404506",
"0.53984",
"0.53984",
"0.53717816",
"0.5341321",
"0.5330484",
"0.53126603",
"0.531087",
"0.5302007",
"0.5295971",
"0.5263472",
"0.5259921",
"0.52335465",
"0.520595",
"0.519194",
"0.5191481",
"0.5182581",
"0.51806796",
"0.516455",
"0.5163309",
"0.516308",
"0.51449275",
"0.51391846",
"0.5132662",
"0.51216894",
"0.51173013",
"0.5109732",
"0.51050913",
"0.5097262",
"0.50966096",
"0.50754344",
"0.5074878",
"0.50691724",
"0.50623477",
"0.5054407",
"0.504823",
"0.5033902",
"0.5024875",
"0.5020028",
"0.5008148",
"0.50080276",
"0.49875173",
"0.49831322",
"0.49770418",
"0.49741337",
"0.49732274",
"0.4968943",
"0.4965171",
"0.4964756",
"0.49615163",
"0.4954601"
] | 0.52110255 | 62 |
getLinkBySource Returns all links having a specific data object as target. | public static OMCollection getLinkByTarget(Entity target) {
return IServer.associationHasTarget().rr(target).domain();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static OMCollection getLinkBySource(Entity source) {\r\n return IServer.associationHasSource().rr(source).domain();\r\n }",
"public boolean addSource(Entity source) {\r\n boolean result = IServer.associationHasSource().add(this, source);\r\n IServer.fireLinkUpdated(new LinkEvent(this));\r\n return result;\r\n }",
"@Test\n\tpublic void sourcesTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_0.addVertices(vertices);\n\t\tgraph.addEdge(edge_0);\n\t\tassertTrue(graph.sources(B).keySet().contains(A));\n\t\tassertTrue(graph.sources(B).get(A) == 1);\n\t}",
"java.lang.String getAssociatedSource();",
"@Override public Map<L, Integer> sources(L target) {\r\n Map<L, Integer> res= new HashMap <L, Integer>();\r\n \tif(!vertices.contains(target)) {\r\n \t\t//System.out.println(target+\" is not in the graph!\");\r\n \t\treturn res;\r\n \t}\r\n \tIterator<Edge<L>> iter=edges.iterator();\r\n \twhile(iter.hasNext()) {\r\n \t\tEdge<L> tmp=iter.next();\r\n \t\t//if(tmp.getTarget()==target)\r\n \t\tif(tmp.getTarget().equals(target))\r\n \t\t\r\n \t\t\tres.put(tmp.getSource(), tmp.getWeight());\r\n \t\t\r\n \t}\r\n \tcheckRep();\r\n \treturn res;\r\n }",
"@Override public Map<L, Integer> targets(L source) {\r\n \t Map<L, Integer> res= new HashMap <L, Integer>();\r\n \tif(!vertices.contains(source)) {\r\n \t\t//System.out.println(source+\" is not in the graph!\");\r\n \t\treturn res;\r\n \t}\r\n \tIterator<Edge<L>> iter=edges.iterator();\r\n \twhile(iter.hasNext()) {\r\n \t\tEdge<L> tmp=iter.next();\r\n \t\t//if(tmp.getSource()==source)\r\n \t\tif(tmp.getSource().equals(source))\r\n \t\t\tres.put(tmp.getTarget(), tmp.getWeight());\r\n \t\t\r\n \t}\r\n \tcheckRep();\r\n \treturn res;\r\n\r\n }",
"public void setSourceId(String source) {\n this.sourceId = sourceId;\n }",
"@SubL(source = \"cycl/sbhl/sbhl-link-methods.lisp\", position = 828) \n public static final SubLObject sbhl_access_links(SubLObject node, SubLObject direction) {\n {\n SubLObject result = NIL;\n SubLObject link = sbhl_graphs.get_sbhl_graph_link(node, sbhl_module_vars.get_sbhl_module(UNPROVIDED));\n result = sbhl_links.get_sbhl_mt_links(link, direction, sbhl_module_vars.get_sbhl_module(UNPROVIDED));\n return result;\n }\n }",
"public boolean removeSource(Entity source) {\r\n boolean result = IServer.associationHasSource().remove(this, source);\r\n IServer.fireLinkUpdated(new LinkEvent(this));\r\n return result;\r\n }",
"public String getUrl(final String sourceURL) {\n\n String result = null;\n\n if (sourceURL == null) {\n // if only one URL is configured, \"default URL\" should mean that\n // URL.\n List<String> urls = descriptor().getUrls();\n if (!urls.isEmpty()) {\n result = urls.get(0);\n }\n return result;\n }\n for (String j : descriptor().getUrls()) {\n if (j.equals(sourceURL)) {\n result = j;\n break;\n }\n }\n return result;\n }",
"public Object getSource() {return source;}",
"boolean hasSource();",
"@ARule(\n\t\tsa = 66,\n\t\tdesc = \"Every link must have exactly one activity as source and one as target\",\n\t\tauthor = \"[email protected]\",\n\t\tdate = \"02/17/2007\",\n\t\terrors=\"BPELC_LINK__NAME_USED\"\n\t)\n\tpublic void rule_CheckIfSourceAlreadyUsed_12 () {\n\t\t\n\t\tfTargetMap = getValue(fFlowNode, FlowValidator.TARGET_MAP,null);\n\t\t\t\t\t\n\t\tIProblem problem;\n\t\t\n\t\tif (fTargetMap.containsKey(ncName)) {\n\t\t\tproblem = createError();\n\t\t\tproblem.fill(\"BPELC_LINK__NAME_USED\",\n\t\t\t\ttoString(mNode.nodeName()),\n\t\t\t\tncName\n\t\t\t);\t\t\t\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\t//\ttargets/target\n\t\tfTargetMap.put( ncName, mNode.parentNode().parentNode() );\n\t}",
"public abstract Object getSource();",
"public boolean containsDataSource(DataSource source) {\n for (DataSource s:datasources) {\n // if (s.equals(source)) System.err.println(s.toString()+\" <= EQUALS => \"+source.toString());\n // else if (s.hasSameOrigin(source)) System.err.println(s.toString()+\" <= SAME SOURCE => \"+source.toString()+ \". Diff=\"+s.reportFirstDifference(source));\n if (s.equals(source)) return true;\n }\n return false;\n }",
"public IBusinessObject copyHyperLinksOf(IBusinessObject source)\n throws OculusException;",
"public static List<SemanticGraphEdge> getTargetEdgesOnEdgeAndSource(final Iterable<SemanticGraphEdge> edges,\n\t\t\tfinal Word source, final GeneralPosRelationEnum sourceType, final GeneralPosRelationEnum targetType,\n\t\t\tfinal GeneralPosRelationEnum relationType, final boolean isSource) {\n\t\tfinal List<SemanticGraphEdge> targetEdges = new ArrayList<SemanticGraphEdge>();\n\n\t\tfor (SemanticGraphEdge edge : edges) {\n\t\t\tGrammaticalRelation relation = edge.getRelation();\n\n\t\t\tif (relationType.contains(relation.toString())) {\n\t\t\t\tif (isSource && targetType.contains(edge.getSource().tag()) && sourceType.contains(source.getPosTag())) {\n\t\t\t\t\ttargetEdges.add(edge);\n\t\t\t\t}\n\t\t\t\tif (!isSource && targetType.contains(edge.getTarget().tag()) && sourceType.contains(source.getPosTag())) {\n\t\t\t\t\ttargetEdges.add(edge);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn targetEdges;\n\t}",
"public boolean isSource() {\n\t\treturn direction.isSource();\n\t}",
"public boolean isSource();",
"static boolean isValidLinkTarget(LWLink link, LWComponent linkSource, LWComponent linkTarget)\n {\n if (linkTarget == linkSource && linkSource != null) {\n if (DEBUG.LINK) reject(linkTarget, \"source == target\");\n return false;\n }\n // TODO: allow loop-back link if it's a CURVED link...\n\n // don't allow links between parents & children\n if (linkSource != null) {\n if (linkTarget.getParent() == linkSource ||\n linkSource.getParent() == linkTarget) {\n if (DEBUG.LINK) reject(linkTarget, \"parent-child link\");\n return false;\n }\n if (linkTarget != null) {\n if (!linkSource.canLinkTo(linkTarget)) {\n if (DEBUG.LINK) reject(linkTarget, \"source denies target; src=\" + linkSource);\n return false;\n }\n }\n }\n\n if (link != null && linkTarget == link.getParent()) {\n // if a link is inside something, don't link to it (?)\n if (DEBUG.LINK) reject(linkTarget, \"target is parent of the new link\");\n return false;\n }\n\n if (link != null && linkTarget instanceof LWLink && linkTarget.isConnectedTo(link)) {\n // Don't permit a link to link back to a link that's connected to it.\n if (DEBUG.LINK) reject(linkTarget, \"this link already connected to target\");\n return false;\n }\n\n\n// New code, tho we don't actually need these constraints:\n// if (linkTarget instanceof LWLink) {\n// if (DEBUG.LINK) outln(\"target is link: \" + linkTarget);\n// if (linkTarget.isConnectedTo(linkSource)) {\n// if (DEBUG.LINK) reject(linkTarget, \"target link-to-link loop\");\n// return false;\n// } else if (link != null && linkTarget.isConnectedTo(link)) {\n// if (DEBUG.LINK) reject(linkTarget, \"this link already connected to target\");\n// return false;\n// }\n// }\n \n// if (linkSource instanceof LWLink) {\n// if (linkSource.isConnectedTo(linkTarget)) {\n// if (DEBUG.LINK) reject(linkTarget, \"source link-to-link loop; src=\" + linkSource);\n// return false;\n// }// else if (link != null\n// }\n\n\n return true;\n\n\n// The old code: \n// boolean ok = true;\n// if (linkTarget instanceof LWLink) {\n// LWLink target = (LWLink) linkTarget;\n// ok &= (target.getHead() != linkSource &&\n// target.getTail() != linkSource);\n// }\n// if (linkSource instanceof LWLink) {\n// LWLink source = (LWLink) linkSource;\n// ok &= (source.getHead() != linkTarget &&\n// source.getTail() != linkTarget);\n// }\n// return ok;\n }",
"@NotNull\n EntityIterable getSource();",
"public void setSource(Object o) {\n\t\tsource = o;\n\t}",
"public Object getSource() {\n return source;\n }",
"@objid (\"780bebb2-6884-4789-bdef-ca10444ad5fb\")\n Link getLink();",
"boolean isSource();",
"public static List<SemanticGraphEdge> getTargetEdgesOnTarget(final Iterable<SemanticGraphEdge> edges,\n\t\t\tfinal GeneralPosRelationEnum targetType, final boolean isSource) {\n\t\tfinal List<SemanticGraphEdge> targetEdges = new ArrayList<SemanticGraphEdge>();\n\n\t\tfor (SemanticGraphEdge edge : edges) {\n\t\t\tif (!isSource && targetType.contains(edge.getTarget().tag())) {\n\t\t\t\ttargetEdges.add(edge);\n\t\t\t}\n\t\t\tif (isSource && targetType.contains(edge.getSource().tag())) {\n\t\t\t\ttargetEdges.add(edge);\n\t\t\t}\n\t\t}\n\t\treturn targetEdges;\n\t}",
"public OMCollection getSource() {\r\n return IServer.associationHasSource().dr(this).range();\r\n }",
"public void setSourceAttribute(String id) {\n this.sourceAttribute = id;\n }",
"@Override\n public boolean link(T dataX, T dataY) throws NodeNotFoundException { return link(dataX, dataY, 1.0); }",
"public com.google.protobuf.ByteString\n getAssociatedSourceBytes() {\n java.lang.Object ref = associatedSource_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n associatedSource_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"Link getIsReuseOf();",
"public Object getSource() {\n\t\treturn source;\n\t}",
"public Object getSource() {\n\t\treturn source;\n\t}",
"List<ProductLink> links();",
"public boolean isSource()\n\t{\n\t\treturn isSource;\n\t}",
"@objid (\"4e37aa68-c0f7-4404-a2cb-e6088f1dda62\")\n Instance getSource();",
"public abstract Source getSource();",
"private void buildSourceTable()\n {\n // validate\n Util.argCheckNull(_dt);\n\n // get entities\n try\n {\n DataSourceDobj ds = _dt.getSourceDataSource();\n Util.argCheckNull(ds);\n Vector entities = ds.getEntities();\n\n // iterate entities\n EntityDobj ent;\n for(int i = 0; entities != null && i < entities.size(); i++)\n {\n // get the entity\n ent = (EntityDobj)entities.elementAt(i);\n\n // add to source table if not in target table\n if(ent != null)\n {\n // search target list\n boolean inTarget = false;\n TransferEntity te;\n for(int j = 0; !inTarget && j < _lstTarget.getDefaultModel().getSize(); j++)\n {\n te = (TransferEntity)_lstTarget.getDefaultModel().getElementAt(j);\n if(te != null && te.getSourceEntityName().equalsIgnoreCase(ent.getName()))\n inTarget = true;\n }\n\n // if !inTarget add to source\n if(!inTarget)\n _lstSource.addItem(ent);\n }\n }\n }\n catch(Exception e)\n {\n throw new RuntimeException(\"TransferEntitiesPanel.buildSourceTable: \" + e.toString());\n }\n }",
"public void setSourceID(java.lang.Object sourceID) {\n this.sourceID = sourceID;\n }",
"public abstract Link getLink(LinkContext context) throws AccessException;",
"boolean hasSourceId();",
"public interface Source {\n\n /**\n * Set the system identifier for this Source.\n * <p>\n * The system identifier is optional if the source does not get its data\n * from a URL, but it may still be useful to provide one. The application\n * can use a system identifier, for example, to resolve relative URIs and to\n * include in error messages and warnings.\n * </p>\n *\n * @param systemId\n * The system identifier as a URL string.\n */\n public void setSystemId(String systemId);\n\n /**\n * Get the system identifier that was set with setSystemId.\n *\n * @return The system identifier that was set with setSystemId, or null if\n * setSystemId was not called.\n */\n public String getSystemId();\n}",
"public boolean isSetSource()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(SOURCE$30) != null;\n }\n }",
"public void setSource(Source s)\n\t{\n\t\tsource = s;\n\t}",
"List<Link> getLinks();",
"public boolean isListenerForSource(Object source) {\n return true;\n }",
"public boolean isSource() {\r\n \t\treturn source;\r\n \t}",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getAssociatedSourceBytes() {\n java.lang.Object ref = associatedSource_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n associatedSource_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public URI getSource() {\n return source;\n }",
"@Override\n public Collection<Source> getSources() {\n\n Map<String, Source> sources = new HashMap<String, Source>();\n\n out: for (Map.Entry<String, Container> path : containers.entrySet()) {\n String sourceId = path.getKey();\n Container container = path.getValue();\n\n for (String map : categoryMaps.keySet()) {\n if (map.endsWith(\"/\")) {\n map = map.substring(0, map.lastIndexOf(\"/\"));\n }\n if (map.endsWith(sourceId)) {\n continue out;\n }\n }\n\n System.err.println(\"Doing source \" + sourceId);\n\n sourceId = applyCategoryMaps(sourceId);\n\n if (sourceId.isEmpty()) {\n continue;\n }\n\n if (sourceId.indexOf(\"/\") == -1 && !sourceId.isEmpty()) {\n if (sources.get(sourceId) == null) {\n String sourceIdShort = sourceId;\n sourceId = \"Catchup/Sources/\" + sourceIdShort;\n String sourceName = container.getTitle();\n Source source = new Source();\n source.setSourceId(sourceIdShort);\n source.setId(sourceId);\n source.setShortName(sourceName);\n source.setLongName(sourceName);\n source.setServiceUrl(\"/category?sourceId=\" + sourceId + \";type=html\");\n URI iconUri = container.getFirstPropertyValue(DIDLObject.Property.UPNP.ALBUM_ART_URI.class);\n URL iconUrl = normaliseURI(iconUri);\n final String iconUrlString = iconUrl == null ? null : iconUrl.toString();\n source.setIconUrl(iconUrlString);\n sources.put(sourceId, source);\n }\n }\n\n\n\n\n }\n\n\n return sources.values();\n }",
"public List<Link> getTargetConnections() {\n\t\treturn inputLinks;\n\t}",
"public String getSource() {\n\t\treturn (String) _object.get(\"source\");\n\t}",
"public static Set<NetworkNode.TYPE> getConnectedHosts(NetworkNode.TYPE source){\n Set<NetworkNode.TYPE> connectedHosts = new HashSet<>();\n if(source.equals(NetworkNode.TYPE.ADVERSARY)){\n connectedHosts.add(NetworkNode.TYPE.ROUTER);\n connectedHosts.add(NetworkNode.TYPE.WEBSERVER);\n connectedHosts.add(NetworkNode.TYPE.ADMINPC);\n return connectedHosts;\n }else if (source.equals(NetworkNode.TYPE.ROUTER)){\n connectedHosts.add(NetworkNode.TYPE.WEBSERVER);\n connectedHosts.add(NetworkNode.TYPE.ADMINPC);\n connectedHosts.add(NetworkNode.TYPE.DATABASE);\n return connectedHosts;\n }else if (source.equals(NetworkNode.TYPE.WEBSERVER)){\n connectedHosts.add(NetworkNode.TYPE.ROUTER);\n connectedHosts.add(NetworkNode.TYPE.ADMINPC);\n connectedHosts.add(NetworkNode.TYPE.DATABASE);\n return connectedHosts;\n }else if (source.equals(NetworkNode.TYPE.ADMINPC)){\n connectedHosts.add(NetworkNode.TYPE.ROUTER);\n connectedHosts.add(NetworkNode.TYPE.WEBSERVER);\n connectedHosts.add(NetworkNode.TYPE.DATABASE);\n return connectedHosts;\n }else if (source.equals(NetworkNode.TYPE.DATABASE)){\n connectedHosts.add(NetworkNode.TYPE.ROUTER);\n connectedHosts.add(NetworkNode.TYPE.WEBSERVER);\n connectedHosts.add(NetworkNode.TYPE.ADMINPC);\n return connectedHosts;\n }else {\n return connectedHosts;\n }\n }",
"public HarvestSource getSource() {\n\t\treturn source;\n\t}",
"public java.lang.Object[] getSourceAsReference() {\n return sourceAsReference;\n }",
"protected void addSourcePropertyDescriptor(Object object) {\n\t\t\n\t\titemPropertyDescriptors.add(new EdgeSourcePropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),\n\t\t\t\tgetResourceLocator(), getString(\"_UI_Edge_source_feature\"), getString(\n\t\t\t\t\t\t\"_UI_PropertyDescriptor_description\", \"_UI_Edge_source_feature\",\n\t\t\t\t\t\t\"_UI_Edge_type\"), HenshinPackage.Literals.EDGE__SOURCE));\n\t}",
"public Node getSource() {\n return this.source;\n }",
"private void computeShortestPathsFromSource(V source) {\n\t\tBFSDistanceLabeler<V, E> labeler = new BFSDistanceLabeler<V, E>();\n\t\tlabeler.labelDistances(mGraph, source);\n\t\tdistances = labeler.getDistanceDecorator();\n\t\tMap<V, Number> currentSourceSPMap = new HashMap<V, Number>();\n\t\tMap<V, E> currentSourceEdgeMap = new HashMap<V, E>();\n\n\t\tfor (V vertex : mGraph.getVertices()) {\n\n\t\t\tNumber distanceVal = distances.get(vertex);\n\t\t\t// BFSDistanceLabeler uses -1 to indicate unreachable vertices;\n\t\t\t// don't bother to store unreachable vertices\n\t\t\tif (distanceVal != null && distanceVal.intValue() >= 0) {\n\t\t\t\tcurrentSourceSPMap.put(vertex, distanceVal);\n\t\t\t\tint minDistance = distanceVal.intValue();\n\t\t\t\tfor (E incomingEdge : mGraph.getInEdges(vertex)) {\n\t\t\t\t\tfor (V neighbor : mGraph\n\t\t\t\t\t\t\t.getIncidentVertices(incomingEdge)) {\n\t\t\t\t\t\tif (neighbor.equals(vertex))\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t// V neighbor = mGraph.getOpposite(vertex,\n\t\t\t\t\t\t// incomingEdge);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tNumber predDistanceVal = distances.get(neighbor);\n\n\t\t\t\t\t\tint pred_distance = predDistanceVal.intValue();\n\t\t\t\t\t\tif (pred_distance < minDistance && pred_distance >= 0) {\n\t\t\t\t\t\t\tminDistance = predDistanceVal.intValue();\n\t\t\t\t\t\t\tcurrentSourceEdgeMap.put(vertex, incomingEdge);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmDistanceMap.put(source, currentSourceSPMap);\n\t\tmIncomingEdgeMap.put(source, currentSourceEdgeMap);\n\t}",
"public Object getSourceReference() { return this._sourceRef; }",
"public edu.umich.icpsr.ddi.FileTxtType.Source xgetSource()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTxtType.Source target = null;\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_default_attribute_value(SOURCE$30);\n }\n return target;\n }\n }",
"public boolean isLink(String label)\n {\n return true;\n }",
"@Override\r\n\tpublic boolean isSymmetricLink(Entity source, Entity target)\r\n\t{\r\n\t\treturn (directedGraph.findEdge(source, target) != null)\r\n\t\t\t\t&& (directedGraph.findEdge(target, source) != null);\r\n\t}",
"com.google.protobuf.ByteString\n getAssociatedSourceBytes();",
"public static List <IndividualLink> getAllForSetOfLinks(String schema, Long set_of_links_id){\r\n\t\t\r\n\t\tMultiSchemaHibernateUtil.beginTransaction(schema);\r\n\r\n\t\tList returnList = MultiSchemaHibernateUtil.getSession(schema).createQuery(\r\n\t\t\t\t\"from IndividualLink where set_of_links_id = :set_of_links_id order by id\")\r\n\t\t\t\t.setLong(\"set_of_links_id\", set_of_links_id)\r\n\t\t\t\t.list(); //$NON-NLS-1$\r\n\r\n\t\tMultiSchemaHibernateUtil.commitAndCloseTransaction(schema);\r\n\r\n\t\treturn returnList; \r\n\t}",
"Coverage getSource( int sourceDataIndex )\n throws IndexOutOfBoundsException;",
"public void setSourceNode(String sourceNode) {\n this.sourceNode = sourceNode;\n }",
"@Nullable\n static ListenableFuture<List<TargetInfo>> getTargetsBuildingSource(LocationContext context) {\n if (!SourceToTargetProvider.hasProvider()) {\n return null;\n }\n // early-out if source is trivially covered by project targets (e.g. because there's a wildcard\n // target pattern for the parent package)\n if (context.getImportRoots().packageInProjectTargets(context.blazePackage)) {\n return null;\n }\n // Finally, query the exact targets building this source file.\n // This is required to handle project targets which failed to build\n return Futures.transform(\n SourceToTargetHelper.findTargetsBuildingSourceFile(\n context.project, context.workspacePath.relativePath()),\n (Function<List<TargetInfo>, List<TargetInfo>>)\n (List<TargetInfo> result) ->\n result == null || sourceInProjectTargets(context, fromTargetInfo(result))\n ? ImmutableList.of()\n : result,\n MoreExecutors.directExecutor());\n }",
"@Override\r\n public List<Link> getLinks(Turn inTurn, Player inPlayer) throws Exception\r\n {\r\n return getGameState().getLinkList();\r\n }",
"public void set_source(EndpointID source) {\r\n\t\tsource_ = source;\r\n\t}",
"@JsonProperty(\"source\")\n public Source getSource() {\n return source;\n }",
"DatasetFileService getSource();",
"private void link(String sourceInstance, String targetInstance, Tuple<String, String> queries) {\n\t\t// Adapt queries to sample instances\n\t\tTuple<String,String> newQueries = queries;\n\t\tif(sourceInstance!=null && targetInstance!=null) {\n\t\t\t// if sourceInstance and targetInstance are not null, add the clauses:\n\t\t\t//\t\t\"WHERE source.id = sourceInstance\" to queries.getFirstElement()\n\t\t\t//\t\t\"WHERE target.id = targetInstance\" to queries.getSecondElement()\n\t\t}\n\t\texecuteSourceQuery(newQueries.getFirstElement(), newQueries.getSecondElement());\n\t}",
"protected StmtIterator getRelationshipSourceIter(Resource resource, SKOSObjectProperty skosObjectProperty, SKOSConceptScheme conceptScheme, SKOSCollection skosCollection) {\n if (resource != null) {\n if (skosObjectProperty != null) {\n Property property = PropertyFactory.create(skosObjectProperty);\n StmtFilter csFilter = null;\n if (conceptScheme!=null) {\n Resource csRes = this.getJenaResource(conceptScheme);\n if (csRes != null) {\n Property inSchemeProp = PropertyFactory.inScheme;\n csFilter = new StmtSubjectHasPropertyFilter(inSchemeProp, csRes);\n }\n else return null;\n }\n StmtFilter collFilter = null;\n if (skosCollection!=null) {\n Resource collRes = this.getJenaResource(skosCollection);\n if (collRes != null) {\n collFilter = new StmtSubjectIsPropertyOfFilter(collRes, PropertyFactory.member);\n }\n else return null;\n }\n\n StmtFilter stmtFilter = null;\n\n if (csFilter != null) {\n if (collFilter != null) {\n stmtFilter = new AndStmtFilter(csFilter);\n ((AndStmtFilter)stmtFilter).add(collFilter);\n }\n else {\n stmtFilter = csFilter;\n }\n }\n else {\n if (collFilter != null) {\n stmtFilter = collFilter;\n }\n }\n\n Selector selector;\n if (stmtFilter != null) selector = new FilteredSelector((Resource)null, property, resource, stmtFilter);\n else selector = new SimpleSelector(resource, property, (RDFNode)null);\n\n return this.model.listStatements(selector);\n }\n else throw new IllegalArgumentException(\"SKOSObjectProperty must not be null!\");\n }\n else return null;\n }",
"public Vertex getSource() {\n return source;\n }",
"public String getSourceId() {\n return sourceId;\n }",
"public Iterator<List<URL>> getUrlIterator(Context context,\n LinearLayout listUrlGroups,\n InputSource source) {\n \tList<List<URL>> urlLists = getUrlLists(context, \n listUrlGroups,\n source);\n \treturn urlLists != null && urlLists.size() > 0\n ? urlLists.iterator() \n : null;\n }",
"@Override\n\tpublic boolean equals(Object o) {\n\t\tif (this == o) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!(o instanceof ImageSource)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tImageSource that = (ImageSource) o;\n\t\tif (this.id != null ? !this.id.equals(that.id) : that.id != null) return false;\n\n\t\treturn true;\n\t}",
"public NodeKey createNodeKeyWithSource( String sourceName );",
"public abstract boolean containsLink(Integer linkId);",
"public String getLink();",
"@ApiModelProperty(value = \"The source of the data.\")\n public String getSource() {\n return source;\n }",
"public List<Node> getShortestPath(final Node source, final Node target) {\n if (D[source.id][target.id] == Integer.MAX_VALUE) {\n return new ArrayList<Node>(); // no path\n }\n final List<Node> path = getIntermediatePath(source, target);\n path.add(0, source);\n path.add(target);\n return path;\n }",
"public URL getLinkURL(String field, String id) throws UnimplementedFeatureException, DataSourceException {\n return null;\n }",
"@objid (\"41478043-fa77-40f4-a16f-953b85cd578a\")\n <T extends BpmnDataAssociation> List<T> getSourceOfDataAssociation(java.lang.Class<T> filterClass);",
"@Override\r\n\t\t\tpublic IHierarchicalKey caseDirectedRelationship(\r\n\t\t\t\t\tDirectedRelationship object) {\r\n\t\t\t\tSet<IHierarchicalKey> sources = new java.util.HashSet<IHierarchicalKey>();\r\n\t\t\t\tSet<IHierarchicalKey> targets = new java.util.HashSet<IHierarchicalKey>();\r\n\r\n\t\t\t\tfor (Element next : object.getSources()) {\r\n\t\t\t\t\tif (next.eIsProxy()) {\r\n\t\t\t\t\t\tnext = (Element) EcoreUtil.resolve(next, context);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsources.add(getKey(next));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (Element next : object.getTargets()) {\r\n\t\t\t\t\tif (next.eIsProxy()) {\r\n\t\t\t\t\t\tnext = (Element) EcoreUtil.resolve(next, context);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttargets.add(getKey(next));\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn new DirectedRelationshipKey(object, sources, targets);\r\n\t\t\t}",
"public java.util.List<org.landxml.schema.landXML11.SourceDataDocument.SourceData> getSourceDataList()\r\n {\r\n final class SourceDataList extends java.util.AbstractList<org.landxml.schema.landXML11.SourceDataDocument.SourceData>\r\n {\r\n public org.landxml.schema.landXML11.SourceDataDocument.SourceData get(int i)\r\n { return SurfaceImpl.this.getSourceDataArray(i); }\r\n \r\n public org.landxml.schema.landXML11.SourceDataDocument.SourceData set(int i, org.landxml.schema.landXML11.SourceDataDocument.SourceData o)\r\n {\r\n org.landxml.schema.landXML11.SourceDataDocument.SourceData old = SurfaceImpl.this.getSourceDataArray(i);\r\n SurfaceImpl.this.setSourceDataArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.SourceDataDocument.SourceData o)\r\n { SurfaceImpl.this.insertNewSourceData(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.SourceDataDocument.SourceData remove(int i)\r\n {\r\n org.landxml.schema.landXML11.SourceDataDocument.SourceData old = SurfaceImpl.this.getSourceDataArray(i);\r\n SurfaceImpl.this.removeSourceData(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return SurfaceImpl.this.sizeOfSourceDataArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new SourceDataList();\r\n }\r\n }",
"public int sourceToDatabase(Source source) throws ClassNotFoundException, SQLException\n\t{\n\t\tint sourceId; //Variable used for returning value of source's id.\n\t\t\n\t\ttry\n\t\t{\n\t\t\tClass.forName(\"org.postgresql.Driver\"); //Getting driver from \"org.postgresql.Driver\".\n\t\t\tconn = DriverManager.getConnection(\"jdbc:postgresql://localhost/postgres\", \"postgres\", \"postgres\"); //Connecting to a database.\n\t\t\tstatement = conn.createStatement();\n\t\t\t\n\t\t\tcheckIfExists = \"SELECT id_src FROM sources WHERE link = '\" + source.link + \"'\"; //Checking if specified source.\n\t\t\t\n\t\t\tstatement.execute(checkIfExists);\n\t\t\tresultSet = statement.getResultSet();\n\t\t\t\n\t\t\tif (resultSet.next()) //If source already exists method should return its id.\n\t\t\t\tsourceId = resultSet.getInt(1);\n\t\t\t\n\t\t\telse //If source doesn't exist yet, it has to be created and method should return its id.\n\t\t\t{\n\t\t\t\tstatement.execute(\"INSERT INTO sources (type, abstract, link) VALUES (\" + source.sourceToSave() + \");\"); //Inserting source into database.\n\t\t\t\tstatement.execute(checkIfExists);\n\t\t\t\tresultSet = statement.getResultSet();\n\t\t\t\tresultSet.next();\n\t\t\t\tsourceId = resultSet.getInt(1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfinally\n\t\t{\n\t\t\tif (conn != null) conn.close();\n\t\t}\n\t\t\n\t\treturn sourceId;\n\t}",
"public void setSourceObjectId(String sourceObjectId) {\n this.sourceObjectId = sourceObjectId;\n }",
"public Edge getEdgeReference(Node sourceNode) {\r\n\t\t\t\r\n\t\tEdge edgeReference = null;\r\n\t\tfor (Edge to: edges)\r\n\t\t{\r\n\t\t\tif (to.getDestinationNode().getLabel().equals(sourceNode.getLabel()))\r\n\t\t\t{\r\n\t\t\t\tedgeReference = to;\r\n\t\t\t\tbreak;\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn edgeReference;\r\n\t}",
"@GET\n @Path(\"/source/{id}\")\n @Produces(\"application/json;charset=UTF-8\")\n @GZIP\n @NoCache\n public SourceVo getSource(@PathParam(\"id\") Integer id) throws Exception {\n return sourceService.findById(id)\n .toVo(DataFilter.get());\n }",
"String getLink();",
"public void setSource(String source) {\n _source = source;\n }",
"public void xsetSource(edu.umich.icpsr.ddi.FileTxtType.Source source)\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTxtType.Source target = null;\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().add_attribute_user(SOURCE$30);\n }\n target.set(source);\n }\n }",
"public List<Node> computeDijkstraShortestPath(Node source, Node destination) {\n\n source.minDistance = 0.;\n PriorityQueue<Node> nodeQueue = new PriorityQueue<Node>();\n nodeQueue.add(source);\n\n int destinationGroup = destination._groupID;\n\n while (!nodeQueue.isEmpty()) {\n Node v = nodeQueue.poll();\n\n Log.i(\"bbb\", \"In dijsk node name \"+ v._waypointName);\n //Stop searching when reach the destination node\n\n\n if(destinationGroup!=0){\n\n if(v._groupID==destinationGroup){\n destination = navigationGraph.get(navigationGraph.size()-1).nodesInSubgraph.get(v._waypointID);\n Log.i(\"bbb\", \"destination is: \"+destination._waypointName);\n\n break;\n }\n\n }\n\n if (v._waypointID.equals(destination._waypointID))\n break;\n\n\n // Visit each edge that is adjacent to v\n for (Edge e : v._edges) {\n Node a = e.target;\n Log.i(\"bbb\", \"node a \"+a._waypointName);\n double weight = e.weight;\n double distanceThroughU = v.minDistance + weight;\n if (distanceThroughU < a.minDistance) {\n nodeQueue.remove(a);\n a.minDistance = distanceThroughU;\n a.previous = v;\n Log.i(\"bbb\", \"set previous\");\n nodeQueue.add(a);\n }\n }\n }\n\n Log.i(\"bbb\", \"destination is: \"+destination._waypointName);\n\n return getShortestPathToDestination(destination);\n }",
"public Node source() {\n return source;\n }",
"public String sourceResourceId() {\n return this.sourceResourceId;\n }",
"public String sourceResourceId() {\n return this.sourceResourceId;\n }",
"public String getLinkName();",
"public java.lang.String getLink() {\n\t\treturn dataCacheEntry.getLink();\n\t}",
"public org.LexGrid.commonTypes.Source[] getSource() {\n return source;\n }"
] | [
"0.6729209",
"0.5205657",
"0.5115916",
"0.511153",
"0.5084776",
"0.50482726",
"0.5018457",
"0.4993151",
"0.49410963",
"0.48803434",
"0.4842882",
"0.48407993",
"0.48063946",
"0.47913697",
"0.47702974",
"0.47649863",
"0.47564706",
"0.47438785",
"0.47309253",
"0.47064155",
"0.47011557",
"0.4699288",
"0.46984157",
"0.46960238",
"0.4682344",
"0.46252853",
"0.46142766",
"0.46014658",
"0.45959795",
"0.45703694",
"0.4568095",
"0.45596352",
"0.45596352",
"0.4534723",
"0.45297346",
"0.45270833",
"0.4516483",
"0.45136738",
"0.45109898",
"0.4489146",
"0.4488515",
"0.44874817",
"0.4487071",
"0.44837096",
"0.44695136",
"0.4464812",
"0.44612035",
"0.4460462",
"0.4450334",
"0.44455495",
"0.44452867",
"0.44397175",
"0.44396725",
"0.44248328",
"0.44182363",
"0.4413141",
"0.44096753",
"0.4409101",
"0.44062948",
"0.44059026",
"0.4398261",
"0.43955752",
"0.43944582",
"0.43931872",
"0.43809158",
"0.4375666",
"0.43634304",
"0.43601406",
"0.43559045",
"0.43542585",
"0.43520322",
"0.43497765",
"0.43468097",
"0.43434998",
"0.43424556",
"0.43411133",
"0.43379804",
"0.4326936",
"0.43206012",
"0.4320427",
"0.4317369",
"0.43167064",
"0.43106294",
"0.43042788",
"0.4303121",
"0.43005016",
"0.42869633",
"0.42826158",
"0.42819116",
"0.42743918",
"0.42706442",
"0.4267724",
"0.4266739",
"0.426518",
"0.42641085",
"0.42602074",
"0.42602074",
"0.42596984",
"0.4256693",
"0.4249612"
] | 0.5111301 | 4 |
getLinkByTarget Returns the string to be used to label this object. | @Override
public synchronized String getLabelExtension() {
int sourceSize = (getSource() != null) ? 1 : 0;
int targetSize = (getTarget() != null) ? getTarget().size() : 0;
String prefix = (!super.getLabelExtension().equals(Constant.EMPTY_STRING)) ? super
.getLabelExtension()
: Schema.TYPE_LINK;
return prefix + Constant.BLANK + Constant.OPEN_PARENTHESIS + sourceSize
+ Constant.COMMA + Constant.BLANK + targetSize
+ Constant.CLOSE_PARENTHESIS;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public java.lang.String getTarget() {\n return target;\n }",
"public String getTarget() {\n return this.target;\n }",
"public String getTarget() {\n return target;\n }",
"public String getTarget() {\n return target;\n }",
"String getTarget() {\r\n return this.target;\r\n }",
"java.lang.String getTarget();",
"java.lang.String getTarget();",
"public String getTarget()\r\n\t{\r\n\t\treturn _target;\r\n\t}",
"String getTarget();",
"String getTarget();",
"public java.lang.String getTargetName() {\n java.lang.Object ref = targetName_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n targetName_ = s;\n return s;\n }\n }",
"public String getTargetName() {\n return this.targetName;\n }",
"public java.lang.String getTargetName() {\n java.lang.Object ref = targetName_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n targetName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public abstract String getManipulatorLinkLabel();",
"public String getTargetName() {\n\t\treturn targetName;\n\t}",
"public Link linkTo() {\n Label text = Label.of(name);\n URIObject target = FSURICodec.encode(this);\n return Link.textTarget(text, target);\n }",
"public String getLinkName();",
"@NotNull\n public static String getTargetLabel(@NotNull IAndroidTarget target) {\n if (!target.isPlatform()) {\n return String.format(\"%1$s (API %2$s)\", target.getFullName(), target.getVersion().getApiString());\n }\n AndroidVersion version = target.getVersion();\n if (version.isPreview()) {\n return String.format(\"API %d+: %s\", target.getVersion().getApiLevel(), target.getName());\n }\n String name = SdkVersionInfo.getAndroidName(target.getVersion().getApiLevel());\n if (name != null) {\n return name;\n }\n String release = target.getProperty(\"ro.build.version.release\"); //$NON-NLS-1$\n if (release != null) {\n return String.format(\"API %1$d: Android %2$s\", version.getApiLevel(), release);\n }\n return String.format(\"API %1$d\", version.getApiLevel());\n }",
"public Name getTarget() {\n\t\treturn getSingleName();\n\t}",
"String getLinkName();",
"public String targetId() {\n return this.targetId;\n }",
"protected String buildLink(Node targetNode) {\r\n if (targetNode == null) {\r\n return null;\r\n }\r\n return requestContext.getHstLinkCreator()\r\n .create(targetNode, requestContext, ContainerConstants.MOUNT_ALIAS_SITE)\r\n .toUrlForm(requestContext, false);\r\n }",
"public com.commercetools.api.models.common.Reference getTarget() {\n return this.target;\n }",
"public void setTarget(java.lang.String target) {\n this.target = target;\n }",
"public String getTarget() {\n return JsoHelper.getAttribute(jsObj, \"target\");\n }",
"public com.google.protobuf.ByteString\n getTargetNameBytes() {\n java.lang.Object ref = targetName_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n targetName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@JsonProperty(\"target\")\n public String getTarget() {\n return target;\n }",
"void setTarget(java.lang.String target);",
"public void setTarget(String target) {\n this.target = target;\n }",
"public com.google.protobuf.ByteString\n getTargetNameBytes() {\n java.lang.Object ref = targetName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n targetName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@objid (\"19651663-f981-4f11-802a-d5d7cbd6f88a\")\n Instance getTarget();",
"public String targetResourceId() {\n return this.targetResourceId;\n }",
"@NotNull\n Resource getTarget();",
"public java.lang.String getTargetNumber() {\r\n return targetNumber;\r\n }",
"public String target(String target)\n {\n return target + \":\" + this.getPort();\n }",
"public Target getTarget() {\n\n return target;\n }",
"public java.lang.CharSequence getTargetObjectUri() {\n return target_object_uri;\n }",
"public java.lang.CharSequence getTargetObjectUri() {\n return target_object_uri;\n }",
"public String getToRefid() {\n return targetid;\n }",
"public Target getTarget() {\n return target;\n }",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public static LabelExpression label(LabelTarget labelTarget) { throw Extensions.todo(); }",
"public String getLinkageLabel() {\n return linkageLabel;\n }",
"public static OMCollection getLinkByTarget(Entity target) {\r\n return IServer.associationHasTarget().rr(target).domain();\r\n }",
"public Living getTarget();",
"public DvEHRURI getTarget() {\n return target;\n }",
"public java.lang.String getTargetPath() {\n java.lang.Object ref = targetPath_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n targetPath_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"@ZAttr(id=775)\n public String getDomainAliasTargetId() {\n return getAttr(Provisioning.A_zimbraDomainAliasTargetId, null);\n }",
"private String linkString()\n {\n Iterator<DSAGraphNode<E>> iter = links.iterator();\n String outputString = \"\";\n DSAGraphNode<E> node = null;\n while (iter.hasNext())\n {\n node = iter.next();\n outputString = (outputString + node.getLabel() + \", \");\n }\n return outputString;\n }",
"public java.lang.String getLabel();",
"public Object getTarget()\n {\n return __m_Target;\n }",
"public Node getTarget() {\n return target;\n }",
"public java.lang.String getTargetPath() {\n java.lang.Object ref = targetPath_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n targetPath_ = s;\n return s;\n }\n }",
"public String getAbstractTarget(int targetId) {\r\n \tString abs = \"\";\r\n \tfor (String edge :jungCompleteGraph.getOutEdges(targetId)){\r\n \t\t\tif(edge.contains(\"http://dbpedia.org/ontology/abstract\")){\r\n \t\t\t\tabs = getURI(jungCompleteGraph.getDest(edge)); \r\n \t\t\t}\r\n \t\t}\r\n \treturn abs;\r\n }",
"java.lang.String getLabel();",
"public void setTargetName(String targetName) {\r\n this.targetName = targetName;\r\n }",
"Attribute getTarget();",
"public java.lang.String getTargetJobName() {\n java.lang.Object ref = targetJobName_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n targetJobName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getTargetJobName() {\n java.lang.Object ref = targetJobName_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n targetJobName_ = s;\n }\n return s;\n }\n }",
"public Long getTargetId() {\r\n return targetId;\r\n }",
"public final String getTargetString() {\n/* 97 */ return this.m_targetString;\n/* */ }",
"String getLink();",
"String getLabel();",
"String getLabel();",
"public static LabelExpression label(LabelTarget labelTarget, Expression expression) { throw Extensions.todo(); }",
"public long getTargetId() {\n return targetId;\n }",
"public void setTargetName(String targetName) {\n this.targetName = targetName;\n }",
"public static LabelTarget label() { throw Extensions.todo(); }",
"URL getTarget();",
"public String getLabel() {\n\t String name = getLiteralValue(Foaf.NAME);\n\t \n\t if (name == null) {\n\t name = getLiteralValue(Foaf.GIVENNAME);\n\t }\n\t \n\t if (name == null) {\n\t name = getLiteralValue(RDFS.label);\n\t }\n\t \n\t if (name == null) {\n\t return getURI();\n\t }\n\t return name;\n }",
"Object getTarget();",
"Object getTarget();",
"public String getLink();",
"public String getLinkName() {\n return linkName;\n }",
"public String getOntologyUri(String label){\n \n for(Iterator it = listOfLabels.iterator();it.hasNext();){\n SemanticConcept sc = (SemanticConcept) it.next();\n if(sc.getName().equals(label))\n return sc.getUrl();\n }\n return \" \";\n }",
"public static LabelTarget label(String name) { throw Extensions.todo(); }",
"private Target getMatchingTarget(Element targetElement)\n {\n String targetName = targetElement.getAttribute(\"name\").getValue();\n\n for (Target target : targets)\n {\n String label = target.getName();\n\n if (label.equals(targetName))\n {\n return target;\n }\n }\n\n return null;\n }",
"public String getLabel() {\n return name().toLowerCase().replace(\"_\", \"\");\n }",
"public abstract String linkText();",
"public String getLabel();",
"public String getLabel();",
"public String getLabel();",
"public String getLabel();",
"@JsonProperty(\"target\")\n public void setTarget(String target) {\n this.target = target;\n }",
"public Object getTargetObject() {\n return targetObject;\n }",
"public String getTargetUrl() {\n return targetUrl;\n }",
"public Node target() {\n return target;\n }",
"public void setTarget(String val)\r\n\t{\r\n\t\t_target = val;\r\n\t}",
"protected String getTargetUrl() {\n // Get the next target URL\n String target = this.endpointUrls.get(this.nextTarget);\n LOGGER.trace(\"Current nextTarget: \\\"{}\\\", targetUrl: \\\"{}\\\"\", this.nextTarget, target);\n // Update next pointer\n this.nextTarget = this.nextTarget == this.endpointUrls.size() - 1 ? 0 : this.nextTarget + 1;\n LOGGER.trace(\"New nextTarget: \\\"{}\\\"\", this.nextTarget);\n return target;\n }",
"java.lang.String getTargetJobName();",
"public String getLabel() {\n return _label == null ? name() : _label;\n }",
"@Override\r\n\tpublic String getLabel() {\n\t\treturn SummaryGraphUtil.getLocalName(uri);\r\n\t}",
"ILinkDeleterActionBuilder<SOURCE_BEAN_TYPE, LINKED_BEAN_TYPE> setLinkedEntityLabelPlural(String label);",
"public String targetNetworkId() {\n return this.targetNetworkId;\n }",
"public YangString getSrvTargetNameValue() throws JNCException {\n return (YangString)getValue(\"srv-target-name\");\n }",
"public String getLabel() {\r\n return label;\r\n }",
"public String getLabel() {\r\n return label;\r\n }",
"public String getLabel() {\r\n return label;\r\n }"
] | [
"0.69249654",
"0.6733924",
"0.66688263",
"0.66688263",
"0.6630656",
"0.6586028",
"0.6586028",
"0.65377325",
"0.6474937",
"0.6474937",
"0.6415718",
"0.63799936",
"0.63707334",
"0.6354561",
"0.6289456",
"0.6159354",
"0.6141845",
"0.6122697",
"0.6107643",
"0.60594654",
"0.6050169",
"0.5985345",
"0.59543985",
"0.5953179",
"0.59403324",
"0.5901095",
"0.5893789",
"0.5874935",
"0.5867431",
"0.5827585",
"0.5732238",
"0.57115996",
"0.5707149",
"0.5663782",
"0.56315434",
"0.5624584",
"0.5621272",
"0.5621077",
"0.561527",
"0.5611951",
"0.5602685",
"0.5602685",
"0.5602685",
"0.5597074",
"0.55816495",
"0.5559171",
"0.5552165",
"0.55420077",
"0.5525917",
"0.55142736",
"0.5511002",
"0.54838985",
"0.5481269",
"0.5473002",
"0.5458961",
"0.54516363",
"0.54476935",
"0.54385567",
"0.5436345",
"0.5433681",
"0.54319406",
"0.54282457",
"0.54274607",
"0.54235256",
"0.5415395",
"0.5415395",
"0.5394785",
"0.53910595",
"0.5388886",
"0.5382338",
"0.5381894",
"0.5381816",
"0.5380236",
"0.5380236",
"0.537521",
"0.534194",
"0.53405386",
"0.533872",
"0.53064466",
"0.5283549",
"0.5269738",
"0.5263882",
"0.5263882",
"0.5263882",
"0.5263882",
"0.5262779",
"0.5249517",
"0.52373993",
"0.52311003",
"0.52254885",
"0.5221841",
"0.5209071",
"0.52024335",
"0.51913375",
"0.5180424",
"0.51784164",
"0.5174124",
"0.51691556",
"0.51691556",
"0.51691556"
] | 0.5240119 | 87 |
getLabelExtension Returns an icon for the link. | @Override
public ImageIcon getIcon(int size) {
return IconTool.getIcon(ICON_NAME, size);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getIcon();",
"java.lang.String getIcon();",
"private RLabel getIconLabel() {\n if (iconLabel == null) {\n iconLabel = new RLabel();\n iconLabel.setStyle(\"border-all\");\n iconLabel.setIconUri(\"<%=ivy.cms.cr(\\\"/Icons/Large/error\\\")%>\");\n iconLabel.setStyleProperties(\"{/anchor \\\"NORTHWEST\\\"}\");\n iconLabel.setName(\"iconLabel\");\n }\n return iconLabel;\n }",
"String getIcon();",
"String getIcon();",
"Icon getIcon();",
"String getIconFile();",
"public String getIcon() {\n\t\treturn \"icon\";\n\t}",
"@Override\r\n public synchronized String getLabelExtension() {\r\n int sourceSize = (getSource() != null) ? 1 : 0;\r\n int targetSize = (getTarget() != null) ? getTarget().size() : 0;\r\n String prefix = (!super.getLabelExtension().equals(Constant.EMPTY_STRING)) ? super\r\n .getLabelExtension()\r\n : Schema.TYPE_LINK;\r\n return prefix + Constant.BLANK + Constant.OPEN_PARENTHESIS + sourceSize\r\n + Constant.COMMA + Constant.BLANK + targetSize\r\n + Constant.CLOSE_PARENTHESIS;\r\n }",
"public abstract String getManipulatorLinkLabel();",
"public org.netbeans.modules.j2ee.dd.api.common.Icon getIcon(){return null;}",
"public java.lang.String getIcon() {\n java.lang.Object ref = icon_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n icon_ = s;\n }\n return s;\n }\n }",
"public java.lang.String getIcon() {\n java.lang.Object ref = icon_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n icon_ = s;\n }\n return s;\n }\n }",
"public ImageDescriptor getIcon();",
"public Icon getIcon();",
"public URL getIcon()\r\n {\r\n\treturn icon;\r\n }",
"public abstract String getIconString();",
"public abstract String typeIcon();",
"public java.lang.String getIcon() {\n java.lang.Object ref = icon_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n icon_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getIcon() {\n java.lang.Object ref = icon_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n icon_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public abstract String getIconPath();",
"public String getIcon() {\n return icon;\n }",
"public String getIcon() {\n return icon;\n }",
"public String getIcon() {\n return icon;\n }",
"public String getIcon() {\n return icon;\n }",
"public abstract ImageDescriptor getIcon();",
"private ImageIcon getJLFImageIcon(String name) {\n\t\tString imgLocation = \"/toolbarButtonGraphics/\" + name + \"24.gif\";\n\t\treturn getMyImage(imgLocation);\n\t}",
"public Icon getImageIcon() {\r\n\t\treturn lblImageViewer.getIcon();\r\n\t}",
"Icon getIcon(URI activityType);",
"@Override\n\tpublic ToolIconURL getIconURL() {\n\t\treturn iconURL;\n\t}",
"java.lang.String getGameIconUrl();",
"public String getAccessibleIconDescription();",
"public static IIconDescriptor getIconDescriptor() {\n\t\tif (iconDescriptor == null)\n\t\t\ticonDescriptor = new NodeIconDescriptor(\"dataAdapters\"); //$NON-NLS-1$\n\t\treturn iconDescriptor;\n\t}",
"protected void addLabel(AeIconLabel aLabel) {\r\n }",
"public static IIconDescriptor getIconDescriptor() {\n\t\tif (iconDescriptor == null)\n\t\t\ticonDescriptor = new ServerIconDescriptor(\"servers\"); //$NON-NLS-1$\n\t\treturn iconDescriptor;\n\t}",
"public String getIconUrl() {\n return iconUrl;\n }",
"public String getIconUrl() {\r\n return iconUrl;\r\n }",
"public Image getImageLabel(Object element, int flags) {\n \t\treturn getImageLabel(computeDescriptor(element, flags));\n \t}",
"public @Nullable IIconData getIcon(@Nullable URL url);",
"public static IIconDescriptor getIconDescriptor() {\n\t\tif (iconDescriptor == null)\n\t\t\ticonDescriptor = new NodeIconDescriptor(\"parameter-report\"); //$NON-NLS-1$\n\t\treturn iconDescriptor;\n\t}",
"public String getIconURL()\n {\n return null; \n }",
"@Override\n\tprotected String iconResourceName() {\n\t\treturn \"nkv550.png\";\n\t}",
"URL getIconURL(String iconId, IconSize medium);",
"String getLabel();",
"String getLabel();",
"public String getIconFileName() {\n\tif (this.isSuccess()) {\n\t return this.icon;\n\t} else {\n\t return null;\n\t}\n }",
"Texture getIcon();",
"protected abstract String getAddDataIconDefaultCaption () ;",
"Icon createIcon();",
"com.google.protobuf.ByteString\n getIconBytes();",
"com.google.protobuf.ByteString\n getIconBytes();",
"public java.lang.String getLabel();",
"public String getIconFileName() {\n return null;\n }",
"public com.google.protobuf.ByteString\n getIconBytes() {\n java.lang.Object ref = icon_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n icon_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public com.google.protobuf.ByteString\n getIconBytes() {\n java.lang.Object ref = icon_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n icon_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public String getIconString() {\n return theIconStr;\n }",
"public com.google.protobuf.ByteString\n getIconBytes() {\n java.lang.Object ref = icon_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n icon_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public com.google.protobuf.ByteString\n getIconBytes() {\n java.lang.Object ref = icon_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n icon_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"java.lang.String getCouponIconUrl();",
"Label getLabel();",
"Label getLabel();",
"Label getLabel();",
"public ResourceLocation getIcon() {\n return icon;\n }",
"java.lang.String getLabel();",
"public String getLabel();",
"public String getLabel();",
"public String getLabel();",
"public String getLabel();",
"Icon getPlotterIcon();",
"public AppIcon getAppIcon () ;",
"public abstract String getImageSuffix();",
"protected String getIconUri() {\n return getResourceUrl(ComponentConstants.ICON_RESOURCE);\n }",
"com.google.ads.googleads.v6.resources.Label getLabel();",
"public Label getLabel() {\n return pkgBuilder.getBuildFileLabel();\n }",
"public String getLinkName();",
"DatasetLabel getLabel();",
"@Override\n\tpublic long getIconId() {\n\t\treturn _scienceApp.getIconId();\n\t}",
"private static Component createIconComponent()\n {\n JPanel wrapIconPanel = new TransparentPanel(new BorderLayout());\n\n JLabel iconLabel = new JLabel();\n\n iconLabel.setIcon(DesktopUtilActivator.getResources()\n .getImage(\"service.gui.icons.AUTHORIZATION_ICON\"));\n\n wrapIconPanel.add(iconLabel, BorderLayout.NORTH);\n\n return wrapIconPanel;\n }",
"String getLinkName();",
"private Label createIcon(String name) {\n Label label = new Label();\n Image labelImg = new Image(getClass().getResourceAsStream(name));\n ImageView labelIcon = new ImageView(labelImg);\n label.setGraphic(labelIcon);\n return label;\n }",
"public String getTextAccountNameIcon()\n\t{\n\t\treturn elementUtils.getElementText(wbAccountNameIcon); //return wbAccountNameIcon.getText()\n\t}",
"public Icon getTabIcon();",
"public int getIconId(){\n return mIconId;\n }",
"public void setLinkIcon( NSData linkIcon ) {\n\t\t_linkIcon = linkIcon;\n\t}",
"public String getLabel() { //gets the label\n\n\t\treturn rawLabel;\n\t}",
"protected Icon getIcon() {\n return getConnection().getIcon(getIconUri());\n }",
"public Icon getIcon()\n {\n return getComponent().getIcon();\n }",
"com.microsoft.schemas.xrm._2011.contracts.Label getLabel();",
"public String getIconHandler()\n {\n return iconHandler;\n }",
"public String getLabel() {\n return getElement().getChildren()\n .filter(child -> child.getTag().equals(\"label\")).findFirst()\n .get().getText();\n }",
"@Override\n public java.lang.String getLabelToDisplay() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (SystemAttributeSymbols.LABEL_TO_DISPLAY_);\n return (java.lang.String)retnValue;\n }",
"public String getNomIcone() {\n\t\treturn nomIcone;\n\t}",
"@Override\n\tpublic Icon getIcon(int width, int height) {\n\t\treturn null; // Use Display Name instead of an icon.\n\t}",
"public Icon getIcon(Object object);",
"public Icon getIcon(@NotNull DartComponent component) {\n return getIcon();\n }",
"com.google.protobuf.ByteString\n getLabelBytes();",
"java.lang.String getExtensionText();",
"String getExtension();",
"@Override\n\tpublic String getIconFileName() {\n\t\treturn null;\n\t}",
"public FSIcon getIcon() {\n return icon;\n }",
"public String getLabel() {\n\t String name = getLiteralValue(Foaf.NAME);\n\t \n\t if (name == null) {\n\t name = getLiteralValue(Foaf.GIVENNAME);\n\t }\n\t \n\t if (name == null) {\n\t name = getLiteralValue(RDFS.label);\n\t }\n\t \n\t if (name == null) {\n\t return getURI();\n\t }\n\t return name;\n }"
] | [
"0.6653491",
"0.6653491",
"0.66493964",
"0.6426678",
"0.6426678",
"0.62623215",
"0.6156132",
"0.6143673",
"0.6137149",
"0.6106156",
"0.60998416",
"0.60333246",
"0.60333246",
"0.5992562",
"0.5986301",
"0.5959075",
"0.5922081",
"0.59169143",
"0.5910307",
"0.5910307",
"0.5882234",
"0.5792606",
"0.5792606",
"0.5792606",
"0.5792606",
"0.57653135",
"0.575166",
"0.57446665",
"0.5719384",
"0.56921667",
"0.5688438",
"0.5675389",
"0.5670971",
"0.56405616",
"0.56388223",
"0.5634239",
"0.56280386",
"0.5627327",
"0.5607931",
"0.5572582",
"0.5561312",
"0.55410093",
"0.55398035",
"0.55128074",
"0.55128074",
"0.5496357",
"0.5492258",
"0.5489615",
"0.5487435",
"0.54819006",
"0.54819006",
"0.54817796",
"0.5472027",
"0.5469408",
"0.5469408",
"0.54692274",
"0.54668164",
"0.54668164",
"0.5464287",
"0.5445868",
"0.5445868",
"0.5445868",
"0.5436676",
"0.54133165",
"0.5403039",
"0.5403039",
"0.5403039",
"0.5403039",
"0.53997445",
"0.5386597",
"0.53743684",
"0.5366515",
"0.53657407",
"0.53396994",
"0.5328819",
"0.53279376",
"0.532675",
"0.5319216",
"0.53151834",
"0.53043336",
"0.5292018",
"0.5291583",
"0.52901673",
"0.52852815",
"0.525531",
"0.5236872",
"0.5232927",
"0.52326816",
"0.5231705",
"0.5231164",
"0.522526",
"0.52219254",
"0.5219519",
"0.5216654",
"0.5212227",
"0.5208189",
"0.52077764",
"0.52047664",
"0.5204037",
"0.5197842",
"0.51957595"
] | 0.0 | -1 |
getIcon Returns a tooltip for the link. | @Override
public String getTooltip() {
return TOOLTIP;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Icon getIcon();",
"@Override\n\tpublic ToolIconURL getIconURL() {\n\t\treturn iconURL;\n\t}",
"java.lang.String getIcon();",
"java.lang.String getIcon();",
"public URL getIcon()\r\n {\r\n\treturn icon;\r\n }",
"public String getIcon() {\n\t\treturn \"icon\";\n\t}",
"String getIcon();",
"String getIcon();",
"public Icon getIcon();",
"public String getAccessibleIconDescription();",
"public org.netbeans.modules.j2ee.dd.api.common.Icon getIcon(){return null;}",
"public String getIconUrl() {\r\n return iconUrl;\r\n }",
"public String getIconUrl() {\n return iconUrl;\n }",
"protected Icon getIcon() {\n return getConnection().getIcon(getIconUri());\n }",
"public abstract String getToolTip();",
"@Exported(visibility = 999)\n public String getTooltip() {\n return tooltip;\n }",
"protected String getIconUri() {\n return getResourceUrl(ComponentConstants.ICON_RESOURCE);\n }",
"public String getIcon() {\n return icon;\n }",
"public String getIcon() {\n return icon;\n }",
"public String getIcon() {\n return icon;\n }",
"public String getIcon() {\n return icon;\n }",
"java.lang.String getGameIconUrl();",
"default String getTooltip() {\n throw new UnsupportedOperationException();\n }",
"Icon createIcon();",
"public java.lang.String getIcon() {\n java.lang.Object ref = icon_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n icon_ = s;\n }\n return s;\n }\n }",
"public java.lang.String getIcon() {\n java.lang.Object ref = icon_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n icon_ = s;\n }\n return s;\n }\n }",
"public java.lang.String getIcon() {\n java.lang.Object ref = icon_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n icon_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getIcon() {\n java.lang.Object ref = icon_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n icon_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public ImageDescriptor getIcon();",
"public @Nullable IIconData getIcon(@Nullable URL url);",
"URL getIconURL(String iconId, IconSize medium);",
"public String getToolTip ()\r\n\t{\r\n\t\tif (!((imageName.equals(\"GND\")) || (imageName.equals(\"VCC\")) || (imageName.equals(\"BOX\")) || (imageName.equals(\"OUTPUT\"))))\r\n\t\t{\r\n\t\t\tthis.toolTip = \"<html><img src=\"+this.imageName+\"></html>\";\r\n\t\t\treturn this.toolTip;\r\n\t\t}\r\n\t\t\r\n\t\telse if (imageName.equals(\"GND\"))\r\n\t\t\treturn \"GND\";\r\n\t\t\r\n\t\telse if (imageName.equals(\"VCC\"))\r\n\t\t\treturn \"VCC\";\r\n\t\t\r\n\t\telse if (imageName.equals(\"OUTPUT\"))\r\n\t\t\treturn \"Output window\";\r\n\t\t\r\n\t\telse\r\n\t\t\treturn \"TODO\";\r\n\t}",
"public ResourceLocation getIcon() {\n return icon;\n }",
"String getTooltip() {\n return bufTip;\n }",
"public abstract ImageDescriptor getIcon();",
"Icon getIcon(URI activityType);",
"Texture getIcon();",
"public String getTooltip() {\n\t\treturn tooltip;\n\t}",
"Icon getPlotterIcon();",
"void showTooltip();",
"public abstract String getIconString();",
"@NotNull\n SVGResource getIcon();",
"Icon getMenuIcon();",
"String getTooltip() {\n return mTooltip;\n }",
"public IFigure getTooltip() {\n return this.tooltip;\n }",
"public int getIcon()\n\t{\n\t\treturn getClass().getAnnotation(AccuAction.class).icon();\n\t}",
"public void setLinkIcon( NSData linkIcon ) {\n\t\t_linkIcon = linkIcon;\n\t}",
"public AwesomeIcon icon() {\n\t\treturn icon;\n\t}",
"public String getIcon(){\n\t\t\t\t\n\t\treturn inCity.getWeather().get(0).getIcon();\n\t}",
"public abstract String typeIcon();",
"public abstract Drawable getIcon();",
"public Icon getTabIcon();",
"java.lang.String getCouponIconUrl();",
"public TooltipDisplay getTooltipDisplay();",
"private String generateHoverover(Tool tool) {\n \n String name = tool.getName();\n String desc = tool.getDescription();\n String image = tool.getIcon();\n \n StringBuilder hoverText = new StringBuilder();\n hoverText.append(\"<html>\");\n hoverText.append(\"<div style='width:200px;background-color:white'>\");\n hoverText.append(\"<h3>\");\n hoverText.append(name);\n hoverText.append(\"</h3>\");\n if (desc != null && !desc.equals(\"\")) {\n hoverText.append(\"<p>\");\n hoverText.append(desc);\n hoverText.append(\"</p>\");\n }\n if (image != null && !image.equals(\"\")) {\n \n FileLoader fileLookup = new FileLoader(1);\n \n try {\n Object[] iconURL = fileLookup.getFileURL(image); \n if (iconURL[1] != null && image.startsWith(\"http\")) {\n hoverText.append(\"<p align='center'><img src='\");\n hoverText.append(image);\n hoverText.append(\"' alt='image'></p>\");\n }\n } catch (Exception ex) {\n // there was a problem finding the image, just don't display it\n }\n } \n \n hoverText.append(\"<br>\");\n hoverText.append(\"</div>\");\n hoverText.append(\"</html>\");\n \n return hoverText.toString();\n\n }",
"public Icon getIcon() {\n \t\treturn null;\n \t}",
"public com.google.protobuf.ByteString\n getIconBytes() {\n java.lang.Object ref = icon_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n icon_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public com.google.protobuf.ByteString\n getIconBytes() {\n java.lang.Object ref = icon_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n icon_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@Override\r\n protected String getTooltip()\r\n {\n return \"This name is used as (unique) name for the pattern.\";\r\n }",
"public String getIconString() {\n return theIconStr;\n }",
"public abstract String getIconPath();",
"public String getToolTip() {\n\treturn this.toolTip;\n }",
"public String getIconURL()\n {\n return null; \n }",
"com.google.protobuf.ByteString\n getIconBytes();",
"com.google.protobuf.ByteString\n getIconBytes();",
"public String iconResource() {\n return \"/org/netbeans/core/resources/actions/addJarArchive.gif\"; // NOI18N\n }",
"public Icon getImageIcon() {\r\n\t\treturn lblImageViewer.getIcon();\r\n\t}",
"public String getIconURL(int preferredSize)\n {\n \treturn getIconURL(); \n }",
"public static JButton createIconButton(String tooltip, Icon icon) {\n JButton ret = new JButton(icon);\n ret.setMargin(new Insets(0, 0, 0, 0));\n ret.setBorderPainted(false);\n ret.setBorder(null);\n ret.setFocusable(false);\n ret.setIconTextGap(0);\n if (tooltip != null)\n attachToolTip(ret, tooltip, SwingConstants.RIGHT, SwingConstants.TOP);\n//TODO combine FrameworkIcon and LazyIcon into one class\n// if (icon instanceof FrameworkIcon) {\n// FrameworkIcon ficon = (FrameworkIcon)icon;\n// ret.setDisabledIcon(ficon);\n// }\n// else if (icon instanceof LazyIcon) {\n// LazyIcon licon = (LazyIcon)icon;\n// ret.setDisabledIcon(licon);\n// }\n return ret;\n }",
"public LinkButton( Icon icon) {\n\t\tsuper( icon);\n\t\tinit();\n\t}",
"public String getXpeIcon() {\n return (String) getAttributeInternal(XPEICON);\n }",
"public Icon getIcon() {\n\t\treturn null;\n\t}",
"@Override\n public String getTooltip()\n {\n return null;\n }",
"public Icon getIcon()\n {\n return getComponent().getIcon();\n }",
"TextView getIconTipsView();",
"@Nullable\n final public String getIconImageUrl() {\n return mIconImageUrl;\n }",
"String getIconFile();",
"public com.google.protobuf.ByteString\n getIconBytes() {\n java.lang.Object ref = icon_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n icon_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public com.google.protobuf.ByteString\n getIconBytes() {\n java.lang.Object ref = icon_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n icon_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"private RLabel getIconLabel() {\n if (iconLabel == null) {\n iconLabel = new RLabel();\n iconLabel.setStyle(\"border-all\");\n iconLabel.setIconUri(\"<%=ivy.cms.cr(\\\"/Icons/Large/error\\\")%>\");\n iconLabel.setStyleProperties(\"{/anchor \\\"NORTHWEST\\\"}\");\n iconLabel.setName(\"iconLabel\");\n }\n return iconLabel;\n }",
"@Source(\"create.gif\")\n\tpublic ImageResource createIcon();",
"public Icon getIcon() {\r\n\r\n if (icon == null && this.getIconString() != null) {\r\n InputStream in = this.getClass().getResourceAsStream(this.getIconString());\r\n BufferedImage img = null;\r\n Image scaledImg = null;\r\n try {\r\n img = ImageIO.read(in);\r\n scaledImg = img.getScaledInstance(this.useToolIconSize ? PirolPlugInSettings.StandardToolIconWidth : PirolPlugInSettings.StandardPlugInIconWidth, this.useToolIconSize ? PirolPlugInSettings.StandardToolIconHeight : PirolPlugInSettings.StandardPlugInIconHeight, img.getType());\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n img = null;\r\n icon = null;\r\n }\r\n if (scaledImg != null) {\r\n icon = new ImageIcon(scaledImg);\r\n }\r\n }\r\n return icon;\r\n }",
"protected DecoratorString<ARXNode> getTooltipDecorator() {\n return this.tooltipDecorator;\n }",
"@Source(\"create.gif\")\n\tpublic DataResource createIconResource();",
"public Icon getIcon(Object object);",
"public String getTabToolTipText();",
"public void clickOnDownloadIcon();",
"@Nullable\n\tdefault String getTooltip()\n\t{\n\t\treturn null;\n\t}",
"String getHoverDetail();",
"public static String getIconUrl(long id, String icon) {\n String url = \"http://pic.qiushibaike.com/system/avtnew/%s/%s/thumb/%s\";\n return String.format(url, id / 10000, id, icon);\n }",
"public abstract String getManipulatorLinkLabel();",
"public abstract ITooltipData getTooltipData();",
"public char getIcon() {\n return this.icon;\n }",
"public ImageIcon getHeaderIcon();",
"public URI getIconUri() {\n return this.iconUri;\n }",
"private Point getHelpIconLocation() {\n\t\tint primaryWidth = iconLabel.getWidth();\n\t\tint overlayWidth = helpIcon.getIconWidth();\n\n\t\t// this point is relative to the iconLabel...\n\t\tPoint paintPoint = new Point(primaryWidth - overlayWidth, 0);\n\n\t\t// ...make the point relative to the parent (this renderer)\n\t\treturn SwingUtilities.convertPoint(iconLabel, paintPoint, this);\n\t}",
"public CustomMenuItemGUI(String manager, ImageIcon icon, String tooltip) {\r\n\t\tsuper(manager, icon, tooltip);\r\n\t}",
"@Override\n\tpublic Icon getIcon(int width, int height) {\n\t\treturn null; // Use Display Name instead of an icon.\n\t}",
"@Nullable private String getHyperlink() {\n final String url = getLogoFromUIInfo();\n\n if (null == url) {\n return null;\n }\n\n try {\n final URI theUrl = new URI(url);\n final String scheme = theUrl.getScheme();\n\n if (!\"http\".equals(scheme) && !\"https\".equals(scheme) && !\"data\".equals(scheme)) {\n log.warn(\"The logo URL '{}' contained an invalid scheme (expected http:, https: or data:)\", url);\n return null;\n }\n } catch (final URISyntaxException e) {\n //\n // Could not encode\n //\n log.warn(\"The logo URL '{}' was not a URL \", url, e);\n return null;\n }\n\n final String encodedURL = HTMLEncoder.encodeForHTMLAttribute(url);\n final String encodedAltTxt = HTMLEncoder.encodeForHTMLAttribute(getAltText());\n final StringBuilder sb = new StringBuilder(\"<img src=\\\"\");\n sb.append(encodedURL).append('\"');\n sb.append(\" alt=\\\"\").append(encodedAltTxt).append('\"');\n addClassAndId(sb);\n sb.append(\"/>\");\n return sb.toString();\n }",
"public static IIconDescriptor getIconDescriptor() {\n\t\tif (iconDescriptor == null)\n\t\t\ticonDescriptor = new ServerIconDescriptor(\"servers\"); //$NON-NLS-1$\n\t\treturn iconDescriptor;\n\t}"
] | [
"0.6680081",
"0.65936995",
"0.6571954",
"0.6571954",
"0.6549641",
"0.6533488",
"0.6495244",
"0.6495244",
"0.6486",
"0.63060904",
"0.6246362",
"0.6245991",
"0.6240288",
"0.61348104",
"0.60430944",
"0.6035605",
"0.602051",
"0.60138416",
"0.60138416",
"0.60138416",
"0.60138416",
"0.59821445",
"0.59809476",
"0.59763455",
"0.59548515",
"0.59548515",
"0.5933108",
"0.5933108",
"0.59161896",
"0.5888234",
"0.58702695",
"0.58661",
"0.5837106",
"0.5832439",
"0.58264935",
"0.57797545",
"0.5762258",
"0.57612",
"0.5758377",
"0.5757608",
"0.5751362",
"0.5750932",
"0.57449305",
"0.5740385",
"0.57400954",
"0.57336307",
"0.57332474",
"0.5725224",
"0.57140565",
"0.56944203",
"0.5686801",
"0.56848174",
"0.5684776",
"0.56722087",
"0.56451374",
"0.5642217",
"0.56416583",
"0.56416583",
"0.56349003",
"0.56341916",
"0.5631384",
"0.56271744",
"0.56196535",
"0.5617419",
"0.5617419",
"0.560997",
"0.5605242",
"0.5602036",
"0.55966324",
"0.5592634",
"0.5589761",
"0.55878997",
"0.5587167",
"0.55804056",
"0.55706656",
"0.55680174",
"0.5563035",
"0.55611223",
"0.55611223",
"0.5558882",
"0.5545519",
"0.5542739",
"0.5525061",
"0.5509768",
"0.5507388",
"0.55031306",
"0.5489456",
"0.5476887",
"0.54669034",
"0.545659",
"0.54442126",
"0.5441875",
"0.5432419",
"0.54318446",
"0.5422659",
"0.53798604",
"0.53721225",
"0.53694236",
"0.5358906",
"0.53556216"
] | 0.6114658 | 14 |
getTooltip Returns a string representation of the link's content. | @Override
public String toString() {
int sourceSize = (getSource() != null) ? getSource().size() : 0;
int targetSize = (getTarget() != null) ? getTarget().size() : 0;
InstanceInfo info = new InstanceInfo(this);
info.add(super.toString());
info.add(Constant.COMMA_BLANK);
info.addAttribute(SOURCE_SIZE, sourceSize);
info.addAttribute(TARGET_SIZE, targetSize);
return info.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getTooltip() {\n return mTooltip;\n }",
"public String getTooltip() {\n\t\treturn tooltip;\n\t}",
"public static String getToolTipText() {\n\t\treturn (toolTipText);\n\t}",
"@Override\n public StringTextComponent getTooltip() {\n return this.tooltip;\n }",
"public String getToolTipText() {\n return this.toString();\n }",
"String getTooltip() {\n return bufTip;\n }",
"public abstract String getToolTip();",
"@Override\r\n public String getTooltip() {\r\n return TOOLTIP;\r\n }",
"@Exported(visibility = 999)\n public String getTooltip() {\n return tooltip;\n }",
"public String getToolTip() {\n\treturn this.toolTip;\n }",
"String getHoverDetail();",
"@Override\r\n\tpublic String getToolTipText(MouseEvent event) {\r\n return toolTipWriter.write(getToolTipText(), event.getPoint());\r\n }",
"public TooltipDisplay getTooltipDisplay();",
"@Override\n public String getToolTipText (final MouseEvent mEvent) {\n return getText();\n }",
"public String getToolTipText() {\n\t\t\treturn fragname.toString();\n\t\t}",
"protected String getToolTip( MouseEvent event )\n {\n SmartText descr = new SmartText();\n int column = treeTable.columnAtPoint( event.getPoint() );\n if ( column == 0 )\n {\n int row = treeTable.rowAtPoint( event.getPoint() );\n if ( row == 0 )\n {\n descr.setText( componentModel.getTypeDescription() );\n }\n else\n {\n Object value = treeTable.getValueAt( row, 1 );\n if ( value instanceof Property )\n {\n Property p = ( Property )value;\n descr.setText( p.getToolTip() );\n }\n }\n\n // perform line wrapping now\n descr.setText( \"<html>\" + descr.insertBreaks( \"<br>\", toolTipWidth, true ) + \"</html>\" );\n return descr.toString();\n }\n return null;\n }",
"public String getToolTipText() {\n\t\treturn \"\";\r\n\t}",
"public String getToolTipText () {\r\n\tcheckWidget();\r\n\treturn toolTipText;\r\n}",
"public IFigure getTooltip() {\n return this.tooltip;\n }",
"protected DecoratorString<ARXNode> getTooltipDecorator() {\n return this.tooltipDecorator;\n }",
"@Override\r\n\tpublic IFigure getTooltip(Object entity) {\n\t\tif (entity instanceof GraphNode) {\r\n\t\t\tGraphNode node = (GraphNode) entity;\r\n\t\t\treturn new Label(node.getName());\r\n\t\t} else if (entity instanceof EntityConnectionData) {\r\n\t\t\tEntityConnectionData conn = (EntityConnectionData) entity;\r\n\t\t\tGraphNode caller = (GraphNode) conn.source;\r\n\t\t\tGraphNode callee = (GraphNode) conn.dest;\r\n\t\t\treturn new Label(caller.getName() + \"-\" + callee.getName());\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public String getToolTipText(MouseEvent event) {\n\t\tjava.awt.Point loc = event.getPoint();\n\t\tint row = rowAtPoint(loc);\n\t\tFileTableModel model = (FileTableModel) getModel();\n\t\treturn model.getDescriptions()[row];\n\t}",
"@Nullable\n\tdefault String getTooltip()\n\t{\n\t\treturn null;\n\t}",
"@Override\n public String getTooltip()\n {\n return null;\n }",
"String getTooltipContent(WebElement field){\n String tooltip = null;\n String tooltipId = field.getAttribute(\"aria-describedby\");\n By tooltipLocator = By.id(tooltipId);\n WebElement tooltipField = driver.findElement(tooltipLocator);\n tooltip = tooltipField.getText();\n System.out.println(\"** tooltip value: \" + tooltip);\n return tooltip;\n }",
"default String getTooltip() {\n throw new UnsupportedOperationException();\n }",
"public String generateToolTipFragment(String toolTipText) {\n/* 88 */ return \" onMouseOver=\\\"return stm(['\" + \n/* 89 */ ImageMapUtilities.javascriptEscape(this.title) + \"','\" + \n/* 90 */ ImageMapUtilities.javascriptEscape(toolTipText) + \"'],Style[\" + this.style + \"]);\\\"\" + \" onMouseOut=\\\"return htm();\\\"\";\n/* */ }",
"public String getToolTip ()\r\n\t{\r\n\t\tif (!((imageName.equals(\"GND\")) || (imageName.equals(\"VCC\")) || (imageName.equals(\"BOX\")) || (imageName.equals(\"OUTPUT\"))))\r\n\t\t{\r\n\t\t\tthis.toolTip = \"<html><img src=\"+this.imageName+\"></html>\";\r\n\t\t\treturn this.toolTip;\r\n\t\t}\r\n\t\t\r\n\t\telse if (imageName.equals(\"GND\"))\r\n\t\t\treturn \"GND\";\r\n\t\t\r\n\t\telse if (imageName.equals(\"VCC\"))\r\n\t\t\treturn \"VCC\";\r\n\t\t\r\n\t\telse if (imageName.equals(\"OUTPUT\"))\r\n\t\t\treturn \"Output window\";\r\n\t\t\r\n\t\telse\r\n\t\t\treturn \"TODO\";\r\n\t}",
"@Override\r\n\tpublic String getToolTipText(MouseEvent e) {\r\n\t\tMCLParticleSet particles = model.getParticles();\r\n\t\tif (particles == null) return null;\r\n\t\t\r\n\t\t// If the mouse is on a article, show its weight\r\n\t\tfloat x = e.getX()/ parent.pixelsPerUnit + viewStart.x;\r\n\t\tfloat y = (getHeight() - e.getY())/ parent.pixelsPerUnit + viewStart.y;\r\n\t\tint i = particles.findClosest(x,y);\r\n\t\tMCLParticle part = particles.getParticle(i);\r\n\t\tPose p = part.getPose(); \r\n\t\tif (Math.abs(p.getX() - x) <= 2f && Math.abs(p.getY() - y) <= 2f) return \"Weight \" + part.getWeight();\r\n\t\telse return null;\r\n\t}",
"public abstract ITooltipData getTooltipData();",
"public TooltipOptions getTooltip() {\n return this.tooltip;\n }",
"public String getHover() { return (String)get(\"Hover\"); }",
"@Override\n\tpublic String getToolTipText() {\n\t\treturn \"shopEditorToolTipText\";\n\t}",
"TooltipTextMap getTooltipText() throws SearchServiceException;",
"public abstract String linkText();",
"@Override\r\n\tpublic String getToolTipText() {\n\t\treturn \"\";\r\n\t}",
"public String getTabToolTipText();",
"public String getToolTip(ViewEvent anEvent)\n {\n LineMarker<?>[] markers = getMarkers();\n LineMarker<?> marker = ArrayUtils.findMatch(markers, m -> m.contains(_mx, _my));\n return marker != null ? marker.getToolTip() : null;\n }",
"public String getLocalizedHoverText(ContentEntity entity, boolean expanded);",
"public String getRibbonToolTipText()\n\t{\n\t\treturn ribbonToolTipText;\n\t}",
"public java.lang.String getTip()\n {\n return this.tip;\n }",
"void showTooltip();",
"public SafeHtml getTooltip(C value) {\n return tooltipFallback;\n }",
"String getLink();",
"@Override\n public String getToolTipText(MouseEvent e)\n {\n Point p = e.getPoint();\n int rowIndex = rowAtPoint(p);\n int colIndex = columnAtPoint(p);\n Object cellData = getValueAt(rowIndex, colIndex);\n\n if (cellData instanceof Color)\n {\n Color color = (Color)cellData;\n return \"RGB Color value: \" + color.getRed() + \", \" + color.getGreen() + \", \" + color.getBlue();\n }\n else\n return cellData.toString();\n }",
"java.lang.String getLinkToDiscussion();",
"public JToolTip getCustomToolTip() {\n // to be overwritten by subclasses\n return null;\n }",
"@Override\r\n protected String getTooltip()\r\n {\n return \"This name is used as (unique) name for the pattern.\";\r\n }",
"public URL getHtmlDescription();",
"private String linkString()\n {\n Iterator<DSAGraphNode<E>> iter = links.iterator();\n String outputString = \"\";\n DSAGraphNode<E> node = null;\n while (iter.hasNext())\n {\n node = iter.next();\n outputString = (outputString + node.getLabel() + \", \");\n }\n return outputString;\n }",
"public void setTooltipText() { tooltip.setText(name); }",
"private String generateHoverover(Tool tool) {\n \n String name = tool.getName();\n String desc = tool.getDescription();\n String image = tool.getIcon();\n \n StringBuilder hoverText = new StringBuilder();\n hoverText.append(\"<html>\");\n hoverText.append(\"<div style='width:200px;background-color:white'>\");\n hoverText.append(\"<h3>\");\n hoverText.append(name);\n hoverText.append(\"</h3>\");\n if (desc != null && !desc.equals(\"\")) {\n hoverText.append(\"<p>\");\n hoverText.append(desc);\n hoverText.append(\"</p>\");\n }\n if (image != null && !image.equals(\"\")) {\n \n FileLoader fileLookup = new FileLoader(1);\n \n try {\n Object[] iconURL = fileLookup.getFileURL(image); \n if (iconURL[1] != null && image.startsWith(\"http\")) {\n hoverText.append(\"<p align='center'><img src='\");\n hoverText.append(image);\n hoverText.append(\"' alt='image'></p>\");\n }\n } catch (Exception ex) {\n // there was a problem finding the image, just don't display it\n }\n } \n \n hoverText.append(\"<br>\");\n hoverText.append(\"</div>\");\n hoverText.append(\"</html>\");\n \n return hoverText.toString();\n\n }",
"public String getSourceText() {\n\t\treturn getSource().replaceAll(\"<a.*>(.*)</a>\", \"$1\");\n\t}",
"@Override public String getToolTipText(MouseEvent evt)\n{\n String rslt = null;\n\n int pos = evt.getX();\n int minpos = getX() + 16;\n int maxpos = getX() + getWidth() - 16;\n double relpos = (pos - minpos);\n if (relpos < 0) relpos = 0;\n relpos /= (maxpos - minpos);\n double timer = getMinimum() + relpos * (getMaximum() - getMinimum()) + 0.5;\n long time = (long) timer;\n if (time > getMaximum()) time = getMaximum();\n\n BicexEvaluationContext ctx = for_bubble.getExecution().getCurrentContext();\n if (ctx == null) return null;\n\n BicexValue bv = ctx.getValues().get(\"*LINE*\");\n List<Integer> times = bv.getTimeChanges();\n String line = null;\n for (Integer t : times) {\n if (t <= time) {\n\t line = bv.getStringValue(t+1);\n\t}\n else break;\n }\n if (line != null) rslt = \"Line \" + line;\n\n if (ctx != null) {\n String what = \"In\";\n if (ctx.getInnerContexts() != null) {\n\t for (BicexEvaluationContext sctx : ctx.getInnerContexts()) {\n\t if (sctx.getStartTime() <= time && sctx.getEndTime() >= time) {\n\t ctx = sctx;\n\t what = \"Calling\";\n\t break;\n\t }\n\t }\n }\n if (rslt == null) rslt = what + \" \" + ctx.getMethod();\n else rslt += \" \" + what + \" \" + ctx.getShortName();\n }\n\n return rslt;\n}",
"public String getLink();",
"private Tooltip generateToolTip(ELesxFunction type) {\n Tooltip tool = new Tooltip();\n StringBuilder text = new StringBuilder();\n if (type == ELesxFunction.PERIOD) {\n text.append(\"Una fecha puede ser invalida por:\\n\")\n .append(\" - Fecha incompleta.\\n\")\n .append(\" - Fecha inicial es posterior a la final.\");\n }\n else {\n text.append(\"La función Suma determina:\\n\")\n .append(\" - Sumatoria total de los precios del recurso seleccionado.\\n\")\n .append(\" - Suma el total de la sumatoria del punto anterior si son varios recursos\\n\")\n .append(\" - Ignora las Fechas de los precios.\");\n }\n tool.setText(text.toString());\n return tool;\n }",
"String getLinkName();",
"@Nullable\n @OnlyIn(Dist.CLIENT)\n @Override\n public List<String> getAdvancedToolTip(@Nonnull ItemStack stack) {\n return ClientUtils.wrapStringToLength(I18n.format(\"item_cheap_magnet.desc\"), 35);\n }",
"@Override\n\t\tpublic String toString() {\n\t\t\treturn \"下载链接:\"+showLink;\n\t\t}",
"public DateFormat getTooltipDateFormat() {\r\n return calendarTable.getTooltipDateFormat();\r\n }",
"public String generateToolTip(XYDataset data, int series, int item) {\n\n return getToolTipText(series, item);\n\n }",
"public String getLinkName();",
"public FakeToolTip getFakeToolTip() {\n\t\treturn fakeToolTip;\n\t}",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"public String getHoverColorAsString() {\n\t\treturn getValue(CommonProperty.HOVER_COLOR, AbstractLabels.DEFAULT_COLOR);\n\t}",
"private String getColor(String link) throws IOException {\n try {\n return Jsoup.connect(link)\n .get()\n .select(\"div[class=rc-tooltip-inner]\")\n .html();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return \"\";\n }",
"@Override\n public void setTooltip(String arg0)\n {\n \n }",
"public java.lang.String getLink()\n {\n return this.link;\n }",
"public String getToolTipText(int series, int item) {\n\n String result = null;\n\n if (series < getListCount()) {\n List tooltips = (List) this.toolTipSeries.get(series);\n if (tooltips != null) {\n if (item < tooltips.size()) {\n result = (String) tooltips.get(item);\n }\n }\n }\n\n return result;\n }",
"public String getDisplayText() {\r\n\t\treturn Strings.isNOTNullOrEmpty(this.getText())\r\n\t\t\t\t\t\t? this.getText()\r\n\t\t\t\t\t\t: Strings.isNOTNullOrEmpty(this.getDescription())\r\n\t\t\t\t\t\t\t\t? this.getDescription()\r\n\t\t\t\t\t\t\t\t: this.getUrl() != null\r\n\t\t\t\t\t\t\t\t\t\t? this.getUrl().asString()\r\n\t\t\t\t\t\t\t\t\t\t: \"NO TEXT DEFINED\";\r\n\t}",
"public String getTooltipDatePattern() {\r\n return calendarTable.getTooltipDatePattern();\r\n }",
"public String getLinkTitle() {\r\n\t\treturn linkTitle;\r\n\t}",
"public String getHelpMessage ( ) {\r\n\t\tString html = \"<html><body>\";\r\n\t\thtml += \"<p>\";\r\n\t\thtml += \"The MSX Infrared Astrometric Catalog<br>\";\r\n\t\thtml += \"Astronomical Data Center catalog No. 5098<br>\";\r\n\t\thtml += \"</p><p>\";\r\n\t\thtml += \"Download:\";\r\n\t\thtml += \"<blockquote>\";\r\n\t\thtml += \"<u><font color=\\\"#0000ff\\\">ftp://dbc.nao.ac.jp/DBC/NASAADC/catalogs/5/5098/msx.dat.gz</font></u>\";\r\n\t\thtml += \"</blockquote>\";\r\n\t\thtml += \"</p>\";\r\n\t\thtml += \"</body></html>\";\r\n\t\treturn html;\r\n\t}",
"public String getResult() {\n\t\treturn ((WebElement) links.get(1)).getAttribute(\"alt\");\n\t}",
"@Override\n\tpublic void setToolTip(String tooltip) {\n\t\t\n\t}",
"public String getLinkString() {\n\t\treturn linkString;\n\t}",
"public String getToolTip(int columnIndex) {\n\t\t//@formatter:off\n\t\tList<ColumnConstraintSet<R, ?>> filtered =\n\t\t\tconstraintSets.stream()\n\t\t\t\t.filter(cf -> cf.getColumnModelIndex() == columnIndex)\n\t\t\t\t.collect(Collectors.toList());\n\t\t//@formatter:on\n\n\t\tif (filtered.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\treturn getHtmlRepresentation(filtered);\n\t}",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();",
"String getDescription();"
] | [
"0.7245518",
"0.70698035",
"0.70540565",
"0.69796365",
"0.6936128",
"0.6926207",
"0.6911429",
"0.685355",
"0.6780203",
"0.67603725",
"0.67266756",
"0.671017",
"0.66136384",
"0.6543905",
"0.6478638",
"0.6410121",
"0.6393762",
"0.63927424",
"0.6368449",
"0.6315382",
"0.6299086",
"0.6291438",
"0.6285802",
"0.62812394",
"0.62602574",
"0.6254567",
"0.6230028",
"0.62285507",
"0.61732495",
"0.61676484",
"0.6160419",
"0.6159153",
"0.61489964",
"0.61441356",
"0.6134238",
"0.61208165",
"0.60852885",
"0.60674804",
"0.60335577",
"0.5987427",
"0.59746337",
"0.5968507",
"0.5964826",
"0.5870381",
"0.5859835",
"0.58440584",
"0.58131003",
"0.5800587",
"0.57959825",
"0.5774482",
"0.576573",
"0.5758307",
"0.57112914",
"0.5698888",
"0.5697094",
"0.5679295",
"0.5669438",
"0.5657069",
"0.5607704",
"0.55822134",
"0.55762225",
"0.5569014",
"0.55444056",
"0.5541777",
"0.5541777",
"0.5541777",
"0.5541777",
"0.5541777",
"0.5541777",
"0.5541777",
"0.5541777",
"0.5541777",
"0.55366474",
"0.5513841",
"0.54973555",
"0.54730636",
"0.5472883",
"0.5462844",
"0.54597986",
"0.54521304",
"0.5417844",
"0.5400332",
"0.539168",
"0.53861386",
"0.53851175",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837",
"0.5381837"
] | 0.0 | -1 |
Update the stock transfered in database | private void updateStocks(StockTransferTransactionRequest item) {
Integer updatedQuantity = item.getQuantity();
StockTraderServiceFactoryIF serviceFactory = new StockTraderServiceFactory();
DematServiceIF dematService = serviceFactory.dematService();
Optional<Integer> oldQuantity = dematService.getStockStatus(item.getUserName(),
item.getStock());
if(oldQuantity != null && oldQuantity.get() > 0) {
updatedQuantity = oldQuantity.get() + item.getQuantity();
}
try(Connection conn = DriverManager.getConnection(Constants.DB_URL,
Constants.USER,
Constants.PASS);
PreparedStatement stmt = conn.prepareStatement(
Constants.MERGE_STOCK)) {
stmt.setString(1, item.getUserName());
stmt.setString(2, item.getStock().toString());
stmt.setInt(3, updatedQuantity);
stmt.execute();
} catch (SQLException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void updateStock(Stock s) {\n\n\t\ttry {\n\t String sql = \"INSERT or Replace into stockTable (hlr,sim,card,easyL,easyLR,easyP,easyPR,cash) \"\n\t \t\t+ \"VALUES (?,?,?,?,?,?,?,?)\";\n\t \n\t prepStmt = connection.prepareStatement(sql);\n\t prepStmt.setInt(1, s.getHlr());\n\t prepStmt.setInt(2, s.getSim());\n\t prepStmt.setInt(3, s.getCard());\n\t prepStmt.setInt(4, s.getEasyLoad());\n\t prepStmt.setInt(5, s.getEasyLoadReturn());\n\t prepStmt.setInt(6, s.getEasyPaisa());\n\t prepStmt.setInt(7, s.getEasyPaisaReturn());\n\t prepStmt.setInt(8,s.getCash());\n\t \t\t \n\t prepStmt.executeUpdate();\n\t \n\n\t System.out.println(\">>> Successfully insert query working\"); \n\t } catch (SQLException ex) {\n \n\t \t System.out.println(\"*** Error: insert query is not working\");\n\t \t ex.printStackTrace();\n\t \t \n\t }\n\t\t\n\t\t\n\t}",
"@Override\n\tpublic void update(StockDataRecord bo) throws SQLException {\n\t\t\n\t}",
"@Override\n\tpublic boolean updateStock(int quant) {\n\t\treturn false;\n\t}",
"@Test\n\tpublic void testUpdateStock() {\n\t\tStock stock = null;\n\t\tString productId = \"HY-1004\";\n\t\tTestFactory tf = new TestFactory();\n\t\tEntityManager em = emf.createEntityManager();\n\t\ttry {\n\t\t\tif (!tf.createStock(em, productId)) {\n\t\t\t\tfail(\"Unable to create \"); // doubt\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tem.getTransaction().begin();\n\t\t\t// Find Stock for update\n\t\t\tstock = em.find(Stock.class, productId);\n\t\t\t// Update Business Partner\n\t\t\tstock.setQuantity(BigDecimal.valueOf(10));\n\t\t\tem.persist(stock);\n\t\t\tem.getTransaction().commit();\n\t\t\t// Find Business Partner after update\n\t\t\tstock = em.find(Stock.class, productId);\n\t\t\tassertEquals(\n\t\t\t\t\t\"Update Stock: Stock attribute quantity not updated in the database\",\n\t\t\t\t\tBigDecimal.valueOf(10), stock.getQuantity());\n\t\t\ttf.deleteStock(em, productId);\n\t\t} finally {\n\t\t\tem.close();\n\t\t}\n\n\t}",
"private void actualizarStock(String codBarras) throws SQLException {\n\n }",
"@Override\r\n\tpublic void stockUpdate(adminStockVO vo) {\n\t\tadminDAO.stockUpdate(vo);\r\n\t}",
"@Override\n\tpublic Integer update(InvBaseStock baseStock) {\n\t\treturn invBaseStockDao.update(baseStock);\n\t}",
"public void Update(StokContract entity) {\n\t\t\n\t}",
"public void setStock_update(String stock_update) {\n this.stock_update = stock_update;\n }",
"int updateByPrimaryKey(ItemStockDO record);",
"int updateByPrimaryKey(ItemStockDO record);",
"public void stockSold(String stockCode){\t\r\n\t\taskInt = Double.parseDouble(words[2]);\r\n\t\tcost = 0;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tConnection con = DriverManager.getConnection(dbUrl, name, pw);\r\n\t\t\tStatement state = con.createStatement();\r\n\t\t\tResultSet res = state.executeQuery(\"SELECT * FROM portfolio\");\r\n\t\t\twhile(res.next()){\r\n\t\t\t\tif(res.getString(\"stocktick\").equals(stockCode)){\r\n\t\t\t\t\tint saleAmount = res.getInt(\"amount\");\r\n\t\t\t\t\tamountInt = saleAmount;\r\n\t\t\t\t\tamountInt = amountInt * askInt;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tprepSt = con.prepareStatement(\"DELETE FROM portfolio WHERE stocktick = ?\");\r\n\t\t\tprepSt.setString(1, stockCode);\r\n\t\t\t\r\n\t\t\tprepSt.executeUpdate();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Deletion Complete\");\r\n\t\t\tcurrent = current + amountInt;\r\n\t\t\t\r\n\t\t\tprepSt = con.prepareStatement(\"UPDATE funds SET current = ?\");\r\n\t\t\tprepSt.setDouble(1, current);\r\n\t\t\t\r\n\t\t\tprepSt.executeUpdate();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Update Complete\");\r\n\t\t\t\r\n\t\t\tres = state.executeQuery(\"SELECT * FROM portfolio\");\r\n\t\t\t\r\n\t\t\twhile(res.next()){\r\n\t\t\t\tcost = cost + res.getDouble(\"cost\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunds.setText(\"Funds Available: $\" + NumberFormat.getNumberInstance().format(current) + \" Invested: $\" + NumberFormat.getNumberInstance().format(cost));\r\n\t\t\t\r\n\t\t\tprepSt.close();\r\n\t\t\tstate.close();\r\n\t \tcon.close();\r\n\t\t} \r\n\t\t\r\n\t\tcatch (SQLException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tstatus.setText(\"Sale Complete. You have sold $\" + NumberFormat.getNumberInstance().format(amountInt) + \" worth of \" + stock.getText() + \" shares.\");\r\n\t \tsearchPanel.remove(bpAction);\r\n\t \tsearchPanel.remove(seAction);\r\n\t}",
"public ProductWithStockItemTO updateStockItem(long storeID, StockItemTO stockItemTO) throws NotInDatabaseException, UpdateException;",
"private void UpdateItemStock(Cursor crsrUpdateStock, float Quantity) {\n int iResult = 0;\n float fCurrentStock = 0, fNewStock = 0;\n\n // Get current stock of item\n fCurrentStock = crsrUpdateStock.getFloat(crsrUpdateStock.getColumnIndex(\"Quantity\"));\n\n // New Stock\n fNewStock = fCurrentStock - Quantity;\n\n // Update new stock for item\n iResult = db.updateItemStock(crsrUpdateStock.getInt(crsrUpdateStock.getColumnIndex(\"MenuCode\")),\n fNewStock);\n\n Log.d(\"UpdateItemStock\", \"Updated Rows:\" + iResult);\n\n }",
"private void UpdateItemStock(Cursor crsrUpdateStock, float Quantity) {\r\n int iResult = 0;\r\n float fCurrentStock = 0, fNewStock = 0;\r\n\r\n // Get current stock of item\r\n fCurrentStock = crsrUpdateStock.getFloat(crsrUpdateStock.getColumnIndex(\"Quantity\"));\r\n\r\n // New Stock\r\n fNewStock = fCurrentStock - Quantity;\r\n\r\n // Update new stock for item\r\n iResult = db.updateItemStock(crsrUpdateStock.getInt(crsrUpdateStock.getColumnIndex(\"MenuCode\")),\r\n fNewStock);\r\n\r\n Log.d(\"UpdateItemStock\", \"Updated Rows:\" + iResult);\r\n\r\n }",
"@Override\n\tpublic Item update() {\n\t\t\n\t\treadAll();\n\t\n\t\tLOGGER.info(\"State the shoe name you wish to update\");\n\t\tString name = util.getString().toLowerCase();;\n\t\tLOGGER.info(\"State the size you wish to update\");\n\t\tdouble size = util.getDouble();\n\t\tLOGGER.info(\"Change price\");\n\t\tdouble price = util.getDouble();\n\t\tLOGGER.info(\"Change amount in stock\");\n\t\tlong stock = util.getLong();\n\t\tLOGGER.info(\"\\n\");\n\t\treturn itemDAO.update(new Item(name,size,price,stock));\n\t\t\n\t\t\n\t\t\n\t}",
"public void updateStockData() {\n\t\t\ttry {\n\t\t\t\tthis.dataURL = new URL(this.url);\n\t\t\t} catch (final MalformedURLException e) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"CRITICAL ERROR: The impossible has happened! The hard-hoded URL was malformed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\tScanner scanner;\n\t\t\ttry {\n\t\t\t\tscanner = new Scanner(this.dataURL.openStream());\n\t\t\t\twhile (scanner.hasNextLine())\n\t\t\t\t\ttry {\n\t\t\t\t\t\tscanner\n\t\t\t\t\t\t\t\t.findInLine(Pattern\n\t\t\t\t\t\t\t\t\t\t.compile(\"([0-9.]*),\\\"([0-9a-zA-Z._-]*)\\\",\\\"([a-zA-Z._\\\\s-]*)\\\"\"));\n\t\t\t\t\t\tfinal MatchResult result = scanner.match();\n\t\t\t\t\t\tboolean found = false;\n\t\t\t\t\t\tfor (final StockCompany company : StockBrokerImpl.this.stockData)\n\t\t\t\t\t\t\tif (company.getCompanySymbol().equals(\n\t\t\t\t\t\t\t\t\tresult.group(2))) {\n\t\t\t\t\t\t\t\tfinal Double stockPrice = Double\n\t\t\t\t\t\t\t\t\t\t.parseDouble(result.group(1));\n\t\t\t\t\t\t\t\tcompany.setStockPrice(stockPrice);\n\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!found)\n\t\t\t\t\t\t\tStockBrokerImpl.this.stockData\n\t\t\t\t\t\t\t\t\t.add(new StockCompany(result.group(3),\n\t\t\t\t\t\t\t\t\t\t\tresult.group(2), Double\n\t\t\t\t\t\t\t\t\t\t\t\t\t.parseDouble(result\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.group(1))));\n\n\t\t\t\t\t\tscanner.nextLine();\n\n\t\t\t\t\t} catch (final NumberFormatException e) {\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"CRITICAL ERROR: Update data corrupted. [Virtually impossible]\");\n\t\t\t\t\t\tSystem.exit(1);\n\t\t\t\t\t}\n\t\t\t\tscanner.close();\n\t\t\t} catch (final IOException e) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"ERROR: Connection to stock price update feed could not be established.\");\n\t\t\t}\n\t\t}",
"public void updateActivarGestionStock(Map criteria);",
"private void updateBtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_updateBtnMouseClicked\n String id = pidTxt.getText().toString();\n String name = pnameTxt.getText().toString();\n String price = pperpriceTxt.getText().toString();\n String quantity = pquanityTxt.getText().toString();\n String date = pdateTxt.getText().toString();\n\n try {\n String Query = \"UPDATE `stock` SET `Product_Name`=?,`Quantity`=?,`Entry_Date`=?,`Price`=? Where `Product_ID`=?\";\n\n pstm = con.prepareStatement(Query);\n\n pstm.setString(1, name);\n\n pstm.setInt(2, Integer.parseInt(quantity));\n pstm.setString(3, date);\n pstm.setInt(4, Integer.parseInt(price));\n pstm.setInt(5, Integer.parseInt(id));\n pstm.executeUpdate();\n } catch (Exception ex) {\n\n JOptionPane.showMessageDialog(null, \"Data Not Found To be Updated\");\n }\n\n //Refersh Table\n refTable();\n\n }",
"private void update() {\n\n\t\tfloat shopping = Float.parseFloat(label_2.getText());\n\t\tfloat giveing = Float.parseFloat(label_5.getText());\n\t\tfloat companyDemand = Float.parseFloat(label_7.getText());\n\n\t\ttry {\n\t\t\tPreparedStatement statement = DBConnection.connection\n\t\t\t\t\t.prepareStatement(\"update customer_list set Shopping_Account = \"\n\t\t\t\t\t\t\t+ shopping\n\t\t\t\t\t\t\t+ \" , Giving_Money_Account = \"\n\t\t\t\t\t\t\t+ giveing\n\t\t\t\t\t\t\t+ \", Company_demand = \"\n\t\t\t\t\t\t\t+ companyDemand\n\t\t\t\t\t\t\t+ \" where Name = '\"\n\t\t\t\t\t\t\t+ name\n\t\t\t\t\t\t\t+ \"' And Last_Name = '\"\n\t\t\t\t\t\t\t+ lastName + \"' \");\n\t\t\tstatement.execute();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\t}",
"public static void update(Connection connection) throws SQLException {\r\n\r\n //display what is required, create a scanner and get input from user\r\n System.out.println(\"UPDATE STOCK QTY\\nSelect the toy you would like to update:\\nFormat (Toy, Qty) example: Barbie, 55\");\r\n Scanner scan = new Scanner(System.in);\r\n\r\n //input is stored in an array and then converted to the required\r\n //variable types for the database (toy(string), qty(INT))\r\n Statement statement = connection.createStatement();\r\n String update = scan.nextLine();\r\n\r\n\r\n String[] updateArray = update.split(\", \");\r\n String toy = updateArray[0];\r\n int amount = Integer.parseInt(updateArray[1]);\r\n\r\n //update the the qty where the toy in the database is = to the toy given by the user\r\n statement.executeUpdate(\"UPDATE toy_stock SET qty=\" + amount + \" WHERE toy='\" + toy + \"'\");\r\n System.out.println(\"Row Successfully updated: \" + Arrays.toString(updateArray) + \"\\n\");\r\n\r\n //return to the main menu\r\n menu(connection);\r\n\r\n }",
"public void updateconsumption(HealthSearch healthSearcher,int amount,String id, String time,double price) {\n\t\ttry {\n\t\t\tConnection connection = this.getConnection();\n\t\t\tPreparedStatement stmt = connection.prepareStatement(\"SELECT protein, energy, fiber,price FROM diet_conclusion where id = ? AND date = ?\");\n\t\t\tstmt.setString(1,id);\n\t\t\tstmt.setString(2,time.substring(0,8));\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\tif(rs.next()) {\n\t\t\t\tdouble previous_energy =0;\n\t\t\t\tdouble previous_fiber =0;\n\t\t\t\tdouble previous_protein =0;\n\t\t\t\tdouble previous_price = 0;\n\t\t\t\tdouble current_protein = 0;\n\t\t\t\tdouble current_energy =0;\n\t\t\t\tdouble current_fiber = 0;\n\t\t\t\tdouble current_price = 0;\n\t\t\t\tprevious_protein = rs.getDouble(1);\n\t\t\t\tprevious_energy = rs.getDouble(2);\n\t\t\t\tprevious_fiber = rs.getDouble(3);\n\t\t\t\tprevious_price = rs.getDouble(4);\n\n\t\t\t\tcurrent_price = price + previous_price;\n\n\n\t\t\t\tif( !healthSearcher.getProtein().equals(\"0\")) {\n\t\t\t\t\t current_protein = previous_protein + Double.parseDouble(healthSearcher.getProtein())*amount/100.0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent_protein = previous_protein;\n\n\t\t\t\t}\n\t\t\t\tif( !healthSearcher.getEnergy().equals(\"0\")) {\n\t\t\t\t\tcurrent_energy = previous_energy + Double.parseDouble(healthSearcher.getEnergy())*amount/100.0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent_energy = previous_energy;\n\t\t\t\t}\n\t\t\t\tif( !healthSearcher.getFiber().equals(\"0\")) {\n\t\t\t\t\tcurrent_fiber = previous_fiber + Double.parseDouble(healthSearcher.getFiber())*amount/100.0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent_fiber = previous_fiber;\n\t\t\t\t}\n\t\t\t\tPreparedStatement stmt2 = connection.prepareStatement(\n\t\t\t\t\"UPDATE diet_conclusion SET protein = ?, energy = ?, fiber = ?, price=? WHERE id = ? AND date = ?;\");\n\n\t\t\t\tstmt2.setDouble(1, current_protein);\n\t\t\t\tstmt2.setDouble(2, current_energy);\n\t\t\t\tstmt2.setDouble(3, current_fiber);\n\t\t\t\tstmt2.setDouble(4, current_price);\n\t\t\t\tstmt2.setString(5, id);\n\t\t\t\tstmt2.setString(6, time.substring(0,8));\n\t\t\t\tstmt2.execute();\n\t\t\t\tstmt2.close();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tPreparedStatement stmt1 = connection.prepareStatement(\n\t\t\t\t\t\t\"INSERT INTO diet_conclusion VALUES(?,?,?,?,?,?)\");\n\t\t\t\tstmt1.setString(1,id);\n\t\t\t\tstmt1.setString(2, time.substring(0,8));\n\t\t\t\tstmt1.setDouble(3, Double.parseDouble(healthSearcher.getProtein())*amount/100.0);\n\t\t\t\tstmt1.setDouble(4, Double.parseDouble(healthSearcher.getEnergy())*amount/100.0);\n\t\t\t\tstmt1.setDouble(5, Double.parseDouble(healthSearcher.getFiber())*amount/100.0);\n\t\t\t\tstmt1.setDouble(6, price);\n\t\t\t\tstmt1.execute();\n\t\t\t\tstmt1.close();\n\t\t\t}\n\t\t\tstmt.close();\n\t\t\trs.close();\n\t\t\tconnection.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}",
"private void updateSoldProductInfo() { public static final String COL_SOLD_PRODUCT_CODE = \"sells_code\";\n// public static final String COL_SOLD_PRODUCT_SELL_ID = \"sells_id\";\n// public static final String COL_SOLD_PRODUCT_PRODUCT_ID = \"sells_product_id\";\n// public static final String COL_SOLD_PRODUCT_PRICE = \"product_price\";\n// public static final String COL_SOLD_PRODUCT_QUANTITY = \"quantity\";\n// public static final String COL_SOLD_PRODUCT_TOTAL_PRICE = \"total_price\";\n// public static final String COL_SOLD_PRODUCT_PENDING_STATUS = \"pending_status\";\n//\n\n for (ProductListModel product : products){\n soldProductInfo.storeSoldProductInfo(new SoldProductModel(\n printInfo.getInvoiceTv(),\n printInfo.getInvoiceTv(),\n product.getpCode(),\n product.getpPrice(),\n product.getpSelectQuantity(),\n printInfo.getTotalAmountTv(),\n paymentStatus+\"\"\n ));\n\n }\n }",
"public void updatehotelincome(double price ){\n String query = \"update Hotel set Income = Income + ? \";\n \n try {\n PreparedStatement Query = conn.prepareStatement(query);\n Query.setDouble(1,price);\n Query.execute();\n \n } catch (SQLException ex) {\n Logger.getLogger(sqlcommands.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }",
"public void UpdateTransaction() {\n\t\tgetUsername();\n\t\tcol_transactionID.setCellValueFactory(new PropertyValueFactory<Account, Integer>(\"transactionID\"));\n\t\tcol_date.setCellValueFactory(new PropertyValueFactory<Account, Date>(\"date\"));\n\t\tcol_description.setCellValueFactory(new PropertyValueFactory<Account, String>(\"description\"));\n\t\tcol_category.setCellValueFactory(new PropertyValueFactory<Account, String>(\"category\"));\n\t\tcol_amount.setCellValueFactory(new PropertyValueFactory<Account, Double>(\"amount\"));\n\t\tmySqlCon.setUsername(username);\n\t\tlists = mySqlCon.getAccountData();\n\t\ttableTransactions.setItems(lists);\n\t}",
"public String getStock_update() {\n return stock_update;\n }",
"public void setStock(Integer shopID, Integer stock){\n\t\tString query = \"UPDATE `shops` SET stock=? WHERE shop_id=?;\";\n\t\tdebugOut(query);\n\t\ttry {\n\t\t\tPreparedStatement sql = connection.prepareStatement(query);\n\t\t\tsql.setInt(1, stock);\n\t\t\tsql.setInt(2, shopID);\n\t\t\tsql.executeUpdate();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public ProductWithStockItemTO changePrice(long storeID, StockItemTO stockItemTO) throws NotInDatabaseException, UpdateException;",
"void stockPriceChanged(Stock stock, double oldValue, double newValue);",
"public void stockPurchase(String stockCode, String stockAmount){\r\n\t\tcost = 0;\r\n\t\t\r\n\t\tSystem.out.println(stockAmount);\r\n\t\tSystem.out.println(stockCode);\r\n\t\tSystem.out.println(words[0]);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tConnection con = DriverManager.getConnection(dbUrl, name, pw);\r\n\t\t\tStatement state = con.createStatement();\r\n\t\t\tprepSt = con.prepareStatement(\"INSERT INTO portfolio (stocktick, stock, ask, bid, amount, cost)\"\r\n\t\t\t\t\t+ \" VALUES (?, ?, ?, ?, ?, ?)\");\r\n\t\t\tprepSt.setString(1, stockCode);\r\n\t\t\tprepSt.setString(2, words[0]);\r\n\t\t\tprepSt.setDouble(3, Double.parseDouble(words[1]));\r\n\t\t\tprepSt.setDouble(4, Double.parseDouble(words[2]));\r\n\t\t\tprepSt.setInt(5, Integer.parseInt(stockAmount));\r\n\t\t\tprepSt.setDouble(6, amountInt);\r\n\t\t\t\r\n\t\t\tprepSt.executeUpdate();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Insert Complete\");\r\n\t\t\tcurrent = current - amountInt;\r\n\t\t\t\r\n\t\t\tprepSt = con.prepareStatement(\"UPDATE funds SET current = ?\");\r\n\t\t\tprepSt.setDouble(1, current);\r\n\t\t\t\r\n\t\t\tprepSt.executeUpdate();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Update Complete\");\r\n\t\t\t\r\n\t\t\tResultSet res = state.executeQuery(\"SELECT * FROM portfolio\");\r\n\t\t\t\r\n\t\t\twhile(res.next()){\r\n\t\t\t\tcost = cost + res.getDouble(\"cost\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunds.setText(\"Funds Available: $\" + NumberFormat.getNumberInstance().format(current) + \" Invested: $\" + NumberFormat.getNumberInstance().format(cost));\r\n\t\t\t\r\n\t \tprepSt.close();\r\n\t \tcon.close();\r\n\t\t}\r\n\t\t\r\n\t\tcatch (SQLException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t \tsearchPanel.remove(bpAction);\r\n\t \tsearchPanel.remove(seAction);\r\n\t}",
"@Modifying(clearAutomatically = true)\n @Query(\"UPDATE Item i SET i.quantity = i.quantity - ?1 WHERE i =?2\")\n int deductFromStock(double qty, Item item);",
"public void stockItem(String upc, int qty) \n\n\t\t\tthrows SQLException, ClassNotFoundException, IOException\n\n\t\t\t{\n\n\t\tif(qty < 0 )\n\n\t\t\t//sanity check\n\n\t\t\tthrow new IOException(\"Quantity input cannot be less than 0.\");\n\n\n\n\t\tif(this.conn == null)\n\n\t\t\tthis.conn = JDBCConnection.getConnection();\n\n\n\n\t\tPreparedStatement stmt = conn.prepareStatement(\n\n\t\t\t\t\"UPDATE Item \" +\n\n\t\t\t\t\t\t\"SET stock = stock + ? \" +\n\n\t\t\t\t\"WHERE upc = ? \");\n\n\t\tstmt.setInt(1, qty);\n\n\t\tstmt.setString(2, upc);\n\n\t\ttry\n\n\t\t{\n\n\t\t\tint update = stmt.executeUpdate();\n\n\t\t\tif(update == 1)\n\n\t\t\t\treturn;\n\n\t\t\telse if(update == 0)\n\n\t\t\t\t//if none is update\n\n\t\t\t\tthrow new SQLException(\"The Item with upc \" + upc + \" does \" +\n\n\t\t\t\t\t\t\"not exist.\");\n\n\t\t\telse\n\n\t\t\t\t//Fatal error: more than 1 tuple is updated -> duplicate upc!!!\n\n\t\t\t\tthrow new SQLException(\"Fatal Error: Duplicate UPC!\");\n\n\t\t}\n\n\t\tfinally\n\n\t\t{\n\n\t\t\tstmt.close();\n\n\t\t}\n\n\t\t\t}",
"@Override\n\tpublic Integer updateQtyForFrozen(InvBaseStock baseStock) {\n\t\treturn invBaseStockDao.updateQtyForFrozen(baseStock);\n\t}",
"public void changeStockVal() {\n double old = _stockVal;\n _stockVal = 0;\n for (Company x : _stocks.keySet()) {\n _stockVal += x.getPrice() * _stocks.get(x);\n }\n _stockValChanged = _stockVal - old;\n\n }",
"@Override\n\tpublic int reduceStock(Integer id, Integer quantity) {\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\t \n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"update product set stock=stock-? where id=?\");\n\t\t\tpst.setInt(1,quantity);\n\t\t\tpst.setInt(2, id);\n\t\t\t\n\t\n\t\t\treturn pst.executeUpdate();\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public int Edshare(Long cid, Long shareamt,String datee, Long shareno, Long sindex) throws SQLException,ClassNotFoundException{\n\tint i=DbConnect.getStatement().executeUpdate(\"update share_details set no_share=\"+shareno+\",shareprice=\"+shareamt+\",shareindex=\"+sindex+\" where comp_id=\"+cid+\" and DATEOFTRANS='\"+datee+\"'\");\r\n\treturn i;\r\n\t\r\n}",
"public synchronized void updateCurrentMarket() throws InvalidDataException {\n\t\tPrice topBuyPrice = (getBuySide().topOfBookPrice() == null) ? PriceFactory.makeLimitPrice(0) : getBuySide().topOfBookPrice();\n\t\tPrice topSellPrice = (getSellSide().topOfBookPrice() == null) ? PriceFactory.makeLimitPrice(0) : getSellSide().topOfBookPrice();\n\n\t\tString data = topBuyPrice.toString() + getBuySide().topOfBookVolume()\n\t\t\t\t\t+ topSellPrice.toString() + getSellSide().topOfBookVolume();\n\t\tif (!getLatestMarketData().equals(data)) {\n\t\t\tMarketDataDTO latestData = new MarketDataDTO(getStock(), topBuyPrice, \n\t\t\t\t\tgetBuySide().topOfBookVolume(), topSellPrice, getSellSide().topOfBookVolume());\n\t\t\tCurrentMarketPublisher.getInstance().publishCurrentMarket(latestData);\n\t\t\tsetLatestMarketData(data);\n\t\t}\n\t}",
"public boolean updateBill(Bill bill){\n\t\tTraveller trav = bill.getItems().traveller();\n\t\twhile(trav.hasNext()){\n\t\t\tItem item = (Item) trav.next();\n\t\t\tString selectQuery = \"select qty from stock where item_name = ? and expire_date = ? and category = ?\"\n\t\t\t\t\t+ \" and price = ?;\";\n\t\t\ttry(PreparedStatement preStmt = connection.prepareStatement(selectQuery)){\n\t\t\t\tpreStmt.setString(1, item.getName());\n\t\t\t\tpreStmt.setDate(2, item.getExpireDate());\n\t\t\t\tpreStmt.setString(3, item.getCategory());\n\t\t\t\tpreStmt.setFloat(4, item.getPrice());\n\t\t\t\tResultSet result= preStmt.executeQuery(selectQuery);\n\t\t\t\tif(result.first()){\n\t\t\t\t\tint oldQty = result.getInt(1);\n\t\t\t\t\tItem itemClone = item.clone();\n\t\t\t\t\titemClone.setQuantity(oldQty - item.getQuantity());\n\t\t\t\t\tupdateDB(itemClone);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(\"No item found on stock\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}catch(SQLException exp){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Error in Stock table processing: \"+exp.getMessage());\n\t\t\t\texp.printStackTrace();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public void setStock(int stock) {\n this.stock = stock;\n }",
"public void setStock(int stock) {\n this.stock = stock;\n }",
"public void updateDesactivarGestionStock(Map criteria);",
"protected void updateStockPrice( final D dto )\n {\n final String methodName = \"updateStockPrice\";\n logMethodBegin( methodName, dto );\n Objects.requireNonNull( dto, \"dto argument cannot be null\" );\n this.stockPriceQuoteService\n .setStockPriceQuote( (StockPriceQuoteDTOContainer) dto );\n logMethodEnd( methodName );\n }",
"public void save()throws Exception{\n if(!pname1.getText().isEmpty() && !qty1.getText().isEmpty() && !prc1.getText().isEmpty() && !rsp1.getText().isEmpty() ){\r\n s_notif1.setId(\"hide\");\r\n ArrayList<Product> ar = new ArrayList<>();\r\n com.mysql.jdbc.Connection conn = db.getConnection();\r\n Statement stm = conn.createStatement();\r\n int rs = stm.executeUpdate(\"UPDATE products SET \"\r\n + \"name='\"+pname1.getText()+\"', \"\r\n + \"qty='\"+qty1.getText()+\"', \"\r\n + \"price='\"+prc1.getText()+\"',\"\r\n + \"re_stock_point='\"+rsp1.getText()+\"' WHERE ID ='\"+S_ID+\"';\");\r\n if(rs > 0){\r\n s_notif1.setId(\"show\");\r\n }\r\n }\r\n loadData();\r\n }",
"public void restock(Connection con, Statement s, int prod_id, int cat_id, int deficit )\n {\n int qtyToOrder = deficit + 100;\n int wareOrdId = assignID(con, s, \"store_orders\");\n String storeOrders = \"insert into store_orders(order_num, Loc_id, date_ordered) values(\" + wareOrdId +\", \" + Loc_id + \", '\"+date + \"')\";\n String storeOrder = \"insert into store_order(order_num, purpose) values(\" + assignID(con, s, \"store_order\") +\", '\"+purpose+\"')\";\n String vendor = findCheapVendor(con, s, prod_id, cat_id);\n double price = getStoreBuysPrice(con, s, vendor, prod_id, cat_id);\n String updateOrdFrom = \"insert into store_order_from(order_num, name) values(\" + wareOrdId + \", '\" + vendor + \"')\";\n String updateStoreBuys = \"insert into store_buys(order_num, cat_id, prod_id, qty, price, buy_date) values(\" + wareOrdId + \", \" + cat_id + \", \" + prod_id + \", \" + qtyToOrder + \", \" + price + \", '\" + date +\"')\";\n String updateStoredIn = \"update stored_in set qty = \" + (qtyToOrder) + \" where prod_id = \" + prod_id + \" and cat_id = \" + cat_id + \" and Loc_id = \" + Loc_id;\n try\n {\n int i = s.executeUpdate(storeOrder);\n i = s.executeUpdate(storeOrders);\n i = s.executeUpdate(updateOrdFrom);\n i = s.executeUpdate(updateStoreBuys);\n i = s.executeUpdate(updateStoredIn);\n }catch(Exception e)\n {\n System.out.println(\"updates failed\");\n System.exit(0);\n }\n }",
"stockFilePT102.StockDocument.Stock addNewStock();",
"@Override\n public void onClick(View view) {\n if (quantity > 0) {\n int decrementedQuantity = quantity - 1;\n\n //Get the URI with the ID for the row\n Uri quantityUri = ContentUris.withAppendedId(BookEntry.CONTENT_URI, currentBookId);\n\n //Update the database with the new quantity value\n ContentValues values = new ContentValues();\n values.put(BookEntry.COLUMN_BOOK_QUANTITY, decrementedQuantity);\n context.getContentResolver().update(quantityUri, values, null, null);\n } else {\n //Show an error when the quantity reaches 0\n Toast.makeText(context, R.string.out_of_stock_message, Toast.LENGTH_SHORT).show();\n }\n }",
"int updateByPrimaryKeySelective(ItemStockDO record);",
"public boolean saveOrUpdateStockExchange(StockExchange stockExchange);",
"@Override\n public void updateProduct(TradingQuote tradingQuote) {\n }",
"@Override\n\tpublic void update_in_DB() throws CouponSiteMsg \n\t{\n\t\t\n\t}",
"public void updateStockPrice(String ticker, double currentUnitValue) {\n\t\tStock stock = this.findStockByTicker(ticker);\n\t\tstock.setCurrentUnitValue(currentUnitValue);\n\t\tstockRepo.save(stock);\t\n\t}",
"public void Close(int bin, int amount, String serial){\n try{ \r\n c = DbConnect.getConnection();\r\n //Select and add up the rows where sale is not closed. \r\n pstmt = c.prepareStatement(\"Select SUM(sale_amount) from till_tape where sale_closed = 0\");\r\n rs = pstmt.executeQuery(); \r\n System.out.println(\"Executed select\");\r\n rs.next();\r\n int num = rs.getInt(1);//change to return of int value\r\n System.out.println(num);\r\n //Update rows where sale_closed = 0 to confirm the sale\r\n pstmt = c.prepareStatement(\"Update till_tape SET sale_closed = 1 where sale_closed = 0\");\r\n pstmt.executeUpdate();\r\n System.out.println(\"Executed update\");\r\n //Modify the values of the ticket rows, unsold, actual gross, actual prizes\r\n //use stack database\r\n\r\n }catch (Exception e) { e.printStackTrace(); }\r\n \r\n}",
"Transfer updateChargeBack(Transfer transfer, Transfer chargeback);",
"public void setStock(Integer stock) {\n this.stock = stock;\n }",
"public void Deposit(double ammount){\n abal = ammount + abal;\n UpdateDB();\n }",
"public void onStockpriceChanged();",
"public void understockCase(Connection conn, String client, int amount, String product, int stock) {\n\tString sql = \"INSERT INTO javadbconnection.understock_products(productName, current_stock, ordered_quantity) Values(\" + product + \",\" + stock + \",\" + amount + \")\";\n\ttry {\n\tPreparedStatement stmt = conn.prepareStatement(sql);\n\tstmt.executeUpdate(sql);\n\t}catch (SQLException e) {\n\tSystem.err.println(e.getMessage()); \n\t\t\t}\n\t\t}",
"@Override\n\tpublic void doUpdate(SellOfer model, HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\t if(StringUtil.isEmpty(model.getPrice())){\n\t\t\t\t model.setPrice(\"0\");\n\t\t\t }\n\t\t\t double dprice =Double.parseDouble(model.getPrice());\n\t\t BigDecimal bg = new BigDecimal(dprice/10000);\n\t\t double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();\n\t\t model.setPrice(f1+\"\");\n\t\t model.setSource(\"001\");\n\t\t model.setSellContent(\"\");\n\t\tsuper.doUpdate(model, request, response);\n\t}",
"public void updateQuote(){\n\t\tDate date = new Date();\n\t\tlong maxTimeNoUpdate = Long.parseLong(config.getQOTD_expiration_time());\n\n\t\tlong timeNow = date.getTime()/1000L;\n\t\tlong timeLastQuote = 0;\n\n\t\ttry {\n\t\t\tcrs = qb.selectFrom(\"qotd\").all().executeQuery();\n\t\t\tif(crs.next()){\n\t\t\t\ttimeLastQuote = crs.getDate(\"date\").getTime()/1000L;\n\t\t\t}\n\t\t} catch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tcrs.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif(timeNow-timeLastQuote > maxTimeNoUpdate){\n\t\t\tSystem.out.println(\"UPDATING QUOTE\");\n\t\t\tsaveQuote();\n\t\t} else {\n\t\t\tSystem.out.println(\"QUOTE IS UP TO DATE\");\n\t\t}\n\t}",
"@Override\r\n\tpublic int updateOrderStockComplete(OrdersVO orVO) {\n\t\treturn getSqlSession().update(namespace+\".updateOrderStockComplete\", orVO);\r\n\t}",
"public void setStock(String stock) {\n this.stock = stock;\n }",
"public void setStock(String stock) {\n this.stock = stock;\n }",
"public void updateTransaction(Transaction trans);",
"public void actualizarStock(Long idProducto, Long cantidad) {\n\t\t\n\t}",
"@Override\n @Transactional\n public void update(Item item) {\n Produto produto = item.getProduto();\n produtoDao.updateEstoqueProduto(produto.getQuantidade() - item.getQuantidade(), produto.getId());\n }",
"@Modifying(clearAutomatically = true)\n\t@Lock(value = LockModeType.OPTIMISTIC_FORCE_INCREMENT)\n @Query(\"UPDATE Item i SET i.quantity = i.quantity + ?1 WHERE i =?2\")\n int addToStock(double qty, Item item);",
"private void refreshStock(){\n storeStock = sysMgr.getStock(sysMgr.getLoginId());\n ArrayList<Stock> nonEmpty = new ArrayList<>();\n for(Stock i : storeStock)\n if(i.getQuantity() != 0)\n nonEmpty.add(i);\n storeStock = nonEmpty;\n }",
"private void botBuy(Stock stock, int numShares){\n player.getShares().set(game.getIndex(stock), player.getShares().get(game.getIndex(stock)) + numShares);\n player.setFunds(-numShares*(stock.getSharePrice()+3));\n System.out.println(\"purchase made\"); //rem\n }",
"public void update(Tiaoxiushenqing t) throws SQLException {\n\t\tTiaoxiushenqingDao dao = new TiaoxiushenqingDao();\n\t\tdao.update(t);\n\t}",
"public void setStock(int stock) {\n\t\tthis.stock = stock;\n\t}",
"public void stockItemPrice(String upc, int qty, int price_incent)\n\n\t\t\tthrows SQLException, ClassNotFoundException, IOException\n\n\t\t\t{\n\n\t\tif(qty < 0)\n\n\t\t\t//sanity check\n\n\t\t\tthrow new IOException(\"Quantity input cannot be less than 0.\");\n\n\t\tif(price_incent <= 0)\n\n\t\t\t//santiy check\n\n\t\t\tthrow new IOException(\"Price input must be larger than 0.\");\n\n\n\n\t\tif(this.conn == null)\n\n\t\t\tthis.conn = JDBCConnection.getConnection();\n\n\n\n\t\tPreparedStatement stmt = conn.prepareStatement(\n\n\t\t\t\t\"UPDATE Item \" +\n\n\t\t\t\t\t\t\"SET stock = stock + ?, price = ? \" +\n\n\t\t\t\t\"WHERE upc = ?\");\n\n\t\tstmt.setInt(1, qty);\n\n\t\tstmt.setDouble(2, (double)price_incent / 100.0);\n\n\t\tstmt.setString(3, upc);\n\n\t\ttry\n\n\t\t{\n\n\t\t\tint update = stmt.executeUpdate();\n\n\t\t\tif(update == 1)\n\n\t\t\t\treturn;\n\n\t\t\telse if(update == 0)\n\n\t\t\t\t//if none is update\n\n\t\t\t\tthrow new SQLException(\"The Item with upc \" + upc + \" does \" +\n\n\t\t\t\t\t\t\"not exist.\");\n\n\t\t\telse\n\n\t\t\t\t//Fatal error: more than 1 tuple is updated -> duplicate upc!!!\n\n\t\t\t\tthrow new SQLException(\"Fatal Error: Duplicate UPC!\");\n\n\t\t}\n\n\t\tfinally\n\n\t\t{\n\n\t\t\tstmt.close();\n\n\t\t}\n\n\t\t\t}",
"public static void updatePayment(){\n projectChosen = getQuestionInput();\r\n try {\r\n Connection myConn = DriverManager.getConnection(url, user, password);\r\n\r\n String sqlInsert = \"UPDATE projects SET tot_paid = ?\" +\r\n \"WHERE project_num = \" + projectChosen;\r\n\r\n PreparedStatement pstmt = myConn.prepareStatement(sqlInsert);\r\n pstmt.setDouble(1, NewProject.tot_paid);\r\n pstmt.executeUpdate(); //Execute update of database.\r\n pstmt.close();\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"@Override\r\n\tpublic StockResponseModel stockUpdated(StockRequestModel stockRequestModel) {\n\t\tStockResponseModel response = new StockResponseModel();\r\n\t\tboolean isStockID = CommonUtills.idExistOrNot(stockRequestModel);\r\n\t\tif(isStockID)\r\n\t\t{\r\n\t\t\t\tStockEntities stockEntity = new StockEntities();\r\n\t\t\t\tstockEntity = CommonUtills.mapConvert(stockRequestModel, stockEntity);\r\n\t\t\t\t\r\n\t\t\t\tstockRepository.save(stockEntity);\r\n\t\t\t\tresponse.setResponseCode(HttpStatus.ACCEPTED.toString());\r\n\t\t\t\tresponse.setResponseMsg(HttpStatus.ACCEPTED.getReasonPhrase());\r\n\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tresponse.setResponseCode(HttpStatus.NOT_FOUND.toString());\r\n\t\t\tresponse.setResponseMsg(HttpStatus.NOT_FOUND.getReasonPhrase());\r\n\t\t}\r\n\t\treturn response;\t\r\n\t\r\n\t}",
"public void doUpdate() throws InterruptedException {\n\t\t\n\t\t\n\n\t\tString stockID;\n\t\tString stockBelong;\n\t\tString mExDate;\n\t\tString mExDate2;\n\t\tStringBuffer sb;\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd hh:mm:ss\");\n\t\tString strToday = sdf.format(new Date());\n\t\tSystem.out.println(strToday);\n\n//\t\tString strRows = \"\";\n//\t\ttry {\n//\t\t\tstrRows = Integer.toString(GetNumRows(rs));\n//\t\t} catch (Exception e) {\n//\t\t\t// TODO Auto-generated catch block\n//\t\t\te.printStackTrace();\n//\t\t}\n\n\t\t\n\n\t\tint i = 1;\n\n\n\t\t\tString sql = \"Select StockID,StockBelong,ExDate FROM t_stockhis_sina where ExAmount is null \";\n\t\t\t//String sql = \"Select StockID,StockBelong,ExDate FROM t_stockhis_sina where StockID = '600570'\";\n\t\t\t//ResultSet rs = mySQL.QueryBySQL(sql);\n\t\t\tMyBatis mb = MyBatis.getInstance();\n\t\t\tList<Map> lm = mb.queryBySQL(sql);\n\t\t\tIterator<Map> itr = lm.iterator();\n\t\t\tSemaphore semp = new Semaphore(40);\n\t\t\tMap m;\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tif (i % 100 == 0) {\n\t\t\t\t\tstrToday = sdf.format(new Date());\n\t\t\t\t\tSystem.out.println(strToday + \" now:\" + Integer.toString(i) + \" of \" );\n\t\t\t\t}\n\t\t\t\tm = (Map) itr.next();\n\t\t\t\tstockID = (String) m.get(\"StockID\");\n\t\t\t\tstockBelong = (String) m.get(\"StockBelong\");\n\t\t\t\tmExDate = (String) m.get(\"ExDate\");\n\t\t\t\tmExDate2 = mExDate.substring(0, 4) + \"-\" + mExDate.substring(4, 6) + \"-\" + mExDate.substring(6, 8);\n\n\t\t\t\t// 申请许可 \n\t\t\t semp.acquire(); \n\t\t\t\tUpdateExAmountFromSinaThread thread = new UpdateExAmountFromSinaThread();\n\t\t\t\tthread.setStockID(stockID);\n\t\t\t\tthread.setStockBelong(stockBelong);\n\t\t\t\tthread.setSemp(semp);\n\t\t\t\tthread.setmExDate(mExDate);\n\t\t\t\tthread.setmExDate2(mExDate2);\n\t\t\t\tthread.start();\n\t\t\t\t\n\t\t\t\ti++;\n\t\t\t\t\n\t\t\t}\n\n\t\tstrToday = sdf.format(new Date());\n\t\tSystem.out.println(\"End:\" + strToday);\n\t\t\n\t\t//mySQL.destroy();\n\t\t\n\t}",
"private void botTrading(){\n if(game.isCardPositive(game.getHighestSharePriceStock())){\n int numShares = player.getFunds()/(game.getHighestSharePriceStock().getSharePrice()+3);\n player.getShares().set(game.getIndex(game.getHighestSharePriceStock()), player.getShares().get(game.getIndex(game.getHighestSharePriceStock())) + numShares);\n player.setFunds(-numShares*(game.getHighestSharePriceStock().getSharePrice()+3));\n }\n }",
"@Override\n public void updateItem(P_CK t) {\n \n }",
"@Override\r\n public void updatedSaleInventory(ItemAndQuantity lastItem) {\r\n }",
"int update(Purchase purchase) throws SQLException, DAOException;",
"public void stock(int number) {\r\n quantity += number;\r\n }",
"public void updateItem(int id, String desc, String family, float price, int stock) {\n ContentValues values = new ContentValues();\n values.put(\"description\", desc);\n values.put(\"family\", family);\n values.put(\"price\", price);\n\n dbW.update(\"store\", values, \"_id=?\", new String[] { String.valueOf(id) });\n }",
"stockFilePT102.StockDocument.Stock insertNewStock(int i);",
"@Override\r\n\tpublic int updateCostIoStockSoldout(CostIoVO ciVO) {\n\t\treturn getSqlSession().update(namespace+\".updateCostIoStockSoldout\", ciVO);\r\n\t}",
"@Override\n public int update(J34SiscomexOrigemDi j34SiscomexOrigemDi) {\n return super.doUpdate(j34SiscomexOrigemDi);\n }",
"private void updateTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(inputtedAmount);\n int categoryId = mCategory != null ? mCategory.getId() : 0;\n String description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n // Less: Repayment, More: Lend\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n\n boolean isDebtValid = true;\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n\n } // End DebtType() == Category.EnumDebt.LESS\n if(isDebtValid) {\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n Debt debt = mDbHelper.getDebtByTransactionId(mTransaction.getId());\n debt.setCategoryId(mCategory.getId());\n debt.setAmount(amount);\n debt.setPeople(tvPeople.getText().toString());\n\n int debtRow = mDbHelper.updateDebt(debt);\n if(debtRow == 1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } else {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) mTransaction.getId());\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } // End create new Debt\n\n } // End Update transaction OK\n } // End isDebtValid\n\n } else { // CATEGORY NORMAL\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n LogUtils.logLeaveFunction(Tag);\n }",
"public boolean actualizarStock(Pieza p, int cantidad) {\n\t\tboolean resultado = false;\n\t\ttry {\n\t\t\tXPathQueryService consulta = (XPathQueryService)\n\t\t\t\t\tcol.getService(\"XPathQueryService\", \"1.0\");\n\t\t\tconsulta.query(\"update replace /piezas/pieza[@codigo='\"+ p.getCodigo()+\n\t\t\t\t\t\"']/stock with <stock>\" + \n\t\t\t\t\t(p.getStock()-cantidad) +\"</stock>\");\n\t\t\tresultado = true;\n\t\t} catch (XMLDBException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn resultado;\n\t}",
"@Override\n\tpublic void dbUpdate(MovementModel data, String updateStm)\tthrows DAOSysException {\n//\t\tMovementModel model = data;\n//\t\tConnection connection = null;\n//\t\tPreparedStatement preparedStm = null;\n//\t\ttry\t{\n//\t\t\tconnection = connectToDB();\n//\t\t\tpreparedStm = connection.prepareStatement(updateStm);\n//\n//\t\t\t/*\tGrab values from persistent fields to store in database\t*/\n//\t\t\tpreparedStm.setString(1, model.getComposer());\n//\n// \t\t\tint rowCount = preparedStm.executeUpdate();\n//\t\t\tif (rowCount == 0)\t{\n// \t\t\t\tthrow new DAOSysException(\n// \t\t\t\t\t\"Failed to store state for Movement <\"\n// \t\t\t\t\t+ model.getCompostionName() + \">\");\n// \t\t\t}\n//\n//\t\t}\tcatch (SQLException sex)\t{\n//\t\t\tthrow new DAOSysException(\n//\t\t\t\t\t\"dbUpdate() SQL Exception <\"\n//\t\t\t\t\t+ sex.getMessage() + \">\");\n//\n//\t\t}\tfinally\t{\n//\t\t\ttry\t{\n//\t\t\t\treleaseAll(null, preparedStm, connection);\n//\t\t\t} catch (Exception ex)\t{\n//\t\t\t\tSystem.err.println(\"Error releasing resources <\" + ex.toString());\n//\t\t\t}\n//\t\t}\n\t}",
"public void updatebalforedittedsales(int i, String cooom) {\n\t\tSystem.out.println(\"in sales balance update\");\n\t\tString countQuery = \"SELECT Balance FROM \" + DATABASE_TABLE1+\" WHERE Name='\"+cooom+\"'\";\n\t \n\t \nCursor cursor = ourDatabase.rawQuery(countQuery, null);\n\t int d=cursor.getColumnIndex(\"Balance\");\n\t\tString cbal=null;\n\t\tfor(cursor.moveToFirst();!cursor.isAfterLast();cursor.moveToNext()){\n\t\t\tcbal=cursor.getString(d);\n\t\t\t\n\t\t}\n\t\tint cur=Integer.parseInt(cbal);\n\t\tcur=cur+i;\n\t ContentValues up=new ContentValues();\n\t up.put(Com_Balance, cur);\n\t\tourDatabase.update(DATABASE_TABLE1, up, Com_Name+\" = '\"+cooom+\"'\", null);\n\t\t\n\t\n\t\t\n\t}",
"public int a(double newbal, Long ano, Long reqId, Double double1, Long compId,\r\n\t\tLong noShare,Long userid)throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"update bank set balance=\"+newbal+\"where accno=\"+ano+\"\");\r\n\tint j=DbConnect.getStatement().executeUpdate(\"update requested set status='processed',remark='bought'wherereq_id=\"+reqId+\"\");\r\n\tint k=DbConnect.getStatement().executeUpdate(\"insert into transaction values(trans_seq.nextval,\"+userid+\",sysdate,\"+double1+\",'purchase','broker',\"+compId+\",\"+noShare+\"\");\r\n\tint m=DbConnect.getStatement().executeUpdate(\"update moreshare set no_share=\"+noShare+\"where comp_id=\"+compId+\"\");\r\n\t\r\n\treturn i;\r\n}",
"public void updateMoney()\n\t\t{\n\t\t\t\n\t\t\tFPlayer p1 = this.viewer;\n\t\t\tFPlayer p2 = (p1.equals(this.t.p1)) ? this.t.p2 : this.t.p1;\n\t\t\t\n\t\t\tItemStack om = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tItemMeta it = om.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p1)),\"\",\"Click to add/remove money from trade\"}));\n\t\t\tom.setItemMeta(it);\n\t\t\t\n\t\t\tif (this.canAdd()) super.contents.put(0,new ItemSwapMenu(this,om,new MenuMoney(super.viewer,this.t)));\n\t\t\telse super.contents.put(0,new ItemDummy(this,om));\n\t\t\t\n\t\t\t// Trader money in trade\n\t\t\tItemStack tm = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tit = tm.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p2))}));\n\t\t\ttm.setItemMeta(it);\n\t\t\tsuper.contents.put(8,new ItemDummy(this,tm));\n\t\t\tthis.composeInv();\n\t\t}",
"public void atualizaEstoque(int quantidade, String produto) {\r\n\r\n int idProduto = 0;\r\n int novoEstoque = 0;\r\n\r\n //Verificar qual o produto selecionado\r\n String sql = \"SELECT idProduto FROM produtos WHERE nomeProduto = ? \";\r\n\r\n try {\r\n\r\n PreparedStatement pstmt = this.conexao.prepareStatement(sql);\r\n pstmt.setString(1, produto);\r\n ResultSet rs = pstmt.executeQuery();\r\n\r\n while (rs.next()) {\r\n idProduto = rs.getInt(\"idProduto\");\r\n }\r\n\r\n } catch (Exception e) {\r\n\r\n JOptionPane.showMessageDialog(null, \"Erro ao buscar produto!\" + e.getMessage());\r\n\r\n }\r\n\r\n //Pegar o estoque desse protudo\r\n try {\r\n sql = \"SELECT quantidadeEstoque FROM estoque WHERE idEstoque = ?\";\r\n\r\n PreparedStatement pstmt2 = this.conexao.prepareStatement(sql);\r\n pstmt2.setInt(1, idProduto);\r\n ResultSet rs = pstmt2.executeQuery();\r\n\r\n while (rs.next()) {\r\n novoEstoque = (rs.getInt(\"quantidadeEstoque\") - quantidade);\r\n }\r\n\r\n pstmt2.execute();\r\n pstmt2.close();\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, \"Erro ao buscar estoque!\" + e.getMessage());\r\n }\r\n\r\n try {\r\n\r\n //Descontar a quantidade comprada do estoque\r\n sql = \"UPDATE estoque SET quantidadeEstoque = ? WHERE idEstoque = ?\";\r\n\r\n PreparedStatement pstmt3 = this.conexao.prepareStatement(sql);\r\n pstmt3.setInt(1, novoEstoque);\r\n pstmt3.setInt(2, idProduto);\r\n\r\n pstmt3.execute();\r\n\r\n pstmt3.close();\r\n\r\n } catch (Exception e) {\r\n\r\n JOptionPane.showMessageDialog(null, \"Falha ao atualizar estoque!\" + e.getMessage());\r\n\r\n }\r\n }",
"public abstract void setstockNumber();",
"public void updateQuantity(DrinkItem temp, int val) throws SQLException{\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\ttry{\n\t\t\tmyStmt = myConn.prepareStatement(\"update drink set quantity=? where drink_code=?\");\n\t\t\tmyStmt.setInt(1, val);\n\t\t\tmyStmt.setInt(2, temp.getDrinkCode());\n\t\t\tmyStmt.executeUpdate();\n\t\t}\n\t\tfinally{\n\t\t\tif(myStmt != null)\n\t\t\t\tmyStmt.close();\n\t\t}\n\t\t\n\t}",
"void update(Order order);",
"private void updateDueList() {\n boolean status = customerDue.storeSellsDetails(new CustomerDuelDatabaseModel(\n selectedCustomer.getCustomerCode(),\n printInfo.getTotalAmountTv(),\n printInfo.getPayableTv(),\n printInfo.getCurrentDueTv(),\n printInfo.getInvoiceTv(),\n date,\n printInfo.getDepositTv()\n ));\n\n if (status) Log.d(TAG, \"updateDueList: --------------successful\");\n else Log.d(TAG, \"updateDueList: --------- failed to store due details\");\n }",
"public void persistToDatabase(Stock stock, int id) throws ParseException {\n\n\n // Creating the config instance & passing the hibernate config file.\n Configuration config = new Configuration();\n config.configure(\"hibernate.cfg.xml\");\n\n // Session object to start the db transaction.\n Session s = config.buildSessionFactory().openSession();\n\n // Transaction object to begin the db transaction.\n Transaction t = s.beginTransaction();\n\n Stock_infoDAO stock_infoDAO = new Stock_infoDAO();\n stock_infoDAO.setId(id);\n stock_infoDAO.setSymbol(stock.getSymbol());\n BigDecimal price = new BigDecimal(stock.getPrice());\n stock_infoDAO.setPrice(price);\n\n String inDate= stock.getTime();\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\n Timestamp ts = new Timestamp(((java.util.Date)dateFormat.parse(inDate)).getTime());\n stock_infoDAO.setTime(ts);\n\n\n // Saving the stockinfo object to the db.\n s.persist(stock_infoDAO);\n\n // Committing the transaction in the db.\n t.commit();\n\n System.out.println(\"\\n===================\\n\");\n\n\n // Closing the session object.\n s.close();\n }",
"public void updateStatus() {\n\n //loading the driver\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n //database variables\n final String db = \"jdbc:mysql://mis-sql.uhcl.edu/dingorkarj2620\";\n Connection con = null;\n Statement st = null;\n ResultSet rs = null;\n\n try {\n //connecting database\n con = DriverManager.getConnection(db, \"dingorkarj2620\", \"1289968\");\n st = con.createStatement();\n rs = st.executeQuery(\"select * from account where a_id = \" + super.id);\n\n //updating the status\n if (rs.next()) {\n //premium seller\n if (rs.getString(3).equalsIgnoreCase(\"premium\")) {\n //update the item status\n i.setI_status(\"Valid\");\n\n } else {\n //regular seller\n if (rs.getString(3).equalsIgnoreCase(\"regular\")) {\n //checking price lower or higher than 100\n if (i.getI_price() <= 100) {\n //update status valid\n i.setI_status(\"Valid\");\n } else {\n //update status pending\n i.setI_status(\"Invalid\");\n }\n }\n }\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n try {\n con.close();\n st.close();\n rs.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n\n }",
"public void updateJobPrice(int job_ID, double total_price, double total_discount){\n try {\n Stm = conn.prepareStatement(\"UPDATE `bapers`.`Job` SET Total_discount = ?, Total_price = ? WHERE Job_ID = ?;\");\n Stm.setDouble(1, total_discount);\n Stm.setDouble(2,total_price);\n Stm.setInt(3, job_ID);\n Stm.executeUpdate();\n Stm.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"private void updatePriceAndSaving() {\n movieOrder = new MovieOrder(movie, Weekday.weekdayForValue(selectedDay), flagsApplied, numberOfTickets);\n\n tvTotalPriceNewTickets.setText(getResources().getString(\n R.string.total_price_new_tickets,\n movieOrder.getTotalPriceAfterDiscount(),\n movieOrder.getNumberOfTicketsAfterOfferIsApplied())\n );\n\n tvSavingsNewTickets.setText(getResources().getString(\n R.string.today_saving_new_tickets,\n movieOrder.getTotalSaving()\n ));\n }",
"public int sharedown(Long comp_id, Long no_share)throws Exception {\n\tint i,j = 0,k = 0;\r\n\tjava.util.Date d=new java.util.Date();\r\n\tSimpleDateFormat sd=new SimpleDateFormat(\"dd-MMM-yy\");\r\n\tString s1=sd.format(d);\r\n\ti=DbConnect.getStatement().executeUpdate(\"update share_details set no_share=no_share-\"+no_share+\" where comp_id=\"+comp_id+\" and DATEOFTRANS='\"+s1+\"'\");\r\n\trs=DbConnect.getStatement().executeQuery(\"select * from moreshare where types='bought' and DATEOFTRANS='\"+s1+\"'\");\r\n\tif(rs.next()==true)\r\n\t{\r\n\t\tk=DbConnect.getStatement().executeUpdate(\"update moreshare set no_share=no_share+\"+no_share+\" where COMP_ID=\"+comp_id+\" and types='bought' and DATEOFTRANS='\"+s1+\"'\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\tj=DbConnect.getStatement().executeUpdate(\"insert into moreshare values(\"+comp_id+\",\"+no_share+\",'bought','\"+s1+\"')\");\t\r\n\t}\r\n\t\r\n\tSystem.out.println(\"k value\"+k+\"and j value\"+j);\r\nreturn i;\r\n}",
"@Override\r\n\tpublic void updatePurchase(Purchase Purchase) throws Exception {\n\t\t\r\n\t}"
] | [
"0.720802",
"0.71188146",
"0.68693084",
"0.68623453",
"0.6860469",
"0.6785983",
"0.67055017",
"0.66330695",
"0.6615943",
"0.6562656",
"0.6562656",
"0.6526694",
"0.65137154",
"0.65016377",
"0.6447136",
"0.64348257",
"0.6428349",
"0.63832545",
"0.63795483",
"0.6339764",
"0.63291055",
"0.6283348",
"0.6271592",
"0.62598294",
"0.62579685",
"0.6242881",
"0.6215298",
"0.62086457",
"0.6203386",
"0.61946106",
"0.6168615",
"0.6158357",
"0.6154369",
"0.61534566",
"0.61412305",
"0.614059",
"0.6138304",
"0.6135816",
"0.6132259",
"0.6132259",
"0.61060333",
"0.6098613",
"0.60867983",
"0.6085978",
"0.6071601",
"0.60667896",
"0.6055283",
"0.6052942",
"0.6035573",
"0.60265183",
"0.60212404",
"0.6008432",
"0.6004597",
"0.5998967",
"0.59892374",
"0.59877175",
"0.5960149",
"0.5954369",
"0.59512013",
"0.59442735",
"0.5941127",
"0.5941127",
"0.59329873",
"0.5932828",
"0.58898765",
"0.5878917",
"0.5867339",
"0.5865963",
"0.586549",
"0.5857403",
"0.58414066",
"0.5819809",
"0.58183116",
"0.5814941",
"0.57998896",
"0.5796456",
"0.57898283",
"0.5789701",
"0.5782417",
"0.5779491",
"0.57786727",
"0.5778513",
"0.57667255",
"0.5746234",
"0.5743735",
"0.57343936",
"0.5730055",
"0.57282954",
"0.57282573",
"0.57264125",
"0.57181776",
"0.57180995",
"0.5718057",
"0.5715415",
"0.5714795",
"0.57136476",
"0.57039684",
"0.5703462",
"0.5700053",
"0.56926763"
] | 0.79589254 | 0 |
since this code is built against java 1.6 cant use a string in a switch case so have to use if else... | public static INLPProcessor initNLPProcessor(Class nlpFramework){
if(nlpFramework.getCanonicalName().equalsIgnoreCase("com.data.processors.OpenNLPProcessor")){
return new OpenNLPProcessor();
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public String visit(SwitchStmt n, Object arg) {\n return null;\n }",
"@Override\n public String visit(SwitchExpr n, Object arg) {\n return null;\n }",
"@Override\n public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException {\n if (node.jjtGetChild(0) == null) {\n //rsvc.error(\"#switch() error : null argument\");\n return false;\n }\n\n /*\n * does it have a value? If you have a null reference, then no.\n */\n Object value = node.jjtGetChild(0).value(context);\n\n if (value == null) {\n value = \"[DEFAULT]\";\n }\n\n /*\n * get the arg\n */\n String arg = value.toString();\n\n Node n = node.jjtGetChild(1);\n Node child;\n Node renderNode;\n int numChildren = n.jjtGetNumChildren();\n for (int i = 0; i < numChildren; i++) {\n child = n.jjtGetChild(i);\n if (child instanceof ASTDirective) {\n ASTDirective directive = ((ASTDirective) child);\n String dirName = ((ASTDirective) child).getDirectiveName();\n\n if (dirName.equalsIgnoreCase(\"case\")) {\n String casetoken = directive.jjtGetChild(0).literal();\n\n if (casetoken.equalsIgnoreCase(arg)) {\n // render all the children until we hit either\n // a case directive, default directive, or the end of this switch\n for (int j = i + 1; j < numChildren; j++) {\n renderNode = n.jjtGetChild(j);\n if (renderNode instanceof ASTDirective) {\n String directiveName = ((ASTDirective) renderNode).getDirectiveName();\n if (directiveName.equalsIgnoreCase(\"case\") || directiveName.equalsIgnoreCase(\"default\")) {\n break;\n }\n }\n\n renderNode.render(context, writer);\n }\n\n break;\n }\n } else if (dirName.equalsIgnoreCase(\"default\")) {\n for (int j = i + 1; j < numChildren; j++) {\n renderNode = n.jjtGetChild(j);\n renderNode.render(context, writer);\n }\n\n break;\n }\n }\n }\n\n return true;\n }",
"public String pid_011C(String str){\n\nString standar=\"Unknow\";\n switch(str.charAt(1)){\n case '1':{standar=\"OBD-II as defined by the CARB\";break;} \n case '2':{standar=\"OBD as defined by the EPA\";break;}\n case '3':{standar=\"OBD and OBD-II\";break;}\n case '4':{standar=\"OBD-I\";break;}\n case '5':{standar=\"Not meant to comply with any OBD standard\";break;}\n case '6':{standar=\"EOBD (Europe)\";break;}\n case '7':{standar=\"EOBD and OBD-II\";break;}\n case '8':{standar=\"EOBD and OBD\";break;}\n case '9':{standar=\"EOBD, OBD and OBD II\";break;}\n case 'A':{standar=\"JOBD (Japan)\";break;}\n case 'B':{standar=\"JOBD and OBD II\";break;} \n case 'C':{standar=\"JOBD and EOBD\";break;}\n case 'D':{standar=\"JOBD, EOBD, and OBD II\";break;} \n default: {break;} \n }\n \n return standar;\n}",
"public static void stringSwitch() {\n String greeting = \"Hello\";\n\n switch (greeting) {\n case \"Hello\" : System.out.println(\"Hey, how goes it?\");\n break;\n case \"Goodbye\":System.out.println(\"See ya!\");\n break;\n default: System.out.println(\"Que?\");\n }\n }",
"@Override\r\n\t\t\tpublic boolean test(String t) {\n\t\t\t\treturn t.equalsIgnoreCase(\"JAVA\");\r\n\t\t\t}",
"public T caseSwitch(Engine.Switch object) {\n\t\treturn null;\n\t}",
"public T caseExpression_String(Expression_String object)\r\n {\r\n return null;\r\n }",
"@Override\n public String visit(SwitchEntry n, Object arg) {\n return null;\n }",
"public static void main(String[] args) {\n byte age = 6;\n String p = \"\";\n switch (age) {\n case 1:\n p = \"you can crawl\";\n break;\n case 2:\n p = \"you can talk\";\n break;\n case 3:\n p = \"you can walk\";\n break;\n case 4:\n p = \"you should have some vaccines\";\n break;\n case 5:\n p = \"you can start reading\";\n break;\n default:\n p = \"go to school\";\n break;\n }\n System.out.println(p);\n }",
"public T caseExprString(ExprString object)\n {\n return null;\n }",
"public static void switchTest(Enum obj) {\n String className = obj.getClass().getSimpleName();\n //int key = obj.ordinal();\n String res=\"undefined\";\n switch (className) {\n case \"E1\":\n try {\n res=\"it's \"+className+\".\"+((E1)obj).name();\n } catch (Exception e) {\n }\n break;\n case \"E2\":\n try {\n res=\"it's \"+className+\".\"+((E2)obj).name();\n } catch (Exception e) {\n\n }\n break;\n default:\n// try {\n// res=\"It's \"+className+\".\"+((E3)obj).name();\n// } catch (Exception e) {\n//\n// }\n res=\"undefined\";\n } // sw\n System.out.println(res);\n }",
"public static void main(String[] args) {\n int number = 1154 ;\n switch (number){\n\n case 1:\n case 3:\n case 5:\n case 7:\n case 8:\n case 10:\n case 12:\n System.out.println(\"31 days in this month\");\n break;\n\n\n case 4:\n case 6:\n case 9:\n case 11:\n System.out.println(\" 30 days in this month\");\n break;\n\n case 2:\n System.out.println(\"28 days in february\");\n break;\n\n default:\n System.out.println(\"Invalid\");\n break;\n\n\n }\n\n\n System.out.println(\"------------ Pass or failed____________________\");\n\n\n char grade = 'u';\n\n switch (grade){\n case 'A':\n case 'B':\n case 'C':\n case 'D':\n System.out.println(\"Passed\");\n break;\n\n case 'F':\n System.out.println(\"Failed\");\n break;\n\n default:\n System.out.println(\"Invalid Grade\");\n }\n\n\n\n\n\n }",
"private static String getSwitchCaseMapping(String windowName2) {\n\r\n\t\tString switchcase = \"\";\r\n\t\tVector<WindowTableModelMapping> maps = getMapColumns(windowName2);\r\n\t\tfor (int i = 0; i < maps.size(); i++) {\r\n\t\t\tWindowTableModelMapping mp = maps.get(i);\r\n\t\t\tswitchcase = switchcase + \" case \" + i + \":\\n\";\r\n\t\t\tswitchcase = switchcase + \"value = \" + windowName2.toLowerCase()\r\n\t\t\t\t\t+ \".get\" + mp.getMethodName() + \"();\\n break; \\n\";\r\n\r\n\t\t}\r\n\t\treturn switchcase;\r\n\t}",
"@Test\n\tpublic void caseNameWithNull() {\n\t\tString caseName = \"null\";\n\t\ttry {\n\t\t\tStringNumberUtil.stringUtil(caseName);\n\t\t\tfail();\n\t\t} catch (StringException e) {\n\n\t\t}\n\t}",
"static int type_of_jmp(String passed){\n\t\treturn 1;\n\t}",
"public static void main(String[] args) {\n \r\n \r\n int day = 2;\r\n String dayType;\r\n String dayString;\r\n \r\n switch (day) \r\n {\r\n case 1: dayString = \"Monday\";\r\n \t\t\r\n break;\r\n case 2: dayString = \"Tuesday\";\r\n break;\r\n case 3: dayString = \"Wednesday\";\r\n break;\r\n case 4: dayString = \"Thursday\";\r\n break;\r\n case 5: dayString = \"Friday\";\r\n break;\r\n case 6: dayString = \"Saturday\";\r\n break;\r\n case 7: dayString = \"Sunday\";\r\n break;\r\n default: dayString = \"Invalid day\";\r\n }\r\n \r\n switch (day) \r\n {\r\n //multiple cases without break statements \r\n \r\n case 1: \r\n case 2:\r\n case 3:\r\n case 4:\r\n case 5:\r\n dayType = \"Weekday\";\r\n break;\r\n case 6:\r\n case 7:\r\n dayType = \"Weekend\"; \r\n break;\r\n \r\n default: dayType= \"Invalid daytype\";\r\n }\r\n \r\n System.out.println(dayString+\" is a \"+ dayType);\r\n }",
"public T caseString(sensorDeploymentLanguage.String object) {\n\t\treturn null;\n\t}",
"@Override\n public void handleString(String s) {\n\n }",
"private static void showJava(String string) { TODO Auto-generated method stub\n\t//\n\t\n}",
"private static void printSwitchCase(Node oroot, int i,String s, ArrayList<Token> list, String p) {\n\t\tString taps =\"\";\n\t\tfor(int k = 0; k<i+2; k++){\t// get how many taps at front of each line.\n\t\t\ttaps +=\"\\t\";\n\t\t}\n\t\tif(oroot.children.size() == 0){\t\t// if node does not have sub node, this means it is most inner case,return\n\t\t\tSystem.out.println(taps+\"switch(s[index + \"+ i +\"]){\");\n\t\t\tSystem.out.println(taps+\"default:return new Token(\"+\"Token.Tag.\"+getTag(s,list)+\", \\\"\"+s+\"\\\",0);\");\n\t\t\tSystem.out.println(taps+\"}\");\n\t\t\treturn;\n\t\t}\n\t\tString temp =\"\"; // remember each level's char\n\t\tString prob =p;\t// get possible match. for example, when reading <<, but the prob will still be <.\n\t\tif(oroot.children.size()!= 0){\n\t\t\tSystem.out.println(taps+\"switch(s[index + \"+ i +\"]){\");\n\t\t\tfor(int j = 0;j<oroot.children.size(); j++){\n\t\t\t\ttemp = s;\n\t\t\t\tprob = bestMatch(s,list); // find the best match possible\n\t\t\t\ts += oroot.children.get(j).current;\t\n\t\t\t\tif(prob.length() == 0){\n\t\t\t\t\tprob = p;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(taps+\"case '\"+oroot.children.get(j).current+\"':\");\n\t\t\t\tint m = j;\n\t\t\t\tint n = i;\n\t\t\t\ti++; // get deep into level\n\t\t\t\tprintSwitchCase(oroot.children.get(j), i,s, list,prob);\n\t\t\t\t\n\t\t\t\ts = temp;\t// make sure it string s be previous level s\n\t\t\t\tj = m;\n\t\t\t\ti = n;\n\t\t\t}\n\t\t\tif(i!=0){// if it is not first level\n\t\t\t\tif(prob.equals(\"\")){\t// if possible match is empty string, means null, no possible match.\n\t\t\t\t\tSystem.out.println(taps+\"default:return null;\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(taps+\"default:return new Token(\"+\"Token.Tag.\"+getTag(prob,list)+\", \\\"\"+prob+\"\\\",0);\");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(taps+\"}\");\n\t\t\t}\n\t\t}\t\n\t}",
"private static String type(String arg) {\n if ( arg.contains(\".\") )\n return \"ip\";\n try {\n Integer.parseInt(arg);\n return \"port\";\n } catch (NumberFormatException ignored) {\n return arg;\n }\n }",
"@Test\n\tpublic void caseNameWithCorrectInput() {\n\t\tString caseName = \"led case\";\n\t\tboolean isNameValid;\n\t\ttry {\n\t\t\tisNameValid = StringNumberUtil.stringUtil(caseName);\n\t\t\tassertTrue(isNameValid);\n\t\t} catch (StringException e) {\n\t\t\tfail();\n\t\t}\n\t\t\n\t}",
"public T caseSwitch(Switch object) {\n\t\treturn null;\n\t}",
"public abstract void mo70704a(String str);",
"public abstract String mo24851a(String str);",
"public static int a(String str) {\n char c2;\n switch (str.hashCode()) {\n case -1933413040:\n if (str.equals(\"commonVideo\")) {\n c2 = 2;\n break;\n }\n case -1890252483:\n if (str.equals(\"sticker\")) {\n c2 = 6;\n break;\n }\n case -35510913:\n if (str.equals(\"fastVideo\")) {\n c2 = 0;\n break;\n }\n case 3357525:\n if (str.equals(\"more\")) {\n c2 = 10;\n break;\n }\n case 103652300:\n if (str.equals(\"macro\")) {\n c2 = 9;\n break;\n }\n case 104817688:\n if (str.equals(\"night\")) {\n c2 = 7;\n break;\n }\n case 729267099:\n if (str.equals(CameraStatisticsUtil.EVENT_CAPTURE)) {\n c2 = 4;\n break;\n }\n case 764302074:\n if (str.equals(\"slowVideo\")) {\n c2 = 1;\n break;\n }\n case 875077159:\n if (str.equals(\"professional\")) {\n c2 = 5;\n break;\n }\n case 1069983349:\n if (str.equals(\"panorama\")) {\n c2 = 3;\n break;\n }\n case 1401705245:\n if (str.equals(\"highPictureSize\")) {\n c2 = 8;\n break;\n }\n default:\n c2 = 65535;\n break;\n }\n switch (c2) {\n case 0:\n return R.string.camera_mode_fast_video;\n case 1:\n return R.string.camera_mode_slow_video;\n case 2:\n return R.string.camera_mode_video;\n case 3:\n return R.string.camera_mode_panorama;\n case 4:\n return R.string.camera_mode_portrait;\n case 5:\n return R.string.camera_mode_professional;\n case 6:\n return R.string.camera_mode_sticker;\n case 7:\n return R.string.camera_mode_night;\n case 8:\n return d();\n case 9:\n return R.string.camera_mode_super_macro;\n case 10:\n return R.string.camera_mode_more;\n default:\n return R.string.camera_mode_common;\n }\n }",
"private int e(String paramString, int paramInt)\r\n/* 628: */ {\r\n/* 629:624 */ int i1 = paramString.length();\r\n/* 630:625 */ int i2 = 0;\r\n/* 631:626 */ int i3 = 0;\r\n/* 632:627 */ int i4 = -1;\r\n/* 633:628 */ int i5 = 0;\r\n/* 634:631 */ for (; i3 < i1; i3++)\r\n/* 635: */ {\r\n/* 636:632 */ char c1 = paramString.charAt(i3);\r\n/* 637:634 */ switch (c1)\r\n/* 638: */ {\r\n/* 639: */ case '§': \r\n/* 640:636 */ if (i3 < i1 - 1)\r\n/* 641: */ {\r\n/* 642:637 */ char c2 = paramString.charAt(++i3);\r\n/* 643:638 */ if ((c2 == 'l') || (c2 == 'L')) {\r\n/* 644:639 */ i5 = 1;\r\n/* 645:640 */ } else if ((c2 == 'r') || (c2 == 'R') || (c(c2))) {\r\n/* 646:641 */ i5 = 0;\r\n/* 647: */ }\r\n/* 648: */ }\r\n/* 649:643 */ break;\r\n/* 650: */ case '\\n': \r\n/* 651:646 */ i3--;\r\n/* 652:647 */ break;\r\n/* 653: */ case ' ': \r\n/* 654:649 */ i4 = i3;\r\n/* 655: */ default: \r\n/* 656:651 */ i2 += a(c1);\r\n/* 657:652 */ if (i5 != 0) {\r\n/* 658:653 */ i2++;\r\n/* 659: */ }\r\n/* 660: */ break;\r\n/* 661: */ }\r\n/* 662:657 */ if (c1 == '\\n')\r\n/* 663: */ {\r\n/* 664:658 */ i3++;i4 = i3;\r\n/* 665: */ }\r\n/* 666: */ else\r\n/* 667: */ {\r\n/* 668:662 */ if (i2 > paramInt) {\r\n/* 669: */ break;\r\n/* 670: */ }\r\n/* 671: */ }\r\n/* 672: */ }\r\n/* 673:667 */ if ((i3 != i1) && (i4 != -1) && (i4 < i3)) {\r\n/* 674:668 */ return i4;\r\n/* 675: */ }\r\n/* 676:670 */ return i3;\r\n/* 677: */ }",
"private String recognizeType(String code) {\n String subCode = StringUtils.substring(code, 0, 2);\n String type;\n switch (subCode) {\n case \"00\":\n type = \"sz\"; // A\n break;\n case \"20\":\n type = \"sz\"; // B\n break;\n case \"30\":\n type = \"sz\"; // Entrepreneurship 创业板\n break;\n case \"60\":\n type = \"sh\"; // A\n break;\n case \"90\":\n type = \"sh\"; // B\n break;\n default:\n type = \"sz\";\n }\n return type;\n }",
"public void generateRouteNameString(){\n switch(routeName){\n case \"1A\": this.routeNameString = \"College Edinburgh\"; break;\n case \"1B\": this.routeNameString = \"College Edinburgh\"; break;\n case \"2A\": this.routeNameString = \"West Loop\"; break;\n case \"2B\": this.routeNameString = \"West Loop\"; break;\n case \"3A\": this.routeNameString = \"East Loop\"; break;\n case \"3B\": this.routeNameString = \"East Loop\"; break;\n case \"4\": this.routeNameString = \"York\"; break;\n case \"5\": this.routeNameString = \"Gordon\"; break;\n case \"6\": this.routeNameString = \"Harvard Ironwood\"; break;\n case \"7\": this.routeNameString = \"Kortright Downey\"; break;\n case \"8\": this.routeNameString = \"Stone Road Mall\"; break;\n case \"9\": this.routeNameString = \"Waterloo\"; break;\n case \"10\": this.routeNameString = \"Imperial\"; break;\n case \"11\": this.routeNameString = \"Willow West\"; break;\n case \"12\": this.routeNameString = \"General Hospital\"; break;\n case \"13\": this.routeNameString = \"Victoria Rd Rec Centre\"; break;\n case \"14\": this.routeNameString = \"Grange\"; break;\n case \"15\": this.routeNameString = \"University College\"; break;\n case \"16\": this.routeNameString = \"Southgate\"; break;\n case \"20\": this.routeNameString = \"NorthWest Industrial\"; break;\n case \"50\": this.routeNameString = \"Stone Road Express\"; break;\n case \"56\": this.routeNameString = \"Victoria Express\"; break;\n case \"57\": this.routeNameString = \"Harvard Express\"; break;\n case \"58\": this.routeNameString = \"Edinburgh Express\"; break;\n default: this.routeNameString = \"Unknown Route\"; break;\n }\n }",
"abstract String mo1747a(String str);",
"private PatternType matchPatternEnum(String s){\n s = s.toLowerCase();\n switch(s){\n case \"factory method\":\n return PatternType.FACTORY_METHOD;\n case \"prototype\":\n return PatternType.PROTOTYPE;\n case \"singleton\":\n return PatternType.SINGLETON;\n case \"(object)adapter\":\n return PatternType.OBJECT_ADAPTER;\n case \"command\":\n return PatternType.COMMAND;\n case \"composite\":\n return PatternType.COMPOSITE;\n case \"decorator\":\n return PatternType.DECORATOR;\n case \"observer\":\n return PatternType.OBSERVER;\n case \"state\":\n return PatternType.STATE;\n case \"strategy\":\n return PatternType.STRATEGY;\n case \"bridge\":\n return PatternType.BRIDGE;\n case \"template method\":\n return PatternType.TEMPLATE_METHOD;\n case \"visitor\":\n return PatternType.VISITOR;\n case \"proxy\":\n return PatternType.PROXY;\n case \"proxy2\":\n return PatternType.PROXY2;\n case \"chain of responsibility\":\n return PatternType.CHAIN_OF_RESPONSIBILITY;\n default:\n System.out.println(\"Was not able to match pattern with an enum. Exiting because this should not happen\");\n System.exit(0);\n\n }\n //should never get here because we exit on the default case\n return null;\n }",
"public static void main(String[] args) {\n\t\n\t\tint day=6 ;\n\t\t\n\t\t\t\tString weekDay;\n\t\t\n\t\t\t\tif ( day==1) {\n\t\t\t\t\tweekDay=\"Monday\";\n\t\t\t\t}else if(day==2) {\n\t\t\t\t\tweekDay=\"Tuesday\";\n\t\t\t\t}else if(day==3) {\n\t\t\t\t\tweekDay=\"Wednesday\";\n\t\t\t\t}else if(day==4) {\n\t\t\t\t\tweekDay=\"Thursday\";\n\t\t\t\t}else if(day==5) {\n\t\t\t\t\tweekDay=\"Friday\";\n\t\t\t\t}else if(day==6) {\n\t\t\t\t\tweekDay=\"Saturday\";\n\t\t\t\t}else if(day==7) {\n\t\t\t\t\tweekDay=\"Sunday\";\n\t\t\t\t}else {\n\t\t\t\t\t\tweekDay=\"invaid\";\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tSystem.out.println(\"weekDay\");\n\t\t\t\t\t}\n\t\t\t\t// switch statement execute one statment from mutiple \n\t\t\t\t//condition a switch works\n\t\t\t\t//with byte, short,char, and string \n\t\t\n\t\t\t\tswitch(day){\n\t\t\t\tcase 1://day==1\n\t\t\t\t\tweekDay=\"Monday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tweekDay=\"Tuesday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tweekDay=\"Wedensday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tweekDay=\"Thursday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tweekDay=\"Friday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tweekDay=\"Saturday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7: \n\t\t\t\t\tweekDay=\"Sunday\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tweekDay=\"invlid\";\n\t\t\t\t\t\n\t\t\tSystem\n\t\t\t.out.println(weekDay);\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t}\n\n}",
"static int type_of_sui(String passed){\n\t\treturn 1;\n\t}",
"static int type_of_cpi(String passed){\n\t\treturn 1;\n\t}",
"private static String valueOf(Object str3Sg) {\n\t\treturn null;\r\n\t}",
"default T handleString(String val) {\n throw new UnsupportedOperationException();\n }",
"char caseconverter(int k,int k1)\n{\nif(k>=65 && k<=90)\n{\nk1=k1+32;\n}\nelse\nif(k>=97 && k<=122)\n{\nk1=k1-32;\n}\nreturn((char)k1);\n}",
"public void testingSwitchWithStringStatemant() {\r\n\t\tSystem.err\r\n\t\t\t\t.println(\"Class NewFeatures, method testingSwitchWithStringStatement called!\");\r\n\t\tArrayList<String> randomStrings = new ArrayList<>();\r\n\t\trandomStrings.add(\"hey\");\r\n\t\trandomStrings.add(\"hello\");\r\n\t\trandomStrings.add(\"labas\");\r\n\t\t// generating random number and using Random class\r\n\t\tRandom generator = new Random();\r\n\t\tswitch (randomStrings.get(generator.nextInt(3))) {\r\n\t\tcase \"hey\":\r\n\t\t\tSystem.out.println(\"String \"\r\n\t\t\t\t\t+ randomStrings.get(generator.nextInt(3)) + \" called!\");\r\n\t\t\tbreak;\r\n\t\tcase \"hello\":\r\n\t\t\tSystem.out.println(\"String \"\r\n\t\t\t\t\t+ randomStrings.get(generator.nextInt(3)) + \" called!\");\r\n\t\t\tbreak;\r\n\t\tcase \"labas\":\r\n\t\t\tSystem.out.println(\"String \"\r\n\t\t\t\t\t+ randomStrings.get(generator.nextInt(3)) + \" called!\");\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"Nothing has been called!\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tSystem.out\r\n\t\t\t\t.println(\"Class NewFeatures, method testingSwitchWithStringStatement done!\");\r\n\t}",
"static int type_of_sphl(String passed){\n\t\treturn 1;\n\t}",
"public static void main(String[] args) {\n String color=\"blue\";\n String shirt=\"shirt\";\n switch(color)\n {\n case \"blue\": shirt=\"blue\"+shirt;\n break;\n case \"red\": shirt=\"red\"+shirt;\n break;\n default : shirt =\"white\"+shirt; \n }\n System.out.println(\"shirt type:\"+shirt);\n\t}",
"static int type_of_sta(String passed){\n\t\treturn 1;\n\t}",
"public static void main(String[] args) {\n\t\tlong x = 100L;\r\n\t\tswitch ((int) x) {\r\n//\t\tcase value:\r\n//\r\n//\t\t\tbreak;\r\n//\r\n//\t\tdefault:\r\n//\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tString username = \"zhangsan\";\r\n\t\tswitch (username) {\r\n//\t\tcase value:\r\n//\t\t\t\r\n//\t\t\tbreak;\r\n//\r\n//\t\tdefault:\r\n//\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\tSystem.out.println(\"请输入数字:\");\r\n\t\tint num = scanner.nextInt();\r\n\t\tswitch (num) {\r\n\t\tcase 1:\r\n\t\t\tSystem.out.println(\"星期一\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase 2:\r\n\t\t\tSystem.out.println(\"星期二\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase 3:\r\n\t\t\tSystem.out.println(\"星期三\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase 4:\r\n\t\t\tSystem.out.println(\"星期四\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase 5:\r\n\t\t\tSystem.out.println(\"星期五\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"对不起你输入的数字非法!!!\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"---------------------------------------\");\r\n\r\n\t\t// case穿透\r\n\t\tswitch (num) {\r\n\t\tcase 1:\r\n\t\t\tSystem.out.println(\"星期一\");\r\n\r\n\r\n\r\n\t\tcase 2:\r\n\t\t\tSystem.out.println(\"星期二\");\r\n\r\n\r\n\r\n\t\tcase 3:\r\n\t\t\tSystem.out.println(\"星期三\");\r\n\r\n\r\n\r\n\t\tcase 4:\r\n\t\t\tSystem.out.println(\"星期四\");\r\n\r\n\r\n\r\n\t\tcase 5:\r\n\t\t\tSystem.out.println(\"星期五\");\r\n\r\n\r\n\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"对不起你输入的数字非法!!!\");\r\n\r\n\t\t}\r\n\r\n\t\t// case合并\r\n\t\tswitch (num) {\r\n\t\tcase 1:\r\n\t\tcase 0:\r\n\t\t\tSystem.out.println(\"星期一\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase 2:\r\n\t\t\tSystem.out.println(\"星期二\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase 3:\r\n\t\t\tSystem.out.println(\"星期三\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase 4:\r\n\t\t\tSystem.out.println(\"星期四\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase 5:\r\n\t\t\tSystem.out.println(\"星期五\");\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"对不起你输入的数字非法!!!\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}",
"static int type_of_jp(String passed){\n\t\treturn 1;\n\t}",
"public abstract void setSwitchType(String switchType);",
"@Override\r\n\t\t\tpublic boolean test(String t, String u) {\n\t\t\t\t return t.equalsIgnoreCase(u);\r\n\t\t\t}",
"static int type_of_pchl(String passed){\n\t\treturn 1;\n\t}",
"public abstract void mo4373a(String str);",
"public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter your language:\");\n String language = scanner.nextLine();\n\n switch (language){\n case \"Sinhala\":\n System.out.println(\"Language is changed to Sinhala..\");\n break;\n case \"English\":\n System.out.println(\"Language is changed to English..\");\n break;\n case \"Tamil\":\n System.out.println(\"Language is changed to Tamil..\");\n break;\n default:\n System.out.println(\"Something went wrong!! Try again..\");\n break;\n }\n\n }",
"static int type_of_cp(String passed){\n\t\treturn 1;\n\t}",
"static int type_of_jpe(String passed){\n\t\treturn 1;\n\t}",
"void mo5871a(String str);",
"switch(curState) {\r\n${stateoutputcases}\r\n default:\r\n break; //no action taken\r\n }",
"@Override\n protected T doSwitch(int classifierID, EObject theEObject)\n {\n switch (classifierID)\n {\n case LenguajegraficoPackage.LENGUAJEGRAFICO:\n {\n Lenguajegrafico lenguajegrafico = (Lenguajegrafico)theEObject;\n T result = caseLenguajegrafico(lenguajegrafico);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.ELEMENT:\n {\n Element element = (Element)theEObject;\n T result = caseElement(element);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.DATATYPE:\n {\n Datatype datatype = (Datatype)theEObject;\n T result = caseDatatype(datatype);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.CHART:\n {\n Chart chart = (Chart)theEObject;\n T result = caseChart(chart);\n if (result == null) result = caseElement(chart);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.TUPLE:\n {\n Tuple tuple = (Tuple)theEObject;\n T result = caseTuple(tuple);\n if (result == null) result = caseElement(tuple);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.TEXT:\n {\n Text text = (Text)theEObject;\n T result = caseText(text);\n if (result == null) result = caseDatatype(text);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.NUMBER:\n {\n org.uis.lenguajegrafico.lenguajegrafico.Number number = (org.uis.lenguajegrafico.lenguajegrafico.Number)theEObject;\n T result = caseNumber(number);\n if (result == null) result = caseDatatype(number);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.FLOAT:\n {\n org.uis.lenguajegrafico.lenguajegrafico.Float float_ = (org.uis.lenguajegrafico.lenguajegrafico.Float)theEObject;\n T result = caseFloat(float_);\n if (result == null) result = caseDatatype(float_);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.URL:\n {\n URL url = (URL)theEObject;\n T result = caseURL(url);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.TITLE:\n {\n Title title = (Title)theEObject;\n T result = caseTitle(title);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.LABELX:\n {\n Labelx labelx = (Labelx)theEObject;\n T result = caseLabelx(labelx);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.LABELY:\n {\n Labely labely = (Labely)theEObject;\n T result = caseLabely(labely);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.LEGEND:\n {\n Legend legend = (Legend)theEObject;\n T result = caseLegend(legend);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.HOLE:\n {\n Hole hole = (Hole)theEObject;\n T result = caseHole(hole);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.ORIENTATION:\n {\n Orientation orientation = (Orientation)theEObject;\n T result = caseOrientation(orientation);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.AREA:\n {\n Area area = (Area)theEObject;\n T result = caseArea(area);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.ZOOM_LEVEL:\n {\n ZoomLevel zoomLevel = (ZoomLevel)theEObject;\n T result = caseZoomLevel(zoomLevel);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.MAKER_TYPE:\n {\n MakerType makerType = (MakerType)theEObject;\n T result = caseMakerType(makerType);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.MAP_TYPE:\n {\n MapType mapType = (MapType)theEObject;\n T result = caseMapType(mapType);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.CELL_SIZE:\n {\n CellSize cellSize = (CellSize)theEObject;\n T result = caseCellSize(cellSize);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.PIE_CHART:\n {\n PieChart pieChart = (PieChart)theEObject;\n T result = casePieChart(pieChart);\n if (result == null) result = caseChart(pieChart);\n if (result == null) result = caseElement(pieChart);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.BAR_CHART:\n {\n BarChart barChart = (BarChart)theEObject;\n T result = caseBarChart(barChart);\n if (result == null) result = caseChart(barChart);\n if (result == null) result = caseElement(barChart);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.LINE_CHART:\n {\n LineChart lineChart = (LineChart)theEObject;\n T result = caseLineChart(lineChart);\n if (result == null) result = caseChart(lineChart);\n if (result == null) result = caseElement(lineChart);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.MAP_CHART:\n {\n MapChart mapChart = (MapChart)theEObject;\n T result = caseMapChart(mapChart);\n if (result == null) result = caseChart(mapChart);\n if (result == null) result = caseElement(mapChart);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.TABLE_CHART:\n {\n TableChart tableChart = (TableChart)theEObject;\n T result = caseTableChart(tableChart);\n if (result == null) result = caseChart(tableChart);\n if (result == null) result = caseElement(tableChart);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.DASH_BOARD:\n {\n DashBoard dashBoard = (DashBoard)theEObject;\n T result = caseDashBoard(dashBoard);\n if (result == null) result = caseElement(dashBoard);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.TUPLE1:\n {\n Tuple1 tuple1 = (Tuple1)theEObject;\n T result = caseTuple1(tuple1);\n if (result == null) result = caseTuple(tuple1);\n if (result == null) result = caseElement(tuple1);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.TUPLE2:\n {\n Tuple2 tuple2 = (Tuple2)theEObject;\n T result = caseTuple2(tuple2);\n if (result == null) result = caseTuple(tuple2);\n if (result == null) result = caseElement(tuple2);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.TUPLE3:\n {\n Tuple3 tuple3 = (Tuple3)theEObject;\n T result = caseTuple3(tuple3);\n if (result == null) result = caseTuple(tuple3);\n if (result == null) result = caseElement(tuple3);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.TUPLE4:\n {\n Tuple4 tuple4 = (Tuple4)theEObject;\n T result = caseTuple4(tuple4);\n if (result == null) result = caseTuple(tuple4);\n if (result == null) result = caseElement(tuple4);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.CONFIGURATION:\n {\n Configuration configuration = (Configuration)theEObject;\n T result = caseConfiguration(configuration);\n if (result == null) result = caseElement(configuration);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.CODE_GENERATED_TARGET:\n {\n CodeGeneratedTarget codeGeneratedTarget = (CodeGeneratedTarget)theEObject;\n T result = caseCodeGeneratedTarget(codeGeneratedTarget);\n if (result == null) result = caseConfiguration(codeGeneratedTarget);\n if (result == null) result = caseElement(codeGeneratedTarget);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LenguajegraficoPackage.NORMALICE_DATA:\n {\n NormaliceData normaliceData = (NormaliceData)theEObject;\n T result = caseNormaliceData(normaliceData);\n if (result == null) result = caseConfiguration(normaliceData);\n if (result == null) result = caseElement(normaliceData);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n default: return defaultCase(theEObject);\n }\n }",
"public Constant resolveCase(BlockScope scope, TypeBinding testType, SwitchStatement switchStatement) {\n resolve(scope);\n return null;\n }",
"public T caseStringLiteral(StringLiteral object)\n {\n return null;\n }",
"public T caseStringLiteral(StringLiteral object)\n {\n return null;\n }",
"void mo9697a(String str);",
"public abstract boolean mo70724g(String str);",
"static int type_of_aci(String passed){\n\t\treturn 1;\n\t}",
"@Override\n protected T doSwitch(int classifierID, EObject theEObject)\n {\n switch (classifierID)\n {\n case LosMelosPackage.PROGRAM:\n {\n Program program = (Program)theEObject;\n T result = caseProgram(program);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.DEFINICIONES:\n {\n Definiciones definiciones = (Definiciones)theEObject;\n T result = caseDefiniciones(definiciones);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.FUNCIONES:\n {\n Funciones funciones = (Funciones)theEObject;\n T result = caseFunciones(funciones);\n if (result == null) result = caseDefiniciones(funciones);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.VARIABLES:\n {\n Variables variables = (Variables)theEObject;\n T result = caseVariables(variables);\n if (result == null) result = caseDefiniciones(variables);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPRESION:\n {\n Expresion expresion = (Expresion)theEObject;\n T result = caseExpresion(expresion);\n if (result == null) result = caseExprThen(expresion);\n if (result == null) result = caseExprElse(expresion);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.LLAMADA_PARAMETRO:\n {\n LlamadaParametro llamadaParametro = (LlamadaParametro)theEObject;\n T result = caseLlamadaParametro(llamadaParametro);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPRESION_VAR:\n {\n ExpresionVar expresionVar = (ExpresionVar)theEObject;\n T result = caseExpresionVar(expresionVar);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.BASICA:\n {\n Basica basica = (Basica)theEObject;\n T result = caseBasica(basica);\n if (result == null) result = caseExpresion(basica);\n if (result == null) result = caseExprThen(basica);\n if (result == null) result = caseExprElse(basica);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_STRING:\n {\n ExprString exprString = (ExprString)theEObject;\n T result = caseExprString(exprString);\n if (result == null) result = caseExpresionVar(exprString);\n if (result == null) result = caseBasica(exprString);\n if (result == null) result = caseElementList(exprString);\n if (result == null) result = caseExpresion(exprString);\n if (result == null) result = caseExprThen(exprString);\n if (result == null) result = caseExprElse(exprString);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_NUMBER:\n {\n ExprNumber exprNumber = (ExprNumber)theEObject;\n T result = caseExprNumber(exprNumber);\n if (result == null) result = caseBasica(exprNumber);\n if (result == null) result = caseExpresion(exprNumber);\n if (result == null) result = caseExprThen(exprNumber);\n if (result == null) result = caseExprElse(exprNumber);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_INT:\n {\n ExprInt exprInt = (ExprInt)theEObject;\n T result = caseExprInt(exprInt);\n if (result == null) result = caseExpresionVar(exprInt);\n if (result == null) result = caseExprNumber(exprInt);\n if (result == null) result = caseElementList(exprInt);\n if (result == null) result = caseBasica(exprInt);\n if (result == null) result = caseExpresion(exprInt);\n if (result == null) result = caseExprThen(exprInt);\n if (result == null) result = caseExprElse(exprInt);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_ARITHMETIC:\n {\n ExprArithmetic exprArithmetic = (ExprArithmetic)theEObject;\n T result = caseExprArithmetic(exprArithmetic);\n if (result == null) result = caseExprNumber(exprArithmetic);\n if (result == null) result = caseEjecuciones(exprArithmetic);\n if (result == null) result = caseBasica(exprArithmetic);\n if (result == null) result = caseExpresion(exprArithmetic);\n if (result == null) result = caseExprThen(exprArithmetic);\n if (result == null) result = caseExprElse(exprArithmetic);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_PARAM:\n {\n ExprParam exprParam = (ExprParam)theEObject;\n T result = caseExprParam(exprParam);\n if (result == null) result = caseBasica(exprParam);\n if (result == null) result = caseExpresion(exprParam);\n if (result == null) result = caseExprThen(exprParam);\n if (result == null) result = caseExprElse(exprParam);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.LLAMADA_FUNCION:\n {\n LlamadaFuncion llamadaFuncion = (LlamadaFuncion)theEObject;\n T result = caseLlamadaFuncion(llamadaFuncion);\n if (result == null) result = caseExpresion(llamadaFuncion);\n if (result == null) result = caseEjecuciones(llamadaFuncion);\n if (result == null) result = caseExprThen(llamadaFuncion);\n if (result == null) result = caseExprElse(llamadaFuncion);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_BOOL:\n {\n ExprBool exprBool = (ExprBool)theEObject;\n T result = caseExprBool(exprBool);\n if (result == null) result = caseExpresion(exprBool);\n if (result == null) result = caseExpresionVar(exprBool);\n if (result == null) result = caseElementList(exprBool);\n if (result == null) result = caseEjecuciones(exprBool);\n if (result == null) result = caseExprThen(exprBool);\n if (result == null) result = caseExprElse(exprBool);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.VAL_BOOL:\n {\n ValBool valBool = (ValBool)theEObject;\n T result = caseValBool(valBool);\n if (result == null) result = caseExprBool(valBool);\n if (result == null) result = caseExpresion(valBool);\n if (result == null) result = caseExpresionVar(valBool);\n if (result == null) result = caseElementList(valBool);\n if (result == null) result = caseEjecuciones(valBool);\n if (result == null) result = caseExprThen(valBool);\n if (result == null) result = caseExprElse(valBool);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.COMP_BOOL:\n {\n CompBool compBool = (CompBool)theEObject;\n T result = caseCompBool(compBool);\n if (result == null) result = caseExprBool(compBool);\n if (result == null) result = caseExpresion(compBool);\n if (result == null) result = caseExpresionVar(compBool);\n if (result == null) result = caseElementList(compBool);\n if (result == null) result = caseEjecuciones(compBool);\n if (result == null) result = caseExprThen(compBool);\n if (result == null) result = caseExprElse(compBool);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.OP_BOOL:\n {\n OpBool opBool = (OpBool)theEObject;\n T result = caseOpBool(opBool);\n if (result == null) result = caseExprBool(opBool);\n if (result == null) result = caseExpresion(opBool);\n if (result == null) result = caseExpresionVar(opBool);\n if (result == null) result = caseElementList(opBool);\n if (result == null) result = caseEjecuciones(opBool);\n if (result == null) result = caseExprThen(opBool);\n if (result == null) result = caseExprElse(opBool);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_IF:\n {\n ExprIf exprIf = (ExprIf)theEObject;\n T result = caseExprIf(exprIf);\n if (result == null) result = caseExpresion(exprIf);\n if (result == null) result = caseEjecuciones(exprIf);\n if (result == null) result = caseExprThen(exprIf);\n if (result == null) result = caseExprElse(exprIf);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_THEN:\n {\n ExprThen exprThen = (ExprThen)theEObject;\n T result = caseExprThen(exprThen);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_ELSE:\n {\n ExprElse exprElse = (ExprElse)theEObject;\n T result = caseExprElse(exprElse);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_LIST:\n {\n ExprList exprList = (ExprList)theEObject;\n T result = caseExprList(exprList);\n if (result == null) result = caseExpresionVar(exprList);\n if (result == null) result = caseEjecuciones(exprList);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_LIST2:\n {\n ExprList2 exprList2 = (ExprList2)theEObject;\n T result = caseExprList2(exprList2);\n if (result == null) result = caseExpresion(exprList2);\n if (result == null) result = caseExprThen(exprList2);\n if (result == null) result = caseExprElse(exprList2);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.ELEMENT_LIST:\n {\n ElementList elementList = (ElementList)theEObject;\n T result = caseElementList(elementList);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.FUNC_LIST:\n {\n FuncList funcList = (FuncList)theEObject;\n T result = caseFuncList(funcList);\n if (result == null) result = caseExpresion(funcList);\n if (result == null) result = caseEjecuciones(funcList);\n if (result == null) result = caseExprThen(funcList);\n if (result == null) result = caseExprElse(funcList);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_CAR:\n {\n ExprCar exprCar = (ExprCar)theEObject;\n T result = caseExprCar(exprCar);\n if (result == null) result = caseFuncList(exprCar);\n if (result == null) result = caseExpresion(exprCar);\n if (result == null) result = caseEjecuciones(exprCar);\n if (result == null) result = caseExprThen(exprCar);\n if (result == null) result = caseExprElse(exprCar);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_CDR:\n {\n ExprCdr exprCdr = (ExprCdr)theEObject;\n T result = caseExprCdr(exprCdr);\n if (result == null) result = caseFuncList(exprCdr);\n if (result == null) result = caseExpresion(exprCdr);\n if (result == null) result = caseEjecuciones(exprCdr);\n if (result == null) result = caseExprThen(exprCdr);\n if (result == null) result = caseExprElse(exprCdr);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_CONS:\n {\n ExprCons exprCons = (ExprCons)theEObject;\n T result = caseExprCons(exprCons);\n if (result == null) result = caseFuncList(exprCons);\n if (result == null) result = caseExpresion(exprCons);\n if (result == null) result = caseEjecuciones(exprCons);\n if (result == null) result = caseExprThen(exprCons);\n if (result == null) result = caseExprElse(exprCons);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_IS_EMPTY:\n {\n ExprIsEmpty exprIsEmpty = (ExprIsEmpty)theEObject;\n T result = caseExprIsEmpty(exprIsEmpty);\n if (result == null) result = caseFuncList(exprIsEmpty);\n if (result == null) result = caseExpresion(exprIsEmpty);\n if (result == null) result = caseEjecuciones(exprIsEmpty);\n if (result == null) result = caseExprThen(exprIsEmpty);\n if (result == null) result = caseExprElse(exprIsEmpty);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_LENGTH:\n {\n ExprLength exprLength = (ExprLength)theEObject;\n T result = caseExprLength(exprLength);\n if (result == null) result = caseFuncList(exprLength);\n if (result == null) result = caseExpresion(exprLength);\n if (result == null) result = caseEjecuciones(exprLength);\n if (result == null) result = caseExprThen(exprLength);\n if (result == null) result = caseExprElse(exprLength);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EXPR_PRINT:\n {\n ExprPrint exprPrint = (ExprPrint)theEObject;\n T result = caseExprPrint(exprPrint);\n if (result == null) result = caseBasica(exprPrint);\n if (result == null) result = caseExpresion(exprPrint);\n if (result == null) result = caseExprThen(exprPrint);\n if (result == null) result = caseExprElse(exprPrint);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n case LosMelosPackage.EJECUCIONES:\n {\n Ejecuciones ejecuciones = (Ejecuciones)theEObject;\n T result = caseEjecuciones(ejecuciones);\n if (result == null) result = defaultCase(theEObject);\n return result;\n }\n default: return defaultCase(theEObject);\n }\n }",
"static int type_of_cz(String passed){\n\t\treturn 1;\n\t}",
"public static void main(String[] args){\n final int a = 1;\n // final int b;\n // b = 2;\n int x = 5;\n switch(x){\n case a: System.out.println(\"case a\");\n // case b://constant expression required .. compile error\n case 3: // is a compile time constant.\n System.out.println(\"case 3\");\n System.out.println(\"2nd line in case 3\");\n // To be a variable that is a compile time constant, the variable needs to be...\n // 1.declared as final\n // 2.have a primative or String type\n // 3.initialized (on the same line as the declaration)\n // 4.assigned to a compile time constant expression\n default: System.out.println(\"default, if no break will continue\");\n case 4:{System.out.println(\"case 4\");};//can omit {} and ;\n }\n// String derp = \"s\";\n// switch(derp){\n// \n// }\n }",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic String getCodeByStr(String tab, String strvalue) {\n\t\tif (allcode.isEmpty()) {\r\n\t\t\tinit();\r\n\t\t}\r\n\r\n\t\tList list = (List) allcode.get(tab.toUpperCase());\r\n\t\tString result = \"\";\r\n\t\tCode code = new Code();\r\n\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\tcode = (Code) list.get(i);\r\n\t\t\tString mc = code.getDescription();\r\n\t\t\tif (mc.equals(strvalue)) {\r\n\t\t\t\tresult = code.getCode();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public static void main(String[] args) {\n if (1 > 0) {\n System.out.println(\"1 > 0\");\n }\n \n \n if (5 < 4) {\n System.out.println(\"5 < 4\");\n } else {\n System.out.println(\"5 > 4\");\n }\n \n if (1 > 10) {\n System.out.println(\"1 > 10\");\n } else if (5 > 10) {\n System.out.println(\"5 > 10\");\n } else if (9 > 10) {\n System.out.println(\"9 > 10\");\n } else if (11 > 10){\n System.out.println(\"11 > 10\");\n } else {\n System.out.println(\"< 10\");\n }\n \n /*\n * keywordul break - opreste executia in acel bloc\n * in cazul structurii switch: daca gasim un rezultat valid vom opri excecutia\n */\n \n \n //Controlul executiei prin switch\n char rezultat;\n char valoareEvaluata = 'F';\n switch (valoareEvaluata) {\n case 'A':\n rezultat = 'A';\n break;\n case 'B':\n rezultat = 'B';\n break;\n case 'C':\n rezultat = 'C';\n break;\n default:\n rezultat = valoareEvaluata;\n }\n System.out.println(\"Am gasit: \" + rezultat);\n \n }",
"static int type_of_ani(String passed){\n\t\treturn 1;\n\t}",
"@Override\n\tprotected T1 doSwitch(int classifierID, EObject theEObject) {\n\t\tswitch (classifierID) {\n\t\t\tcase CommonPackage.NAME_PROVIDER: {\n\t\t\t\tNameProvider nameProvider = (NameProvider)theEObject;\n\t\t\t\tT1 result = caseNameProvider(nameProvider);\n\t\t\t\tif (result == null) result = defaultCase(theEObject);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase CommonPackage.MAPPING_ENTRY: {\n\t\t\t\tMappingEntry<?> mappingEntry = (MappingEntry<?>)theEObject;\n\t\t\t\tT1 result = caseMappingEntry(mappingEntry);\n\t\t\t\tif (result == null) result = defaultCase(theEObject);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase CommonPackage.STRING_TO_TABLE_MAPPING_ENTRY_MAP: {\n\t\t\t\t@SuppressWarnings(\"unchecked\") Map.Entry<String, MappingEntry<Table>> stringToTableMappingEntryMap = (Map.Entry<String, MappingEntry<Table>>)theEObject;\n\t\t\t\tT1 result = caseStringToTableMappingEntryMap(stringToTableMappingEntryMap);\n\t\t\t\tif (result == null) result = defaultCase(theEObject);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase CommonPackage.STRING_TO_COLUMN_MAPPING_ENTRY_MAP: {\n\t\t\t\t@SuppressWarnings(\"unchecked\") Map.Entry<String, MappingEntry<Column>> stringToColumnMappingEntryMap = (Map.Entry<String, MappingEntry<Column>>)theEObject;\n\t\t\t\tT1 result = caseStringToColumnMappingEntryMap(stringToColumnMappingEntryMap);\n\t\t\t\tif (result == null) result = defaultCase(theEObject);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase CommonPackage.TABLE_MAPPING: {\n\t\t\t\tTableMapping tableMapping = (TableMapping)theEObject;\n\t\t\t\tT1 result = caseTableMapping(tableMapping);\n\t\t\t\tif (result == null) result = defaultCase(theEObject);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase CommonPackage.COLUMN_MAPPING: {\n\t\t\t\tColumnMapping columnMapping = (ColumnMapping)theEObject;\n\t\t\t\tT1 result = caseColumnMapping(columnMapping);\n\t\t\t\tif (result == null) result = defaultCase(theEObject);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tdefault: return defaultCase(theEObject);\n\t\t}\n\t}",
"private static String convertTag(final String src) {\n final String s = TAG_NAMES.get(src);\n return s != null ? s : src;\n }",
"protected void do_switch() {\n {\n bind(OPC.CONST_0); iparmNone();\n pre(FLOW_NEXT); do_const(0); post();\n bind(OPC.CONST_1); iparmNone();\n pre(FLOW_NEXT); do_const(1); post();\n bind(OPC.CONST_2); iparmNone();\n pre(FLOW_NEXT); do_const(2); post();\n bind(OPC.CONST_3); iparmNone();\n pre(FLOW_NEXT); do_const(3); post();\n bind(OPC.CONST_4); iparmNone();\n pre(FLOW_NEXT); do_const(4); post();\n bind(OPC.CONST_5); iparmNone();\n pre(FLOW_NEXT); do_const(5); post();\n bind(OPC.CONST_6); iparmNone();\n pre(FLOW_NEXT); do_const(6); post();\n bind(OPC.CONST_7); iparmNone();\n pre(FLOW_NEXT); do_const(7); post();\n bind(OPC.CONST_8); iparmNone();\n pre(FLOW_NEXT); do_const(8); post();\n bind(OPC.CONST_9); iparmNone();\n pre(FLOW_NEXT); do_const(9); post();\n bind(OPC.CONST_10); iparmNone();\n pre(FLOW_NEXT); do_const(10); post();\n bind(OPC.CONST_11); iparmNone();\n pre(FLOW_NEXT); do_const(11); post();\n bind(OPC.CONST_12); iparmNone();\n pre(FLOW_NEXT); do_const(12); post();\n bind(OPC.CONST_13); iparmNone();\n pre(FLOW_NEXT); do_const(13); post();\n bind(OPC.CONST_14); iparmNone();\n pre(FLOW_NEXT); do_const(14); post();\n bind(OPC.CONST_15); iparmNone();\n pre(FLOW_NEXT); do_const(15); post();\n bind(OPC.OBJECT_0); iparmNone();\n pre(FLOW_NEXT); do_object(0); post();\n bind(OPC.OBJECT_1); iparmNone();\n pre(FLOW_NEXT); do_object(1); post();\n bind(OPC.OBJECT_2); iparmNone();\n pre(FLOW_NEXT); do_object(2); post();\n bind(OPC.OBJECT_3); iparmNone();\n pre(FLOW_NEXT); do_object(3); post();\n bind(OPC.OBJECT_4); iparmNone();\n pre(FLOW_NEXT); do_object(4); post();\n bind(OPC.OBJECT_5); iparmNone();\n pre(FLOW_NEXT); do_object(5); post();\n bind(OPC.OBJECT_6); iparmNone();\n pre(FLOW_NEXT); do_object(6); post();\n bind(OPC.OBJECT_7); iparmNone();\n pre(FLOW_NEXT); do_object(7); post();\n bind(OPC.OBJECT_8); iparmNone();\n pre(FLOW_NEXT); do_object(8); post();\n bind(OPC.OBJECT_9); iparmNone();\n pre(FLOW_NEXT); do_object(9); post();\n bind(OPC.OBJECT_10); iparmNone();\n pre(FLOW_NEXT); do_object(10); post();\n bind(OPC.OBJECT_11); iparmNone();\n pre(FLOW_NEXT); do_object(11); post();\n bind(OPC.OBJECT_12); iparmNone();\n pre(FLOW_NEXT); do_object(12); post();\n bind(OPC.OBJECT_13); iparmNone();\n pre(FLOW_NEXT); do_object(13); post();\n bind(OPC.OBJECT_14); iparmNone();\n pre(FLOW_NEXT); do_object(14); post();\n bind(OPC.OBJECT_15); iparmNone();\n pre(FLOW_NEXT); do_object(15); post();\n bind(OPC.LOAD_0); iparmNone();\n pre(FLOW_NEXT); do_load(0); post();\n bind(OPC.LOAD_1); iparmNone();\n pre(FLOW_NEXT); do_load(1); post();\n bind(OPC.LOAD_2); iparmNone();\n pre(FLOW_NEXT); do_load(2); post();\n bind(OPC.LOAD_3); iparmNone();\n pre(FLOW_NEXT); do_load(3); post();\n bind(OPC.LOAD_4); iparmNone();\n pre(FLOW_NEXT); do_load(4); post();\n bind(OPC.LOAD_5); iparmNone();\n pre(FLOW_NEXT); do_load(5); post();\n bind(OPC.LOAD_6); iparmNone();\n pre(FLOW_NEXT); do_load(6); post();\n bind(OPC.LOAD_7); iparmNone();\n pre(FLOW_NEXT); do_load(7); post();\n bind(OPC.LOAD_8); iparmNone();\n pre(FLOW_NEXT); do_load(8); post();\n bind(OPC.LOAD_9); iparmNone();\n pre(FLOW_NEXT); do_load(9); post();\n bind(OPC.LOAD_10); iparmNone();\n pre(FLOW_NEXT); do_load(10); post();\n bind(OPC.LOAD_11); iparmNone();\n pre(FLOW_NEXT); do_load(11); post();\n bind(OPC.LOAD_12); iparmNone();\n pre(FLOW_NEXT); do_load(12); post();\n bind(OPC.LOAD_13); iparmNone();\n pre(FLOW_NEXT); do_load(13); post();\n bind(OPC.LOAD_14); iparmNone();\n pre(FLOW_NEXT); do_load(14); post();\n bind(OPC.LOAD_15); iparmNone();\n pre(FLOW_NEXT); do_load(15); post();\n bind(OPC.STORE_0); iparmNone();\n pre(FLOW_NEXT); do_store(0); post();\n bind(OPC.STORE_1); iparmNone();\n pre(FLOW_NEXT); do_store(1); post();\n bind(OPC.STORE_2); iparmNone();\n pre(FLOW_NEXT); do_store(2); post();\n bind(OPC.STORE_3); iparmNone();\n pre(FLOW_NEXT); do_store(3); post();\n bind(OPC.STORE_4); iparmNone();\n pre(FLOW_NEXT); do_store(4); post();\n bind(OPC.STORE_5); iparmNone();\n pre(FLOW_NEXT); do_store(5); post();\n bind(OPC.STORE_6); iparmNone();\n pre(FLOW_NEXT); do_store(6); post();\n bind(OPC.STORE_7); iparmNone();\n pre(FLOW_NEXT); do_store(7); post();\n bind(OPC.STORE_8); iparmNone();\n pre(FLOW_NEXT); do_store(8); post();\n bind(OPC.STORE_9); iparmNone();\n pre(FLOW_NEXT); do_store(9); post();\n bind(OPC.STORE_10); iparmNone();\n pre(FLOW_NEXT); do_store(10); post();\n bind(OPC.STORE_11); iparmNone();\n pre(FLOW_NEXT); do_store(11); post();\n bind(OPC.STORE_12); iparmNone();\n pre(FLOW_NEXT); do_store(12); post();\n bind(OPC.STORE_13); iparmNone();\n pre(FLOW_NEXT); do_store(13); post();\n bind(OPC.STORE_14); iparmNone();\n pre(FLOW_NEXT); do_store(14); post();\n bind(OPC.STORE_15); iparmNone();\n pre(FLOW_NEXT); do_store(15); post();\n bind(OPC.LOADPARM_0); iparmNone();\n pre(FLOW_NEXT); do_loadparm(0); post();\n bind(OPC.LOADPARM_1); iparmNone();\n pre(FLOW_NEXT); do_loadparm(1); post();\n bind(OPC.LOADPARM_2); iparmNone();\n pre(FLOW_NEXT); do_loadparm(2); post();\n bind(OPC.LOADPARM_3); iparmNone();\n pre(FLOW_NEXT); do_loadparm(3); post();\n bind(OPC.LOADPARM_4); iparmNone();\n pre(FLOW_NEXT); do_loadparm(4); post();\n bind(OPC.LOADPARM_5); iparmNone();\n pre(FLOW_NEXT); do_loadparm(5); post();\n bind(OPC.LOADPARM_6); iparmNone();\n pre(FLOW_NEXT); do_loadparm(6); post();\n bind(OPC.LOADPARM_7); iparmNone();\n pre(FLOW_NEXT); do_loadparm(7); post();\n bind(OPC.WIDE_M1); iparmNone();\n pre(FLOW_CHANGE); do_wide(-1); post();\n bind(OPC.WIDE_0); iparmNone();\n pre(FLOW_CHANGE); do_wide(0); post();\n bind(OPC.WIDE_1); iparmNone();\n pre(FLOW_CHANGE); do_wide(1); post();\n bind(OPC.WIDE_SHORT); iparmNone();\n pre(FLOW_CHANGE); do_wide_short(); post();\n bind(OPC.WIDE_INT); iparmNone();\n pre(FLOW_CHANGE); do_wide_int(); post();\n bind(OPC.ESCAPE); iparmNone();\n pre(FLOW_CHANGE); do_escape(); post();\n bind(OPC.ESCAPE_WIDE_M1); iparmNone();\n pre(FLOW_CHANGE); do_escape_wide(-1); post();\n bind(OPC.ESCAPE_WIDE_0); iparmNone();\n pre(FLOW_CHANGE); do_escape_wide(0); post();\n bind(OPC.ESCAPE_WIDE_1); iparmNone();\n pre(FLOW_CHANGE); do_escape_wide(1); post();\n bind(OPC.ESCAPE_WIDE_SHORT); iparmNone();\n pre(FLOW_CHANGE); do_escape_wide_short(); post();\n bind(OPC.ESCAPE_WIDE_INT); iparmNone();\n pre(FLOW_CHANGE); do_escape_wide_int(); post();\n bind(OPC.CATCH); iparmNone();\n pre(FLOW_NEXT); do_catch(); post();\n bind(OPC.CONST_NULL); iparmNone();\n pre(FLOW_NEXT); do_const_null(); post();\n bind(OPC.CONST_M1); iparmNone();\n pre(FLOW_NEXT); do_const(-1); post();\n bind(OPC.CONST_BYTE); iparmNone();\n pre(FLOW_NEXT); do_const_byte(); post();\n bind(OPC.CONST_SHORT); iparmNone();\n pre(FLOW_NEXT); do_const_short(); post();\n bind(OPC.CONST_CHAR); iparmNone();\n pre(FLOW_NEXT); do_const_char(); post();\n bind(OPC.CONST_INT); iparmNone();\n pre(FLOW_NEXT); do_const_int(); post();\n bind(OPC.CONST_LONG); iparmNone();\n pre(FLOW_NEXT); do_const_long(); post();\n bind(OPC.OBJECT); iparmUByte();\n bind(OPC.OBJECT_WIDE); pre(FLOW_NEXT); do_object(); post();\n bind(OPC.LOAD); iparmUByte();\n bind(OPC.LOAD_WIDE); pre(FLOW_NEXT); do_load(); post(); \n bind(OPC.LOAD_I2); iparmUByte();\n bind(OPC.LOAD_I2_WIDE); pre(FLOW_NEXT); do_load_i2(); post();\n bind(OPC.STORE); iparmUByte();\n bind(OPC.STORE_WIDE); pre(FLOW_NEXT); do_store(); post();\n bind(OPC.STORE_I2); iparmUByte();\n bind(OPC.STORE_I2_WIDE); pre(FLOW_NEXT); do_store_i2(); post();\n bind(OPC.LOADPARM); iparmUByte();\n bind(OPC.LOADPARM_WIDE); pre(FLOW_NEXT); do_loadparm(); post();\n bind(OPC.LOADPARM_I2); iparmUByte();\n bind(OPC.LOADPARM_I2_WIDE); pre(FLOW_NEXT); do_loadparm_i2(); post();\n bind(OPC.STOREPARM); iparmUByte();\n bind(OPC.STOREPARM_WIDE); pre(FLOW_NEXT); do_storeparm(); post();\n bind(OPC.STOREPARM_I2); iparmUByte();\n bind(OPC.STOREPARM_I2_WIDE); pre(FLOW_NEXT); do_storeparm_i2(); post();\n bind(OPC.INC); iparmUByte();\n bind(OPC.INC_WIDE); pre(FLOW_NEXT); do_inc(); post(); \n bind(OPC.DEC); iparmUByte();\n bind(OPC.DEC_WIDE); pre(FLOW_NEXT); do_dec(); post(); \n bind(OPC.INCPARM); iparmUByte();\n bind(OPC.INCPARM_WIDE); pre(FLOW_NEXT); do_incparm(); post();\n bind(OPC.DECPARM); iparmUByte();\n bind(OPC.DECPARM_WIDE); pre(FLOW_NEXT); do_decparm(); post();\n bind(OPC.GOTO); iparmByte();\n bind(OPC.GOTO_WIDE); pre(FLOW_CHANGE); do_goto(); post();\n bind(OPC.IF_EQ_O); iparmByte();\n bind(OPC.IF_EQ_O_WIDE); pre(FLOW_CHANGE); do_if(1, EQ, OOP); post();\n bind(OPC.IF_NE_O); iparmByte();\n bind(OPC.IF_NE_O_WIDE); pre(FLOW_CHANGE); do_if(1, NE, OOP); post();\n bind(OPC.IF_CMPEQ_O); iparmByte();\n bind(OPC.IF_CMPEQ_O_WIDE); pre(FLOW_CHANGE); do_if(2, EQ, OOP); post();\n bind(OPC.IF_CMPNE_O); iparmByte();\n bind(OPC.IF_CMPNE_O_WIDE); pre(FLOW_CHANGE); do_if(2, NE, OOP); post();\n bind(OPC.IF_EQ_I); iparmByte();\n bind(OPC.IF_EQ_I_WIDE); pre(FLOW_CHANGE); do_if(1, EQ, INT); post();\n bind(OPC.IF_NE_I); iparmByte();\n bind(OPC.IF_NE_I_WIDE); pre(FLOW_CHANGE); do_if(1, NE, INT); post();\n bind(OPC.IF_LT_I); iparmByte();\n bind(OPC.IF_LT_I_WIDE); pre(FLOW_CHANGE); do_if(1, LT, INT); post();\n bind(OPC.IF_LE_I); iparmByte();\n bind(OPC.IF_LE_I_WIDE); pre(FLOW_CHANGE); do_if(1, LE, INT); post();\n bind(OPC.IF_GT_I); iparmByte();\n bind(OPC.IF_GT_I_WIDE); pre(FLOW_CHANGE); do_if(1, GT, INT); post();\n bind(OPC.IF_GE_I); iparmByte();\n bind(OPC.IF_GE_I_WIDE); pre(FLOW_CHANGE); do_if(1, GE, INT); post();\n bind(OPC.IF_CMPEQ_I); iparmByte();\n bind(OPC.IF_CMPEQ_I_WIDE); pre(FLOW_CHANGE); do_if(2, EQ, INT); post();\n bind(OPC.IF_CMPNE_I); iparmByte();\n bind(OPC.IF_CMPNE_I_WIDE); pre(FLOW_CHANGE); do_if(2, NE, INT); post();\n bind(OPC.IF_CMPLT_I); iparmByte();\n bind(OPC.IF_CMPLT_I_WIDE); pre(FLOW_CHANGE); do_if(2, LT, INT); post();\n bind(OPC.IF_CMPLE_I); iparmByte();\n bind(OPC.IF_CMPLE_I_WIDE); pre(FLOW_CHANGE); do_if(2, LE, INT); post();\n bind(OPC.IF_CMPGT_I); iparmByte();\n bind(OPC.IF_CMPGT_I_WIDE); pre(FLOW_CHANGE); do_if(2, GT, INT); post();\n bind(OPC.IF_CMPGE_I); iparmByte();\n bind(OPC.IF_CMPGE_I_WIDE); pre(FLOW_CHANGE); do_if(2, GE, INT); post();\n bind(OPC.IF_EQ_L); iparmByte();\n bind(OPC.IF_EQ_L_WIDE); pre(FLOW_CHANGE); do_if(1, EQ, LONG); post();\n bind(OPC.IF_NE_L); iparmByte();\n bind(OPC.IF_NE_L_WIDE); pre(FLOW_CHANGE); do_if(1, NE, LONG); post();\n bind(OPC.IF_LT_L); iparmByte();\n bind(OPC.IF_LT_L_WIDE); pre(FLOW_CHANGE); do_if(1, LT, LONG); post();\n bind(OPC.IF_LE_L); iparmByte();\n bind(OPC.IF_LE_L_WIDE); pre(FLOW_CHANGE); do_if(1, LE, LONG); post();\n bind(OPC.IF_GT_L); iparmByte();\n bind(OPC.IF_GT_L_WIDE); pre(FLOW_CHANGE); do_if(1, GT, LONG); post();\n bind(OPC.IF_GE_L); iparmByte();\n bind(OPC.IF_GE_L_WIDE); pre(FLOW_CHANGE); do_if(1, GE, LONG); post();\n bind(OPC.IF_CMPEQ_L); iparmByte();\n bind(OPC.IF_CMPEQ_L_WIDE); pre(FLOW_CHANGE); do_if(2, EQ, LONG); post();\n bind(OPC.IF_CMPNE_L); iparmByte();\n bind(OPC.IF_CMPNE_L_WIDE); pre(FLOW_CHANGE); do_if(2, NE, LONG); post();\n bind(OPC.IF_CMPLT_L); iparmByte();\n bind(OPC.IF_CMPLT_L_WIDE); pre(FLOW_CHANGE); do_if(2, LT, LONG); post();\n bind(OPC.IF_CMPLE_L); iparmByte();\n bind(OPC.IF_CMPLE_L_WIDE); pre(FLOW_CHANGE); do_if(2, LE, LONG); post();\n bind(OPC.IF_CMPGT_L); iparmByte();\n bind(OPC.IF_CMPGT_L_WIDE); pre(FLOW_CHANGE); do_if(2, GT, LONG); post();\n bind(OPC.IF_CMPGE_L); iparmByte();\n bind(OPC.IF_CMPGE_L_WIDE); pre(FLOW_CHANGE); do_if(2, GE, LONG); post();\n bind(OPC.GETSTATIC_I); iparmUByte();\n bind(OPC.GETSTATIC_I_WIDE); pre(FLOW_CALL); do_getstatic(INT); post();\n bind(OPC.GETSTATIC_O); iparmUByte();\n bind(OPC.GETSTATIC_O_WIDE); pre(FLOW_CALL); do_getstatic(OOP); post();\n bind(OPC.GETSTATIC_L); iparmUByte();\n bind(OPC.GETSTATIC_L_WIDE); pre(FLOW_CALL); do_getstatic(LONG); post();\n bind(OPC.CLASS_GETSTATIC_I); iparmUByte();\n bind(OPC.CLASS_GETSTATIC_I_WIDE); pre(FLOW_CALL); do_class_getstatic(INT); post();\n bind(OPC.CLASS_GETSTATIC_O); iparmUByte();\n bind(OPC.CLASS_GETSTATIC_O_WIDE); pre(FLOW_CALL); do_class_getstatic(OOP); post();\n bind(OPC.CLASS_GETSTATIC_L); iparmUByte();\n bind(OPC.CLASS_GETSTATIC_L_WIDE); pre(FLOW_CALL); do_class_getstatic(LONG); post();\n bind(OPC.PUTSTATIC_I); iparmUByte();\n bind(OPC.PUTSTATIC_I_WIDE); pre(FLOW_CALL); do_putstatic(INT); post();\n bind(OPC.PUTSTATIC_O); iparmUByte();\n bind(OPC.PUTSTATIC_O_WIDE); pre(FLOW_CALL); do_putstatic(OOP); post();\n bind(OPC.PUTSTATIC_L); iparmUByte();\n bind(OPC.PUTSTATIC_L_WIDE); pre(FLOW_CALL); do_putstatic(LONG); post();\n bind(OPC.CLASS_PUTSTATIC_I); iparmUByte();\n bind(OPC.CLASS_PUTSTATIC_I_WIDE); pre(FLOW_CALL); do_class_putstatic(INT); post();\n bind(OPC.CLASS_PUTSTATIC_O); iparmUByte();\n bind(OPC.CLASS_PUTSTATIC_O_WIDE); pre(FLOW_CALL); do_class_putstatic(OOP); post();\n bind(OPC.CLASS_PUTSTATIC_L); iparmUByte();\n bind(OPC.CLASS_PUTSTATIC_L_WIDE); pre(FLOW_CALL); do_class_putstatic(LONG); post();\n bind(OPC.GETFIELD_I); iparmUByte();\n bind(OPC.GETFIELD_I_WIDE); pre(FLOW_CALL); do_getfield(INT); post();\n bind(OPC.GETFIELD_B); iparmUByte();\n bind(OPC.GETFIELD_B_WIDE); pre(FLOW_CALL); do_getfield(BYTE); post();\n bind(OPC.GETFIELD_S); iparmUByte();\n bind(OPC.GETFIELD_S_WIDE); pre(FLOW_CALL); do_getfield(SHORT); post();\n bind(OPC.GETFIELD_C); iparmUByte();\n bind(OPC.GETFIELD_C_WIDE); pre(FLOW_CALL); do_getfield(USHORT); post();\n bind(OPC.GETFIELD_O); iparmUByte();\n bind(OPC.GETFIELD_O_WIDE); pre(FLOW_CALL); do_getfield(OOP); post();\n bind(OPC.GETFIELD_L); iparmUByte();\n bind(OPC.GETFIELD_L_WIDE); pre(FLOW_CALL); do_getfield(LONG); post();\n bind(OPC.GETFIELD0_I); iparmUByte();\n bind(OPC.GETFIELD0_I_WIDE); pre(FLOW_NEXT); do_getfield0(INT); post();\n bind(OPC.GETFIELD0_B); iparmUByte();\n bind(OPC.GETFIELD0_B_WIDE); pre(FLOW_NEXT); do_getfield0(BYTE); post();\n bind(OPC.GETFIELD0_S); iparmUByte();\n bind(OPC.GETFIELD0_S_WIDE); pre(FLOW_NEXT); do_getfield0(SHORT); post();\n bind(OPC.GETFIELD0_C); iparmUByte();\n bind(OPC.GETFIELD0_C_WIDE); pre(FLOW_NEXT); do_getfield0(USHORT); post();\n bind(OPC.GETFIELD0_O); iparmUByte();\n bind(OPC.GETFIELD0_O_WIDE); pre(FLOW_NEXT); do_getfield0(OOP); post();\n bind(OPC.GETFIELD0_L); iparmUByte();\n bind(OPC.GETFIELD0_L_WIDE); pre(FLOW_NEXT); do_getfield0(LONG); post();\n bind(OPC.PUTFIELD_I); iparmUByte();\n bind(OPC.PUTFIELD_I_WIDE); pre(FLOW_CALL); do_putfield(INT); post();\n bind(OPC.PUTFIELD_B); iparmUByte();\n bind(OPC.PUTFIELD_B_WIDE); pre(FLOW_CALL); do_putfield(BYTE); post();\n bind(OPC.PUTFIELD_S); iparmUByte();\n bind(OPC.PUTFIELD_S_WIDE); pre(FLOW_CALL); do_putfield(SHORT); post();\n bind(OPC.PUTFIELD_O); iparmUByte();\n bind(OPC.PUTFIELD_O_WIDE); pre(FLOW_CALL); do_putfield(OOP); post();\n bind(OPC.PUTFIELD_L); iparmUByte();\n bind(OPC.PUTFIELD_L_WIDE); pre(FLOW_CALL); do_putfield(LONG); post();\n bind(OPC.PUTFIELD0_I); iparmUByte();\n bind(OPC.PUTFIELD0_I_WIDE); pre(FLOW_NEXT); do_putfield0(INT); post();\n bind(OPC.PUTFIELD0_B); iparmUByte();\n bind(OPC.PUTFIELD0_B_WIDE); pre(FLOW_NEXT); do_putfield0(BYTE); post();\n bind(OPC.PUTFIELD0_S); iparmUByte();\n bind(OPC.PUTFIELD0_S_WIDE); pre(FLOW_NEXT); do_putfield0(SHORT); post();\n bind(OPC.PUTFIELD0_O); iparmUByte();\n bind(OPC.PUTFIELD0_O_WIDE); pre(FLOW_NEXT); do_putfield0(OOP); post();\n bind(OPC.PUTFIELD0_L); iparmUByte();\n bind(OPC.PUTFIELD0_L_WIDE); pre(FLOW_NEXT); do_putfield0(LONG); post();\n bind(OPC.INVOKEVIRTUAL_I); iparmUByte();\n bind(OPC.INVOKEVIRTUAL_I_WIDE); pre(FLOW_CALL); do_invokevirtual(INT); post();\n bind(OPC.INVOKEVIRTUAL_V); iparmUByte();\n bind(OPC.INVOKEVIRTUAL_V_WIDE); pre(FLOW_CALL); do_invokevirtual(VOID); post();\n bind(OPC.INVOKEVIRTUAL_L); iparmUByte();\n bind(OPC.INVOKEVIRTUAL_L_WIDE); pre(FLOW_CALL); do_invokevirtual(LONG); post();\n bind(OPC.INVOKEVIRTUAL_O); iparmUByte();\n bind(OPC.INVOKEVIRTUAL_O_WIDE); pre(FLOW_CALL); do_invokevirtual(OOP); post();\n bind(OPC.INVOKESTATIC_I); iparmUByte();\n bind(OPC.INVOKESTATIC_I_WIDE); pre(FLOW_CALL); do_invokestatic(INT); post();\n bind(OPC.INVOKESTATIC_V); iparmUByte();\n bind(OPC.INVOKESTATIC_V_WIDE); pre(FLOW_CALL); do_invokestatic(VOID); post();\n bind(OPC.INVOKESTATIC_L); iparmUByte();\n bind(OPC.INVOKESTATIC_L_WIDE); pre(FLOW_CALL); do_invokestatic(LONG); post();\n bind(OPC.INVOKESTATIC_O); iparmUByte();\n bind(OPC.INVOKESTATIC_O_WIDE); pre(FLOW_CALL); do_invokestatic(OOP); post();\n bind(OPC.INVOKESUPER_I); iparmUByte();\n bind(OPC.INVOKESUPER_I_WIDE); pre(FLOW_CALL); do_invokesuper(INT); post();\n bind(OPC.INVOKESUPER_V); iparmUByte();\n bind(OPC.INVOKESUPER_V_WIDE); pre(FLOW_CALL); do_invokesuper(VOID); post();\n bind(OPC.INVOKESUPER_L); iparmUByte();\n bind(OPC.INVOKESUPER_L_WIDE); pre(FLOW_CALL); do_invokesuper(LONG); post();\n bind(OPC.INVOKESUPER_O); iparmUByte();\n bind(OPC.INVOKESUPER_O_WIDE); pre(FLOW_CALL); do_invokesuper(OOP); post();\n bind(OPC.INVOKENATIVE_I); iparmUByte();\n bind(OPC.INVOKENATIVE_I_WIDE); pre(FLOW_CALL); do_invokenative(INT); post();\n bind(OPC.INVOKENATIVE_V); iparmUByte();\n bind(OPC.INVOKENATIVE_V_WIDE); pre(FLOW_CALL); do_invokenative(VOID); post();\n bind(OPC.INVOKENATIVE_L); iparmUByte();\n bind(OPC.INVOKENATIVE_L_WIDE); pre(FLOW_CALL); do_invokenative(LONG); post();\n bind(OPC.INVOKENATIVE_O); iparmUByte();\n bind(OPC.INVOKENATIVE_O_WIDE); pre(FLOW_CALL); do_invokenative(OOP); post();\n bind(OPC.FINDSLOT); iparmUByte();\n bind(OPC.FINDSLOT_WIDE); pre(FLOW_CALL); do_findslot(); post();\n bind(OPC.EXTEND); iparmUByte();\n bind(OPC.EXTEND_WIDE); pre(FLOW_NEXT); do_extend(); post();\n bind(OPC.INVOKESLOT_I); iparmNone();\n pre(FLOW_CALL); do_invokeslot(INT); post();\n bind(OPC.INVOKESLOT_V); iparmNone();\n pre(FLOW_CALL); do_invokeslot(VOID); post();\n bind(OPC.INVOKESLOT_L); iparmNone();\n pre(FLOW_CALL); do_invokeslot(LONG); post();\n bind(OPC.INVOKESLOT_O); iparmNone();\n pre(FLOW_CALL); do_invokeslot(OOP); post();\n bind(OPC.RETURN_V); iparmNone();\n pre(FLOW_CHANGE); do_return(VOID); post();\n bind(OPC.RETURN_I); iparmNone();\n pre(FLOW_CHANGE); do_return(INT); post();\n bind(OPC.RETURN_L); iparmNone();\n pre(FLOW_CHANGE); do_return(LONG); post();\n bind(OPC.RETURN_O); iparmNone();\n pre(FLOW_CHANGE); do_return(OOP); post();\n bind(OPC.TABLESWITCH_I); iparmNone();\n pre(FLOW_CHANGE); do_tableswitch(INT); post();\n bind(OPC.TABLESWITCH_S); iparmNone();\n pre(FLOW_CHANGE); do_tableswitch(SHORT); post();\n bind(OPC.EXTEND0); iparmNone();\n pre(FLOW_NEXT); do_extend0(); post();\n bind(OPC.ADD_I); iparmNone();\n pre(FLOW_NEXT); do_add(INT); post();\n bind(OPC.SUB_I); iparmNone();\n pre(FLOW_NEXT); do_sub(INT); post();\n bind(OPC.AND_I); iparmNone();\n pre(FLOW_NEXT); do_and(INT); post();\n bind(OPC.OR_I); iparmNone();\n pre(FLOW_NEXT); do_or(INT); post();\n bind(OPC.XOR_I); iparmNone();\n pre(FLOW_NEXT); do_xor(INT); post();\n bind(OPC.SHL_I); iparmNone();\n pre(FLOW_NEXT); do_shl(INT); post();\n bind(OPC.SHR_I); iparmNone();\n pre(FLOW_NEXT); do_shr(INT); post();\n bind(OPC.USHR_I); iparmNone();\n pre(FLOW_NEXT); do_ushr(INT); post();\n bind(OPC.MUL_I); iparmNone();\n pre(FLOW_NEXT); do_mul(INT); post();\n bind(OPC.DIV_I); iparmNone();\n pre(FLOW_CALL); do_div(INT); post();\n bind(OPC.REM_I); iparmNone();\n pre(FLOW_CALL); do_rem(INT); post();\n bind(OPC.NEG_I); iparmNone();\n pre(FLOW_NEXT); do_neg(INT); post();\n bind(OPC.I2B); iparmNone();\n pre(FLOW_NEXT); do_i2b(); post(); \n bind(OPC.I2S); iparmNone();\n pre(FLOW_NEXT); do_i2s(); post(); \n bind(OPC.I2C); iparmNone();\n pre(FLOW_NEXT); do_i2c(); post(); \n bind(OPC.ADD_L); iparmNone();\n pre(FLOW_NEXT); do_add(LONG); post();\n bind(OPC.SUB_L); iparmNone();\n pre(FLOW_NEXT); do_sub(LONG); post();\n bind(OPC.MUL_L); iparmNone();\n pre(FLOW_NEXT); do_mul(LONG); post();\n bind(OPC.DIV_L); iparmNone();\n pre(FLOW_CALL); do_div(LONG); post();\n bind(OPC.REM_L); iparmNone();\n pre(FLOW_CALL); do_rem(LONG); post();\n bind(OPC.AND_L); iparmNone();\n pre(FLOW_NEXT); do_and(LONG); post();\n bind(OPC.OR_L); iparmNone();\n pre(FLOW_NEXT); do_or(LONG); post();\n bind(OPC.XOR_L); iparmNone();\n pre(FLOW_NEXT); do_xor(LONG); post();\n bind(OPC.NEG_L); iparmNone();\n pre(FLOW_NEXT); do_neg(LONG); post();\n bind(OPC.SHL_L); iparmNone();\n pre(FLOW_NEXT); do_shl(LONG); post();\n bind(OPC.SHR_L); iparmNone();\n pre(FLOW_NEXT); do_shr(LONG); post();\n bind(OPC.USHR_L); iparmNone();\n pre(FLOW_NEXT); do_ushr(LONG); post();\n bind(OPC.L2I); iparmNone();\n pre(FLOW_NEXT); do_l2i(); post(); \n bind(OPC.I2L); iparmNone();\n pre(FLOW_NEXT); do_i2l(); post(); \n bind(OPC.THROW); iparmNone();\n pre(FLOW_CALL); do_throw(); post();\n bind(OPC.POP_1); iparmNone();\n pre(FLOW_NEXT); do_pop(1); post(); \n bind(OPC.POP_2); iparmNone();\n pre(FLOW_NEXT); do_pop(2); post(); \n bind(OPC.MONITORENTER); iparmNone();\n pre(FLOW_CALL); do_monitorenter(); post();\n bind(OPC.MONITOREXIT); iparmNone();\n pre(FLOW_CALL); do_monitorexit(); post();\n bind(OPC.CLASS_MONITORENTER); iparmNone();\n pre(FLOW_CALL); do_class_monitorenter(); post();\n bind(OPC.CLASS_MONITOREXIT); iparmNone();\n pre(FLOW_CALL); do_class_monitorexit(); post();\n bind(OPC.ARRAYLENGTH); iparmNone();\n pre(FLOW_CALL); do_arraylength(); post();\n bind(OPC.NEW); iparmNone();\n pre(FLOW_CALL); do_new(); post(); \n bind(OPC.NEWARRAY); iparmNone();\n pre(FLOW_CALL); do_newarray(); post();\n bind(OPC.NEWDIMENSION); iparmNone();\n pre(FLOW_CALL); do_newdimension(); post();\n bind(OPC.CLASS_CLINIT); iparmNone();\n pre(FLOW_CALL); do_class_clinit(); post();\n bind(OPC.BBTARGET_SYS); iparmNone();\n pre(FLOW_NEXT); do_bbtarget_sys(); post();\n bind(OPC.BBTARGET_APP); iparmNone();\n pre(FLOW_CALL); do_bbtarget_app(); post();\n bind(OPC.INSTANCEOF); iparmNone();\n pre(FLOW_CALL); do_instanceof(); post();\n bind(OPC.CHECKCAST); iparmNone();\n pre(FLOW_CALL); do_checkcast(); post();\n bind(OPC.ALOAD_I); iparmNone();\n pre(FLOW_CALL); do_aload(INT); post();\n bind(OPC.ALOAD_B); iparmNone();\n pre(FLOW_CALL); do_aload(BYTE); post();\n bind(OPC.ALOAD_S); iparmNone();\n pre(FLOW_CALL); do_aload(SHORT); post();\n bind(OPC.ALOAD_C); iparmNone();\n pre(FLOW_CALL); do_aload(USHORT); post();\n bind(OPC.ALOAD_O); iparmNone();\n pre(FLOW_CALL); do_aload(OOP); post();\n bind(OPC.ALOAD_L); iparmNone();\n pre(FLOW_CALL); do_aload(LONG); post();\n bind(OPC.ASTORE_I); iparmNone();\n pre(FLOW_CALL); do_astore(INT); post();\n bind(OPC.ASTORE_B); iparmNone();\n pre(FLOW_CALL); do_astore(BYTE); post();\n bind(OPC.ASTORE_S); iparmNone();\n pre(FLOW_CALL); do_astore(SHORT); post();\n bind(OPC.ASTORE_O); iparmNone();\n pre(FLOW_CALL); do_astore(OOP); post();\n bind(OPC.ASTORE_L); iparmNone();\n pre(FLOW_CALL); do_astore(LONG); post();\n bind(OPC.LOOKUP_I); iparmNone();\n pre(FLOW_CALL); do_lookup(INT); post();\n bind(OPC.LOOKUP_B); iparmNone();\n pre(FLOW_CALL); do_lookup(BYTE); post();\n bind(OPC.LOOKUP_S); iparmNone();\n pre(FLOW_CALL); do_lookup(SHORT); post();\n bind(OPC.PAUSE); iparmNone();\n pre(FLOW_NEXT); do_pause(); post();\n\n/*if[FLOATS]*/\n bind(OPC.FCMPL); iparmNone();\n pre(FLOW_NEXT); do_fcmpl(); post();\n bind(OPC.FCMPG); iparmNone();\n pre(FLOW_NEXT); do_fcmpg(); post();\n bind(OPC.DCMPL); iparmNone();\n pre(FLOW_NEXT); do_dcmpl(); post();\n bind(OPC.DCMPG); iparmNone();\n pre(FLOW_NEXT); do_dcmpg(); post();\n bind(OPC.GETSTATIC_F); iparmUByte();\n bind(OPC.GETSTATIC_F_WIDE); pre(FLOW_CALL); do_getstatic(FLOAT); post();\n bind(OPC.GETSTATIC_D); iparmUByte();\n bind(OPC.GETSTATIC_D_WIDE); pre(FLOW_CALL); do_getstatic(DOUBLE); post();\n bind(OPC.CLASS_GETSTATIC_F); iparmUByte();\n bind(OPC.CLASS_GETSTATIC_F_WIDE); pre(FLOW_CALL); do_class_getstatic(FLOAT); post();\n bind(OPC.CLASS_GETSTATIC_D); iparmUByte();\n bind(OPC.CLASS_GETSTATIC_D_WIDE); pre(FLOW_CALL); do_class_getstatic(DOUBLE); post();\n bind(OPC.PUTSTATIC_F); iparmUByte();\n bind(OPC.PUTSTATIC_F_WIDE); pre(FLOW_CALL); do_putstatic(FLOAT); post();\n bind(OPC.PUTSTATIC_D); iparmUByte();\n bind(OPC.PUTSTATIC_D_WIDE); pre(FLOW_CALL); do_putstatic(DOUBLE); post();\n bind(OPC.CLASS_PUTSTATIC_F); iparmUByte();\n bind(OPC.CLASS_PUTSTATIC_F_WIDE); pre(FLOW_CALL); do_class_putstatic(FLOAT); post();\n bind(OPC.CLASS_PUTSTATIC_D); iparmUByte();\n bind(OPC.CLASS_PUTSTATIC_D_WIDE); pre(FLOW_CALL); do_class_putstatic(DOUBLE); post();\n bind(OPC.GETFIELD_F); iparmUByte();\n bind(OPC.GETFIELD_F_WIDE); pre(FLOW_CALL); do_getfield(FLOAT); post();\n bind(OPC.GETFIELD_D); iparmUByte();\n bind(OPC.GETFIELD_D_WIDE); pre(FLOW_CALL); do_getfield(DOUBLE); post();\n bind(OPC.GETFIELD0_F); iparmUByte();\n bind(OPC.GETFIELD0_F_WIDE); pre(FLOW_NEXT); do_getfield0(FLOAT); post();\n bind(OPC.GETFIELD0_D); iparmUByte();\n bind(OPC.GETFIELD0_D_WIDE); pre(FLOW_NEXT); do_getfield0(DOUBLE); post();\n bind(OPC.PUTFIELD_F); iparmUByte();\n bind(OPC.PUTFIELD_F_WIDE); pre(FLOW_CALL); do_putfield(FLOAT); post();\n bind(OPC.PUTFIELD_D); iparmUByte();\n bind(OPC.PUTFIELD_D_WIDE); pre(FLOW_CALL); do_putfield(DOUBLE); post();\n bind(OPC.PUTFIELD0_F); iparmUByte();\n bind(OPC.PUTFIELD0_F_WIDE); pre(FLOW_NEXT); do_putfield0(FLOAT); post();\n bind(OPC.PUTFIELD0_D); iparmUByte();\n bind(OPC.PUTFIELD0_D_WIDE); pre(FLOW_NEXT); do_putfield0(DOUBLE); post();\n bind(OPC.INVOKEVIRTUAL_F); iparmUByte();\n bind(OPC.INVOKEVIRTUAL_F_WIDE); pre(FLOW_CALL); do_invokevirtual(FLOAT); post();\n bind(OPC.INVOKEVIRTUAL_D); iparmUByte();\n bind(OPC.INVOKEVIRTUAL_D_WIDE); pre(FLOW_CALL); do_invokevirtual(DOUBLE); post();\n bind(OPC.INVOKESTATIC_F); iparmUByte();\n bind(OPC.INVOKESTATIC_F_WIDE); pre(FLOW_CALL); do_invokestatic(FLOAT); post();\n bind(OPC.INVOKESTATIC_D); iparmUByte();\n bind(OPC.INVOKESTATIC_D_WIDE); pre(FLOW_CALL); do_invokestatic(DOUBLE); post();\n bind(OPC.INVOKESUPER_F); iparmUByte();\n bind(OPC.INVOKESUPER_F_WIDE); pre(FLOW_CALL); do_invokesuper(FLOAT); post();\n bind(OPC.INVOKESUPER_D); iparmUByte();\n bind(OPC.INVOKESUPER_D_WIDE); pre(FLOW_CALL); do_invokesuper(DOUBLE); post();\n bind(OPC.INVOKENATIVE_F); iparmUByte();\n bind(OPC.INVOKENATIVE_F_WIDE); pre(FLOW_CALL); do_invokenative(FLOAT); post();\n bind(OPC.INVOKENATIVE_D); iparmUByte();\n bind(OPC.INVOKENATIVE_D_WIDE); pre(FLOW_CALL); do_invokenative(DOUBLE); post();\n bind(OPC.INVOKESLOT_F); iparmNone();\n pre(FLOW_CALL); do_invokeslot(FLOAT); post();\n bind(OPC.INVOKESLOT_D); iparmNone();\n pre(FLOW_CALL); do_invokeslot(DOUBLE); post();\n bind(OPC.RETURN_F); iparmNone();\n pre(FLOW_CHANGE); do_return(FLOAT); post();\n bind(OPC.RETURN_D); iparmNone();\n pre(FLOW_CHANGE); do_return(DOUBLE); post();\n bind(OPC.CONST_FLOAT); iparmNone();\n pre(FLOW_CHANGE); do_const_float(); post();\n bind(OPC.CONST_DOUBLE); iparmNone();\n pre(FLOW_CHANGE); do_const_double(); post();\n bind(OPC.ADD_F); iparmNone();\n pre(FLOW_NEXT); do_add(FLOAT); post();\n bind(OPC.SUB_F); iparmNone();\n pre(FLOW_NEXT); do_sub(FLOAT); post();\n bind(OPC.MUL_F); iparmNone();\n pre(FLOW_NEXT); do_mul(FLOAT); post();\n bind(OPC.DIV_F); iparmNone();\n pre(FLOW_NEXT); do_div(FLOAT); post();\n bind(OPC.REM_F); iparmNone();\n pre(FLOW_NEXT); do_rem(FLOAT); post();\n bind(OPC.NEG_F); iparmNone();\n pre(FLOW_NEXT); do_neg(FLOAT); post();\n bind(OPC.ADD_D); iparmNone();\n pre(FLOW_NEXT); do_add(DOUBLE); post();\n bind(OPC.SUB_D); iparmNone();\n pre(FLOW_NEXT); do_sub(DOUBLE); post();\n bind(OPC.MUL_D); iparmNone();\n pre(FLOW_NEXT); do_mul(DOUBLE); post();\n bind(OPC.DIV_D); iparmNone();\n pre(FLOW_NEXT); do_div(DOUBLE); post();\n bind(OPC.REM_D); iparmNone();\n pre(FLOW_NEXT); do_rem(DOUBLE); post();\n bind(OPC.NEG_D); iparmNone();\n pre(FLOW_NEXT); do_neg(DOUBLE); post();\n bind(OPC.I2F); iparmNone();\n pre(FLOW_NEXT); do_i2f(); post(); \n bind(OPC.L2F); iparmNone();\n pre(FLOW_NEXT); do_l2f(); post(); \n bind(OPC.F2I); iparmNone();\n pre(FLOW_NEXT); do_f2i(); post(); \n bind(OPC.F2L); iparmNone();\n pre(FLOW_NEXT); do_f2l(); post(); \n bind(OPC.I2D); iparmNone();\n pre(FLOW_NEXT); do_i2d(); post(); \n bind(OPC.L2D); iparmNone();\n pre(FLOW_NEXT); do_l2d(); post(); \n bind(OPC.F2D); iparmNone();\n pre(FLOW_NEXT); do_f2d(); post(); \n bind(OPC.D2I); iparmNone();\n pre(FLOW_NEXT); do_d2i(); post(); \n bind(OPC.D2L); iparmNone();\n pre(FLOW_NEXT); do_d2l(); post(); \n bind(OPC.D2F); iparmNone();\n pre(FLOW_NEXT); do_d2f(); post(); \n bind(OPC.ALOAD_F); iparmNone();\n pre(FLOW_CALL); do_aload(FLOAT); post();\n bind(OPC.ALOAD_D); iparmNone();\n pre(FLOW_CALL); do_aload(DOUBLE); post();\n bind(OPC.ASTORE_F); iparmNone();\n pre(FLOW_CALL); do_astore(FLOAT); post();\n bind(OPC.ASTORE_D); iparmNone();\n pre(FLOW_CALL); do_astore(DOUBLE); post();\n/*end[FLOATS]*/\n }\n }",
"void mo1791a(String str);",
"void mo85415a(String str);",
"public final void switchLabel() throws RecognitionException {\n int switchLabel_StartIndex = input.index();\n try { dbg.enterRule(getGrammarFileName(), \"switchLabel\");\n if ( getRuleLevel()==0 ) {dbg.commence();}\n incRuleLevel();\n dbg.location(665, 1);\n\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 96) ) { return ; }\n // Java.g:666:5: ( 'case' constantExpression ':' | 'case' enumConstantName ':' | 'default' ':' )\n int alt119=3;\n try { dbg.enterDecision(119);\n\n int LA119_0 = input.LA(1);\n\n if ( (LA119_0==89) ) {\n int LA119_1 = input.LA(2);\n\n if ( (LA119_1==Identifier) ) {\n int LA119_3 = input.LA(3);\n\n if ( (LA119_3==75) ) {\n int LA119_5 = input.LA(4);\n\n if ( (synpred180_Java()) ) {\n alt119=1;\n }\n else if ( (synpred181_Java()) ) {\n alt119=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 119, 5, input);\n\n dbg.recognitionException(nvae);\n throw nvae;\n }\n }\n else if ( ((LA119_3>=29 && LA119_3<=30)||LA119_3==40||(LA119_3>=42 && LA119_3<=43)||LA119_3==48||LA119_3==51||LA119_3==64||LA119_3==66||(LA119_3>=90 && LA119_3<=110)) ) {\n alt119=1;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 119, 3, input);\n\n dbg.recognitionException(nvae);\n throw nvae;\n }\n }\n else if ( ((LA119_1>=FloatingPointLiteral && LA119_1<=DecimalLiteral)||LA119_1==47||(LA119_1>=56 && LA119_1<=63)||(LA119_1>=65 && LA119_1<=66)||(LA119_1>=69 && LA119_1<=72)||(LA119_1>=105 && LA119_1<=106)||(LA119_1>=109 && LA119_1<=113)) ) {\n alt119=1;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 119, 1, input);\n\n dbg.recognitionException(nvae);\n throw nvae;\n }\n }\n else if ( (LA119_0==74) ) {\n alt119=3;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 119, 0, input);\n\n dbg.recognitionException(nvae);\n throw nvae;\n }\n } finally {dbg.exitDecision(119);}\n\n switch (alt119) {\n case 1 :\n dbg.enterAlt(1);\n\n // Java.g:666:9: 'case' constantExpression ':'\n {\n dbg.location(666,9);\n match(input,89,FOLLOW_89_in_switchLabel3798); if (state.failed) return ;\n dbg.location(666,16);\n pushFollow(FOLLOW_constantExpression_in_switchLabel3800);\n constantExpression();\n\n state._fsp--;\n if (state.failed) return ;\n dbg.location(666,35);\n match(input,75,FOLLOW_75_in_switchLabel3802); if (state.failed) return ;\n\n }\n break;\n case 2 :\n dbg.enterAlt(2);\n\n // Java.g:667:9: 'case' enumConstantName ':'\n {\n dbg.location(667,9);\n match(input,89,FOLLOW_89_in_switchLabel3812); if (state.failed) return ;\n dbg.location(667,16);\n pushFollow(FOLLOW_enumConstantName_in_switchLabel3814);\n enumConstantName();\n\n state._fsp--;\n if (state.failed) return ;\n dbg.location(667,33);\n match(input,75,FOLLOW_75_in_switchLabel3816); if (state.failed) return ;\n\n }\n break;\n case 3 :\n dbg.enterAlt(3);\n\n // Java.g:668:9: 'default' ':'\n {\n dbg.location(668,9);\n match(input,74,FOLLOW_74_in_switchLabel3826); if (state.failed) return ;\n dbg.location(668,19);\n match(input,75,FOLLOW_75_in_switchLabel3828); if (state.failed) return ;\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n if ( state.backtracking>0 ) { memoize(input, 96, switchLabel_StartIndex); }\n }\n dbg.location(669, 5);\n\n }\n finally {\n dbg.exitRule(getGrammarFileName(), \"switchLabel\");\n decRuleLevel();\n if ( getRuleLevel()==0 ) {dbg.terminate();}\n }\n\n return ;\n }",
"public String getRoomName() {\n switch (description) {\n case \"You are standing outside Hogwarts School of Witchcraft and\\n\"\n + \"Wizardry, near the Whomping Willow. You are searching\\n\"\n + \"for the hidden Galleons that may perhaps be in the cave that\\n\"\n + \"opens straight below you (outside).\":\n return \"outside\";\n \n case \"Too bad this cave is not on the Marauder's Map. You shout\\n\"\n + \"'Lumos' to ignite your wand, and you see there is a narrow,\\n\"\n + \" dark passage to the east (r1).\":\n return \"r1\";\n \n case \"You are in a gloomy oval shaped room with grey walls.\\n\"\n + \" \\\"Enemies of the heir, beware\\\" is written on the wall.\\n\"\n + \"There is a dim light to the west, and a narrow\\n\"\n + \"dark hole to the east only about 18 inches high (r2).\":\n return \"r2\";\n \n case \"You really need your wand here. \\n\"\n + \"There is a wide passage that quickly narrows\\n\"\n + \"to the west, a bright opening to the east,\\n\"\n + \"and a deep hole that appears to have no bottom\\n\"\n + \"in the middle of the room (r3).\":\n return \"r3\";\n \n case \"There is what looks like a giant snake skin\\n\"\n + \"in the corner. Perhaps from the Basilisk? A passage leads to\\n\"\n + \" the west, another one to the north, and a slippery route\\n\"\n + \"goes down steeply. You can hear the shrieks of mandrakes (r4).\":\n return \"r4\";\n \n case \"There is a dim light from above and the shrieks\\n\"\n + \"are clearly coming from a passageway to the east (r5).\":\n return \"r5\";\n \n case \"The ceiling is full of pixies.\\n\"\n + \"Make sure to cover your head (r6)!\":\n return \"r6\";\n \n case \"This room is very damp. There are puddles on the floor\\n\"\n + \"and a steady dripping from above. Let's hope Moaning\\n\"\n + \"Myrtle didn't flood the girls' lavatory(r7).\":\n return \"r7\";\n \n case \"Ron's rat, Scabbers runs across your foot, and woah! Here \"\n + \"comes Crookshanks chasing behind. A narrow passage runs\\n\"\n + \"to the east and an even narrower one runs to the west (r8).\":\n return \"r8\";\n \n case \"Water drips from the ceiling as you cover your head.\\n \"\n + \"There is no exit from this room with only the option to turn back east.\\n\"\n + \"Will you decide to enter the chamber again? (r9)\":\n return \"r9\";\n \n case \"It appears that someone has been here. The harp is\\n\"\n + \"playing to put Fluffy, the three-headed dog asleep.\\n\"\n + \"Oh wait! It looks like Fluffy is gaurding something.\\n\"\n + \"There's a trap door on the floor, but it is locked.\\n\"\n + \"'Alohomora' won't help you here, you need a key (r10).\":\n return \"r10\";\n \n case \"This room is very dark. You can just barely see (r11).\":\n return \"r11\";\n \n default:\n return \"your hands\";\n } \n }",
"static int type_of_jm(String passed){\n\t\treturn 1;\n\t}",
"private final String m43294b(String str) {\n return str != null ? str : ManagerWebServices.PARAM_TEXT;\n }",
"public String nombreReporte (String sidx, boolean dia_actual) {\n int idx = Integer.parseInt(sidx);\n switch (idx) {\n case 1: \n if (dia_actual) { return \"reporte_PuntosControl_GPS:REPORTE DE PUNTOS DE CONTROL\"; }\n else { return \"reporte_PuntosControl:REPORTE DE PUNTOS DE CONTROL\"; }\n case 2: return \"reporte_ProduccionXVehiculo:REPORTE DE PRODUCCIÓN POR VEHÍCULO\";\n case 3: return \"reporte_RutaXVehiculoDph:REPORTE DE RUTA POR VEHÍCULO\";\n case 4: return \"reporte_AlarmasXVehiculo:REPORTE DE ALARMAS POR VEHÍCULO\";\n case 5: return \"reporte_NivelOcupacion:REPORTE NIVEL OCUPACIÓN\";\n case 6: return \"reporte_Perimetro:REPORTE CONTEOS EN PERÍMETRO POR VEHÍCULO\";\n case 7: return \"reporte_ConsolidadoEmpresa:REPORTE CONSOLIDADO POR EMPRESA\";\n case 8: return \"reporte_ComparacionProduccionRuta: REPORTE COMPARATIVO DE PRODUCCIÓN POR RUTA\"; \n case 9: return \"reporte_ProduccionXRuta:REPORTE DE PRODUCCIÓN POR RUTA\";\n case 11: return \"reporte_VehiculosXRutaDph:REPORTE DE VEHÍCULOS POR RUTA\";\n case 12: return \"reporte_VehiculosXAlarma:REPORTE DE VEHÍCULOS POR ALARMA\";\n case 13: return \"reporte_Estadisticas:REPORTE ESTADÍSTICO\";\n case 14: return \"reporte_DescripcionRuta:REPORTE DESCRIPCIÓN RUTA\"; \n case 15: return \"reporte_Gerencia2:REPORTE GERENCIA\";\n case 16: return \"\";\n case 17: return \"reporte_Propietario:REPORTE PROPIETARIO\";\n case 18: return \"reporte_GerenciaXVehiculo:REPORTE GERENCIA POR VEHICULO\";\n case 19: return \"reporte_ConsolidadoLiquidacion:REPORTE CONSOLIDADO DE LIQUIDACIÓN\";\n case 20: return \"reporte_ConsolidadoVehiculosNoLiquidados:RESUMEN DE VEHÍCULOS NO LIQUIDADOS\"; \n case 21: return \"reporte_LiquidacionXLiquidador:REPORTE LIQUIDACIÓN POR LIQUIDADOR\";\n case 22: return \"reporte_IndicePasajerosXKilometro:REPORTE ÍNDICE PASAJEROS POR KILÓMETRO\";\n case 23: return \"reporte_ConsolidadoRutas:CONSOLIDADO DE RUTAS\";\n case 24: return \"reporte_CumplimientoRutaXVehiculo:CUMPLIMIENTO DE RUTA POR VEHÍCULO\";\n case 25: return \"reporte_CumplimientoRutaXConductor:CUMPLIMIENTO DE RUTA POR CONDUCTOR\";\n case 26: return \"reporte_ConsolidadoDespachoFmt:REPORTE CONSOLIDADO DESPACHO\";\n case 27: case 28: \n case 29: return \"reporte_IncumplimientoPuntoXRuta:REPORTE INCUMPLIMIENTO PUNTOS POR RUTA\";\n case 30: return \"reporte_calificacionConductor:REPORTE CALIFICACION DE CONDUCTOR\";\n case 35: return \"reporte_CategoriasDescuentaPasajeros:REPORTE CATEGORIAS POR PASAJEROS\";\n case 31: return \"reporte_ProductividadPorHora:REPORTE CONSOLIDADO PRODUCTIVIDAD POR HORA\";\n default: return null;\n }\n }",
"static int type_of_cpe(String passed){\n\t\treturn 1;\n\t}",
"static int type_of_sub(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}",
"static int type_of_rc(String passed){\n\t\treturn 1;\n\t}",
"static int type_of_out(String passed){\n\t\treturn 1;\n\t}",
"public static void main(String[] args) {\n String b = new Boolean(\"TRue\").toString();\n switch (b) {\n// case true: /* compilation error switch dont accept boolean */\n// System.out.println(\"1ONE\");\n// case false:/* compilation error switch dont accept boolean */\n// System.out.println(\"2TWO\");\n default:\n System.out.println(\"3THREE\");\n }\n }",
"private static ContextLabel stringToContextLabel(String s)\n {\n \tfor (ContextLabel enumVal : ContextLabel.values())\n \t{\n \t\tif (enumVal.toString().equals(s))\n \t\t\treturn enumVal;\n \t}\n \t\n \t// in case of failure\n \treturn ContextLabel.UNKNOWN;\n }",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\r\n System.out.print(\"Where are you from? \");\r\n String country = sc.next().toLowerCase();\r\n\r\n // Test the variable against the cases\r\n switch(country)\r\n {\r\n case \"ireland\": System.out.println(\"So you are Irish\"); break;\r\n case \"france\": System.out.println(\"So you are French\"); break;\r\n case \"brazil\": System.out.println(\"So you are Brazilian\"); break;\r\n default: System.out.println(\"Unknown\"); break;\r\n }\r\n }",
"void mo12635a(String str);",
"public abstract boolean mo70720c(String str);",
"static int type_of_jpo(String passed){\n\t\treturn 1;\n\t}",
"private static int switchLanguage(int chineseVersion, int englishVersion)\n {\n if (sIsChinese)\n {\n return chineseVersion;\n }\n else\n {\n return englishVersion;\n }\n }",
"static int type_of_in(String passed){\n\t\treturn 1;\n\t}",
"private String getOptionStrings(int choice) {\n //these are the common ones, maybe the only ones\n switch (choice) {\n case 0: return \"\";\n case 1: return \"Shoot Laser gun.\";\n case 2: return \"Shoot Missile gun.\";\n case 3: return \"Wait a turn\";\n\n case 4: return \"Shoot at Pilot, Gun L, or Gun M?\";\n case 5: return \"Shoot at Shield, or Engine?\";\n case 6: return \"Shoot at random?\";\n\n case 7: return \"Shoot at Pilot?\";\n case 8: return \"Shoot at Gun L?\";\n case 9: return \"Shoot at Gun M?\";\n\n case 10: return \"Shoot at Shield?\";\n case 11: return \"Shoot at Engine?\";\n case 12: return \"Shoot at Random?\";\n\n case 100: return \"Enter any number to continue\";\n }\n //if value given is not found above\n return \"Error\";\n }",
"private void strin() {\n\n\t}",
"@Override\r\n\tprotected T doSwitch(int classifierID, EObject theEObject) {\r\n switch (classifierID)\r\n {\r\n case OclPackage.OCL_EXPRESSION_CS:\r\n {\r\n OclExpressionCS oclExpressionCS = (OclExpressionCS)theEObject;\r\n T result = caseOclExpressionCS(oclExpressionCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.BRACKET_EXP_CS:\r\n {\r\n BracketExpCS bracketExpCS = (BracketExpCS)theEObject;\r\n T result = caseBracketExpCS(bracketExpCS);\r\n if (result == null) result = caseOclExpressionCS(bracketExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.NAMED_LITERAL_EXP_CS:\r\n {\r\n NamedLiteralExpCS namedLiteralExpCS = (NamedLiteralExpCS)theEObject;\r\n T result = caseNamedLiteralExpCS(namedLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(namedLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PATH_NAME_CS:\r\n {\r\n PathNameCS pathNameCS = (PathNameCS)theEObject;\r\n T result = casePathNameCS(pathNameCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.SIMPLE_NAME_CS:\r\n {\r\n SimpleNameCS simpleNameCS = (SimpleNameCS)theEObject;\r\n T result = caseSimpleNameCS(simpleNameCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.TYPE_CS:\r\n {\r\n TypeCS typeCS = (TypeCS)theEObject;\r\n T result = caseTypeCS(typeCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.TYPE_PATH_NAME_CS:\r\n {\r\n TypePathNameCS typePathNameCS = (TypePathNameCS)theEObject;\r\n T result = caseTypePathNameCS(typePathNameCS);\r\n if (result == null) result = caseTypeCS(typePathNameCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.TYPE_PATH_NAME_SIMPLE_CS:\r\n {\r\n TypePathNameSimpleCS typePathNameSimpleCS = (TypePathNameSimpleCS)theEObject;\r\n T result = caseTypePathNameSimpleCS(typePathNameSimpleCS);\r\n if (result == null) result = caseTypePathNameCS(typePathNameSimpleCS);\r\n if (result == null) result = caseTypeCS(typePathNameSimpleCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.TYPE_PATH_NAME_NESTED_CS:\r\n {\r\n TypePathNameNestedCS typePathNameNestedCS = (TypePathNameNestedCS)theEObject;\r\n T result = caseTypePathNameNestedCS(typePathNameNestedCS);\r\n if (result == null) result = caseTypePathNameCS(typePathNameNestedCS);\r\n if (result == null) result = caseTypeCS(typePathNameNestedCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.TUPLE_TYPE_CS:\r\n {\r\n TupleTypeCS tupleTypeCS = (TupleTypeCS)theEObject;\r\n T result = caseTupleTypeCS(tupleTypeCS);\r\n if (result == null) result = caseTypeCS(tupleTypeCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.COLLECTION_TYPE_LITERAL_EXP_CS:\r\n {\r\n CollectionTypeLiteralExpCS collectionTypeLiteralExpCS = (CollectionTypeLiteralExpCS)theEObject;\r\n T result = caseCollectionTypeLiteralExpCS(collectionTypeLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(collectionTypeLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(collectionTypeLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.TUPLE_TYPE_LITERAL_EXP_CS:\r\n {\r\n TupleTypeLiteralExpCS tupleTypeLiteralExpCS = (TupleTypeLiteralExpCS)theEObject;\r\n T result = caseTupleTypeLiteralExpCS(tupleTypeLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(tupleTypeLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(tupleTypeLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.VARIABLE_DECLARATION_CS:\r\n {\r\n VariableDeclarationCS variableDeclarationCS = (VariableDeclarationCS)theEObject;\r\n T result = caseVariableDeclarationCS(variableDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.VARIABLE_DECLARATION_WITH_INIT_CS:\r\n {\r\n VariableDeclarationWithInitCS variableDeclarationWithInitCS = (VariableDeclarationWithInitCS)theEObject;\r\n T result = caseVariableDeclarationWithInitCS(variableDeclarationWithInitCS);\r\n if (result == null) result = caseVariableDeclarationCS(variableDeclarationWithInitCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.VARIABLE_DECLARATION_WITHOUT_INIT_CS:\r\n {\r\n VariableDeclarationWithoutInitCS variableDeclarationWithoutInitCS = (VariableDeclarationWithoutInitCS)theEObject;\r\n T result = caseVariableDeclarationWithoutInitCS(variableDeclarationWithoutInitCS);\r\n if (result == null) result = caseVariableDeclarationCS(variableDeclarationWithoutInitCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.VARIABLE_DECLARATION_WITH_INIT_LIST_CS:\r\n {\r\n VariableDeclarationWithInitListCS variableDeclarationWithInitListCS = (VariableDeclarationWithInitListCS)theEObject;\r\n T result = caseVariableDeclarationWithInitListCS(variableDeclarationWithInitListCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.VARIABLE_DECLARATION_WITHOUT_INIT_LIST_CS:\r\n {\r\n VariableDeclarationWithoutInitListCS variableDeclarationWithoutInitListCS = (VariableDeclarationWithoutInitListCS)theEObject;\r\n T result = caseVariableDeclarationWithoutInitListCS(variableDeclarationWithoutInitListCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.LITERAL_EXP_CS:\r\n {\r\n LiteralExpCS literalExpCS = (LiteralExpCS)theEObject;\r\n T result = caseLiteralExpCS(literalExpCS);\r\n if (result == null) result = caseOclExpressionCS(literalExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.ENUM_LITERAL_OR_STATIC_PROPERTY_EXP_CS:\r\n {\r\n EnumLiteralOrStaticPropertyExpCS enumLiteralOrStaticPropertyExpCS = (EnumLiteralOrStaticPropertyExpCS)theEObject;\r\n T result = caseEnumLiteralOrStaticPropertyExpCS(enumLiteralOrStaticPropertyExpCS);\r\n if (result == null) result = caseLiteralExpCS(enumLiteralOrStaticPropertyExpCS);\r\n if (result == null) result = caseOclExpressionCS(enumLiteralOrStaticPropertyExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.COLLECTION_LITERAL_EXP_CS:\r\n {\r\n CollectionLiteralExpCS collectionLiteralExpCS = (CollectionLiteralExpCS)theEObject;\r\n T result = caseCollectionLiteralExpCS(collectionLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(collectionLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(collectionLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.COLLECTION_TYPE_IDENTIFIER_CS:\r\n {\r\n CollectionTypeIdentifierCS collectionTypeIdentifierCS = (CollectionTypeIdentifierCS)theEObject;\r\n T result = caseCollectionTypeIdentifierCS(collectionTypeIdentifierCS);\r\n if (result == null) result = caseTypeCS(collectionTypeIdentifierCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.COLLECTION_LITERAL_PARTS_CS:\r\n {\r\n CollectionLiteralPartsCS collectionLiteralPartsCS = (CollectionLiteralPartsCS)theEObject;\r\n T result = caseCollectionLiteralPartsCS(collectionLiteralPartsCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.COLLECTION_LITERAL_PARTS_OCL_EXP_CS:\r\n {\r\n CollectionLiteralPartsOclExpCS collectionLiteralPartsOclExpCS = (CollectionLiteralPartsOclExpCS)theEObject;\r\n T result = caseCollectionLiteralPartsOclExpCS(collectionLiteralPartsOclExpCS);\r\n if (result == null) result = caseCollectionLiteralPartsCS(collectionLiteralPartsOclExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.COLLECTION_RANGE_CS:\r\n {\r\n CollectionRangeCS collectionRangeCS = (CollectionRangeCS)theEObject;\r\n T result = caseCollectionRangeCS(collectionRangeCS);\r\n if (result == null) result = caseCollectionLiteralPartsCS(collectionRangeCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.CALL_EXP_CS:\r\n {\r\n CallExpCS callExpCS = (CallExpCS)theEObject;\r\n T result = caseCallExpCS(callExpCS);\r\n if (result == null) result = caseOclExpressionCS(callExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.LOOP_EXP_CS:\r\n {\r\n LoopExpCS loopExpCS = (LoopExpCS)theEObject;\r\n T result = caseLoopExpCS(loopExpCS);\r\n if (result == null) result = caseCallExpCS(loopExpCS);\r\n if (result == null) result = caseOclExpressionCS(loopExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.ITERATOR_EXP_VARIABLE_CS:\r\n {\r\n IteratorExpVariableCS iteratorExpVariableCS = (IteratorExpVariableCS)theEObject;\r\n T result = caseIteratorExpVariableCS(iteratorExpVariableCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.ITERATOR_EXP_CS:\r\n {\r\n IteratorExpCS iteratorExpCS = (IteratorExpCS)theEObject;\r\n T result = caseIteratorExpCS(iteratorExpCS);\r\n if (result == null) result = caseLoopExpCS(iteratorExpCS);\r\n if (result == null) result = caseImplicitFeatureCallCS(iteratorExpCS);\r\n if (result == null) result = caseCallExpCS(iteratorExpCS);\r\n if (result == null) result = caseOclExpressionCS(iteratorExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.ITERATE_EXP_CS:\r\n {\r\n IterateExpCS iterateExpCS = (IterateExpCS)theEObject;\r\n T result = caseIterateExpCS(iterateExpCS);\r\n if (result == null) result = caseLoopExpCS(iterateExpCS);\r\n if (result == null) result = caseImplicitFeatureCallCS(iterateExpCS);\r\n if (result == null) result = caseCallExpCS(iterateExpCS);\r\n if (result == null) result = caseOclExpressionCS(iterateExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.FEATURE_CALL_EXP_CS:\r\n {\r\n FeatureCallExpCS featureCallExpCS = (FeatureCallExpCS)theEObject;\r\n T result = caseFeatureCallExpCS(featureCallExpCS);\r\n if (result == null) result = caseCallExpCS(featureCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(featureCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.NAVIGATION_CALL_EXP:\r\n {\r\n NavigationCallExp navigationCallExp = (NavigationCallExp)theEObject;\r\n T result = caseNavigationCallExp(navigationCallExp);\r\n if (result == null) result = caseFeatureCallExpCS(navigationCallExp);\r\n if (result == null) result = caseCallExpCS(navigationCallExp);\r\n if (result == null) result = caseOclExpressionCS(navigationCallExp);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_CALL_BASE_EXP_CS:\r\n {\r\n OperationCallBaseExpCS operationCallBaseExpCS = (OperationCallBaseExpCS)theEObject;\r\n T result = caseOperationCallBaseExpCS(operationCallBaseExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PROPERTY_CALL_BASE_EXP_CS:\r\n {\r\n PropertyCallBaseExpCS propertyCallBaseExpCS = (PropertyCallBaseExpCS)theEObject;\r\n T result = casePropertyCallBaseExpCS(propertyCallBaseExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.IMPLICIT_FEATURE_CALL_CS:\r\n {\r\n ImplicitFeatureCallCS implicitFeatureCallCS = (ImplicitFeatureCallCS)theEObject;\r\n T result = caseImplicitFeatureCallCS(implicitFeatureCallCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.IMPLICIT_PROPERTY_CALL_CS:\r\n {\r\n ImplicitPropertyCallCS implicitPropertyCallCS = (ImplicitPropertyCallCS)theEObject;\r\n T result = caseImplicitPropertyCallCS(implicitPropertyCallCS);\r\n if (result == null) result = caseImplicitFeatureCallCS(implicitPropertyCallCS);\r\n if (result == null) result = casePropertyCallBaseExpCS(implicitPropertyCallCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.IMPLICIT_OPERATION_CALL_CS:\r\n {\r\n ImplicitOperationCallCS implicitOperationCallCS = (ImplicitOperationCallCS)theEObject;\r\n T result = caseImplicitOperationCallCS(implicitOperationCallCS);\r\n if (result == null) result = caseImplicitFeatureCallCS(implicitOperationCallCS);\r\n if (result == null) result = caseOperationCallBaseExpCS(implicitOperationCallCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PROPERTY_CALL_EXP_CS:\r\n {\r\n PropertyCallExpCS propertyCallExpCS = (PropertyCallExpCS)theEObject;\r\n T result = casePropertyCallExpCS(propertyCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(propertyCallExpCS);\r\n if (result == null) result = caseCallExpCS(propertyCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(propertyCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PROPERTY_CALL_ON_SELF_EXP_CS:\r\n {\r\n PropertyCallOnSelfExpCS propertyCallOnSelfExpCS = (PropertyCallOnSelfExpCS)theEObject;\r\n T result = casePropertyCallOnSelfExpCS(propertyCallOnSelfExpCS);\r\n if (result == null) result = casePropertyCallExpCS(propertyCallOnSelfExpCS);\r\n if (result == null) result = casePropertyCallBaseExpCS(propertyCallOnSelfExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(propertyCallOnSelfExpCS);\r\n if (result == null) result = caseCallExpCS(propertyCallOnSelfExpCS);\r\n if (result == null) result = caseOclExpressionCS(propertyCallOnSelfExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PROPERTY_CALL_EXPLICIT_PATH_EXP_CS:\r\n {\r\n PropertyCallExplicitPathExpCS propertyCallExplicitPathExpCS = (PropertyCallExplicitPathExpCS)theEObject;\r\n T result = casePropertyCallExplicitPathExpCS(propertyCallExplicitPathExpCS);\r\n if (result == null) result = casePropertyCallExpCS(propertyCallExplicitPathExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(propertyCallExplicitPathExpCS);\r\n if (result == null) result = caseCallExpCS(propertyCallExplicitPathExpCS);\r\n if (result == null) result = caseOclExpressionCS(propertyCallExplicitPathExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_CALL_EXP_CS:\r\n {\r\n OperationCallExpCS operationCallExpCS = (OperationCallExpCS)theEObject;\r\n T result = caseOperationCallExpCS(operationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(operationCallExpCS);\r\n if (result == null) result = caseCallExpCS(operationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(operationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_CALL_ON_SELF_EXP_CS:\r\n {\r\n OperationCallOnSelfExpCS operationCallOnSelfExpCS = (OperationCallOnSelfExpCS)theEObject;\r\n T result = caseOperationCallOnSelfExpCS(operationCallOnSelfExpCS);\r\n if (result == null) result = caseOperationCallExpCS(operationCallOnSelfExpCS);\r\n if (result == null) result = caseOperationCallBaseExpCS(operationCallOnSelfExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(operationCallOnSelfExpCS);\r\n if (result == null) result = caseCallExpCS(operationCallOnSelfExpCS);\r\n if (result == null) result = caseOclExpressionCS(operationCallOnSelfExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.STATIC_OPERATION_CALL_EXP_CS:\r\n {\r\n StaticOperationCallExpCS staticOperationCallExpCS = (StaticOperationCallExpCS)theEObject;\r\n T result = caseStaticOperationCallExpCS(staticOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(staticOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(staticOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(staticOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(staticOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.UNARY_OPERATION_CALL_EXP_CS:\r\n {\r\n UnaryOperationCallExpCS unaryOperationCallExpCS = (UnaryOperationCallExpCS)theEObject;\r\n T result = caseUnaryOperationCallExpCS(unaryOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(unaryOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(unaryOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(unaryOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(unaryOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.LOGICAL_NOT_OPERATION_CALL_EXP_CS:\r\n {\r\n LogicalNotOperationCallExpCS logicalNotOperationCallExpCS = (LogicalNotOperationCallExpCS)theEObject;\r\n T result = caseLogicalNotOperationCallExpCS(logicalNotOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(logicalNotOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(logicalNotOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(logicalNotOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(logicalNotOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_CALL_WITH_SOURCE_EXP_CS:\r\n {\r\n OperationCallWithSourceExpCS operationCallWithSourceExpCS = (OperationCallWithSourceExpCS)theEObject;\r\n T result = caseOperationCallWithSourceExpCS(operationCallWithSourceExpCS);\r\n if (result == null) result = caseOperationCallExpCS(operationCallWithSourceExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(operationCallWithSourceExpCS);\r\n if (result == null) result = caseCallExpCS(operationCallWithSourceExpCS);\r\n if (result == null) result = caseOclExpressionCS(operationCallWithSourceExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_CALL_BINARY_EXP_CS:\r\n {\r\n OperationCallBinaryExpCS operationCallBinaryExpCS = (OperationCallBinaryExpCS)theEObject;\r\n T result = caseOperationCallBinaryExpCS(operationCallBinaryExpCS);\r\n if (result == null) result = caseOperationCallWithSourceExpCS(operationCallBinaryExpCS);\r\n if (result == null) result = caseOperationCallExpCS(operationCallBinaryExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(operationCallBinaryExpCS);\r\n if (result == null) result = caseCallExpCS(operationCallBinaryExpCS);\r\n if (result == null) result = caseOclExpressionCS(operationCallBinaryExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.ADDITIVE_OPERATION_CALL_EXP_CS:\r\n {\r\n AdditiveOperationCallExpCS additiveOperationCallExpCS = (AdditiveOperationCallExpCS)theEObject;\r\n T result = caseAdditiveOperationCallExpCS(additiveOperationCallExpCS);\r\n if (result == null) result = caseOperationCallBinaryExpCS(additiveOperationCallExpCS);\r\n if (result == null) result = caseOperationCallWithSourceExpCS(additiveOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(additiveOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(additiveOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(additiveOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(additiveOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.MULT_OPERATION_CALL_EXP_CS:\r\n {\r\n MultOperationCallExpCS multOperationCallExpCS = (MultOperationCallExpCS)theEObject;\r\n T result = caseMultOperationCallExpCS(multOperationCallExpCS);\r\n if (result == null) result = caseOperationCallBinaryExpCS(multOperationCallExpCS);\r\n if (result == null) result = caseOperationCallWithSourceExpCS(multOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(multOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(multOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(multOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(multOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.RELATIONAL_OPERATION_CALL_EXP_CS:\r\n {\r\n RelationalOperationCallExpCS relationalOperationCallExpCS = (RelationalOperationCallExpCS)theEObject;\r\n T result = caseRelationalOperationCallExpCS(relationalOperationCallExpCS);\r\n if (result == null) result = caseOperationCallBinaryExpCS(relationalOperationCallExpCS);\r\n if (result == null) result = caseOperationCallWithSourceExpCS(relationalOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(relationalOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(relationalOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(relationalOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(relationalOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.EQUALITY_OPERATION_CALL_EXP_CS:\r\n {\r\n EqualityOperationCallExpCS equalityOperationCallExpCS = (EqualityOperationCallExpCS)theEObject;\r\n T result = caseEqualityOperationCallExpCS(equalityOperationCallExpCS);\r\n if (result == null) result = caseOperationCallBinaryExpCS(equalityOperationCallExpCS);\r\n if (result == null) result = caseOperationCallWithSourceExpCS(equalityOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(equalityOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(equalityOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(equalityOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(equalityOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.LOGICAL_AND_OPERATION_CALL_EXP_CS:\r\n {\r\n LogicalAndOperationCallExpCS logicalAndOperationCallExpCS = (LogicalAndOperationCallExpCS)theEObject;\r\n T result = caseLogicalAndOperationCallExpCS(logicalAndOperationCallExpCS);\r\n if (result == null) result = caseOperationCallBinaryExpCS(logicalAndOperationCallExpCS);\r\n if (result == null) result = caseOperationCallWithSourceExpCS(logicalAndOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(logicalAndOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(logicalAndOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(logicalAndOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(logicalAndOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.LOGICAL_OR_OPERATION_CALL_EXP_CS:\r\n {\r\n LogicalOrOperationCallExpCS logicalOrOperationCallExpCS = (LogicalOrOperationCallExpCS)theEObject;\r\n T result = caseLogicalOrOperationCallExpCS(logicalOrOperationCallExpCS);\r\n if (result == null) result = caseOperationCallBinaryExpCS(logicalOrOperationCallExpCS);\r\n if (result == null) result = caseOperationCallWithSourceExpCS(logicalOrOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(logicalOrOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(logicalOrOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(logicalOrOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(logicalOrOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.LOGICAL_XOR_OPERATION_CALL_EXP_CS:\r\n {\r\n LogicalXorOperationCallExpCS logicalXorOperationCallExpCS = (LogicalXorOperationCallExpCS)theEObject;\r\n T result = caseLogicalXorOperationCallExpCS(logicalXorOperationCallExpCS);\r\n if (result == null) result = caseOperationCallBinaryExpCS(logicalXorOperationCallExpCS);\r\n if (result == null) result = caseOperationCallWithSourceExpCS(logicalXorOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(logicalXorOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(logicalXorOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(logicalXorOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(logicalXorOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.LOGICAL_IMPLIES_OPERATION_CALL_EXP_CS:\r\n {\r\n LogicalImpliesOperationCallExpCS logicalImpliesOperationCallExpCS = (LogicalImpliesOperationCallExpCS)theEObject;\r\n T result = caseLogicalImpliesOperationCallExpCS(logicalImpliesOperationCallExpCS);\r\n if (result == null) result = caseOperationCallBinaryExpCS(logicalImpliesOperationCallExpCS);\r\n if (result == null) result = caseOperationCallWithSourceExpCS(logicalImpliesOperationCallExpCS);\r\n if (result == null) result = caseOperationCallExpCS(logicalImpliesOperationCallExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(logicalImpliesOperationCallExpCS);\r\n if (result == null) result = caseCallExpCS(logicalImpliesOperationCallExpCS);\r\n if (result == null) result = caseOclExpressionCS(logicalImpliesOperationCallExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_CALL_WITH_IMLICIT_SOURCE_EXP_CS:\r\n {\r\n OperationCallWithImlicitSourceExpCS operationCallWithImlicitSourceExpCS = (OperationCallWithImlicitSourceExpCS)theEObject;\r\n T result = caseOperationCallWithImlicitSourceExpCS(operationCallWithImlicitSourceExpCS);\r\n if (result == null) result = caseOperationCallOnSelfExpCS(operationCallWithImlicitSourceExpCS);\r\n if (result == null) result = caseOperationCallExpCS(operationCallWithImlicitSourceExpCS);\r\n if (result == null) result = caseOperationCallBaseExpCS(operationCallWithImlicitSourceExpCS);\r\n if (result == null) result = caseFeatureCallExpCS(operationCallWithImlicitSourceExpCS);\r\n if (result == null) result = caseCallExpCS(operationCallWithImlicitSourceExpCS);\r\n if (result == null) result = caseOclExpressionCS(operationCallWithImlicitSourceExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.TUPLE_LITERAL_EXP_CS:\r\n {\r\n TupleLiteralExpCS tupleLiteralExpCS = (TupleLiteralExpCS)theEObject;\r\n T result = caseTupleLiteralExpCS(tupleLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(tupleLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(tupleLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PRIMITIVE_LITERAL_EXP_CS:\r\n {\r\n PrimitiveLiteralExpCS primitiveLiteralExpCS = (PrimitiveLiteralExpCS)theEObject;\r\n T result = casePrimitiveLiteralExpCS(primitiveLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(primitiveLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(primitiveLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.INTEGER_LITERAL_EXP_CS:\r\n {\r\n IntegerLiteralExpCS integerLiteralExpCS = (IntegerLiteralExpCS)theEObject;\r\n T result = caseIntegerLiteralExpCS(integerLiteralExpCS);\r\n if (result == null) result = casePrimitiveLiteralExpCS(integerLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(integerLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(integerLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.REAL_LITERAL_EXP_CS:\r\n {\r\n RealLiteralExpCS realLiteralExpCS = (RealLiteralExpCS)theEObject;\r\n T result = caseRealLiteralExpCS(realLiteralExpCS);\r\n if (result == null) result = casePrimitiveLiteralExpCS(realLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(realLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(realLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.BOOLEAN_LITERAL_EXP_CS:\r\n {\r\n BooleanLiteralExpCS booleanLiteralExpCS = (BooleanLiteralExpCS)theEObject;\r\n T result = caseBooleanLiteralExpCS(booleanLiteralExpCS);\r\n if (result == null) result = casePrimitiveLiteralExpCS(booleanLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(booleanLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(booleanLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.STRING_LITERAL_EXP_CS:\r\n {\r\n StringLiteralExpCS stringLiteralExpCS = (StringLiteralExpCS)theEObject;\r\n T result = caseStringLiteralExpCS(stringLiteralExpCS);\r\n if (result == null) result = casePrimitiveLiteralExpCS(stringLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(stringLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(stringLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.INVALID_LITERAL_EXP_CS:\r\n {\r\n InvalidLiteralExpCS invalidLiteralExpCS = (InvalidLiteralExpCS)theEObject;\r\n T result = caseInvalidLiteralExpCS(invalidLiteralExpCS);\r\n if (result == null) result = casePrimitiveLiteralExpCS(invalidLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(invalidLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(invalidLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.NULL_LITERAL_EXP_CS:\r\n {\r\n NullLiteralExpCS nullLiteralExpCS = (NullLiteralExpCS)theEObject;\r\n T result = caseNullLiteralExpCS(nullLiteralExpCS);\r\n if (result == null) result = casePrimitiveLiteralExpCS(nullLiteralExpCS);\r\n if (result == null) result = caseLiteralExpCS(nullLiteralExpCS);\r\n if (result == null) result = caseOclExpressionCS(nullLiteralExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.LET_EXP_CS:\r\n {\r\n LetExpCS letExpCS = (LetExpCS)theEObject;\r\n T result = caseLetExpCS(letExpCS);\r\n if (result == null) result = caseOclExpressionCS(letExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.IF_EXP_CS:\r\n {\r\n IfExpCS ifExpCS = (IfExpCS)theEObject;\r\n T result = caseIfExpCS(ifExpCS);\r\n if (result == null) result = caseOclExpressionCS(ifExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PACKAGE_DECLARATION_CS:\r\n {\r\n PackageDeclarationCS packageDeclarationCS = (PackageDeclarationCS)theEObject;\r\n T result = casePackageDeclarationCS(packageDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PACKAGE_DECLARATION_WITH_NAMESPACE_CS:\r\n {\r\n PackageDeclarationWithNamespaceCS packageDeclarationWithNamespaceCS = (PackageDeclarationWithNamespaceCS)theEObject;\r\n T result = casePackageDeclarationWithNamespaceCS(packageDeclarationWithNamespaceCS);\r\n if (result == null) result = casePackageDeclarationCS(packageDeclarationWithNamespaceCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PACKAGE_DECLARATION_NESTED_NAMESPACE_CS:\r\n {\r\n PackageDeclarationNestedNamespaceCS packageDeclarationNestedNamespaceCS = (PackageDeclarationNestedNamespaceCS)theEObject;\r\n T result = casePackageDeclarationNestedNamespaceCS(packageDeclarationNestedNamespaceCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PACKAGE_DECLARATION_WITHOUT_NAMESPACE_CS:\r\n {\r\n PackageDeclarationWithoutNamespaceCS packageDeclarationWithoutNamespaceCS = (PackageDeclarationWithoutNamespaceCS)theEObject;\r\n T result = casePackageDeclarationWithoutNamespaceCS(packageDeclarationWithoutNamespaceCS);\r\n if (result == null) result = casePackageDeclarationCS(packageDeclarationWithoutNamespaceCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.CONTEXT_DECLARATION_CS:\r\n {\r\n ContextDeclarationCS contextDeclarationCS = (ContextDeclarationCS)theEObject;\r\n T result = caseContextDeclarationCS(contextDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.ATTRIBUTE_CONTEXT_DECLARATION_CS:\r\n {\r\n AttributeContextDeclarationCS attributeContextDeclarationCS = (AttributeContextDeclarationCS)theEObject;\r\n T result = caseAttributeContextDeclarationCS(attributeContextDeclarationCS);\r\n if (result == null) result = caseContextDeclarationCS(attributeContextDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.CLASSIFIER_CONTEXT_DECLARATION_CS:\r\n {\r\n ClassifierContextDeclarationCS classifierContextDeclarationCS = (ClassifierContextDeclarationCS)theEObject;\r\n T result = caseClassifierContextDeclarationCS(classifierContextDeclarationCS);\r\n if (result == null) result = caseContextDeclarationCS(classifierContextDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_CONTEXT_DECLARATION_CS:\r\n {\r\n OperationContextDeclarationCS operationContextDeclarationCS = (OperationContextDeclarationCS)theEObject;\r\n T result = caseOperationContextDeclarationCS(operationContextDeclarationCS);\r\n if (result == null) result = caseContextDeclarationCS(operationContextDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.INIT_OR_DERIVE_VALUE_CS:\r\n {\r\n InitOrDeriveValueCS initOrDeriveValueCS = (InitOrDeriveValueCS)theEObject;\r\n T result = caseInitOrDeriveValueCS(initOrDeriveValueCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.INIT_VALUE_CS:\r\n {\r\n InitValueCS initValueCS = (InitValueCS)theEObject;\r\n T result = caseInitValueCS(initValueCS);\r\n if (result == null) result = caseInitOrDeriveValueCS(initValueCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.DERIVE_VALUE_CS:\r\n {\r\n DeriveValueCS deriveValueCS = (DeriveValueCS)theEObject;\r\n T result = caseDeriveValueCS(deriveValueCS);\r\n if (result == null) result = caseInitOrDeriveValueCS(deriveValueCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.INVARIANT_OR_DEFINITION_CS:\r\n {\r\n InvariantOrDefinitionCS invariantOrDefinitionCS = (InvariantOrDefinitionCS)theEObject;\r\n T result = caseInvariantOrDefinitionCS(invariantOrDefinitionCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.INVARIANT_EXP_CS:\r\n {\r\n InvariantExpCS invariantExpCS = (InvariantExpCS)theEObject;\r\n T result = caseInvariantExpCS(invariantExpCS);\r\n if (result == null) result = caseInvariantOrDefinitionCS(invariantExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.DEFINITION_EXP_CS:\r\n {\r\n DefinitionExpCS definitionExpCS = (DefinitionExpCS)theEObject;\r\n T result = caseDefinitionExpCS(definitionExpCS);\r\n if (result == null) result = caseInvariantOrDefinitionCS(definitionExpCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.DEFINITION_EXP_PART_CS:\r\n {\r\n DefinitionExpPartCS definitionExpPartCS = (DefinitionExpPartCS)theEObject;\r\n T result = caseDefinitionExpPartCS(definitionExpPartCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.DEFINITION_EXP_PROPERTY_CS:\r\n {\r\n DefinitionExpPropertyCS definitionExpPropertyCS = (DefinitionExpPropertyCS)theEObject;\r\n T result = caseDefinitionExpPropertyCS(definitionExpPropertyCS);\r\n if (result == null) result = caseDefinitionExpPartCS(definitionExpPropertyCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.DEFINITION_EXP_OPERATION_CS:\r\n {\r\n DefinitionExpOperationCS definitionExpOperationCS = (DefinitionExpOperationCS)theEObject;\r\n T result = caseDefinitionExpOperationCS(definitionExpOperationCS);\r\n if (result == null) result = caseDefinitionExpPartCS(definitionExpOperationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PRE_POST_OR_BODY_DECLARATION_CS:\r\n {\r\n PrePostOrBodyDeclarationCS prePostOrBodyDeclarationCS = (PrePostOrBodyDeclarationCS)theEObject;\r\n T result = casePrePostOrBodyDeclarationCS(prePostOrBodyDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PRE_CONDITION_DECLARATION_CS:\r\n {\r\n PreConditionDeclarationCS preConditionDeclarationCS = (PreConditionDeclarationCS)theEObject;\r\n T result = casePreConditionDeclarationCS(preConditionDeclarationCS);\r\n if (result == null) result = casePrePostOrBodyDeclarationCS(preConditionDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.POST_CONDITION_DECLARATION_CS:\r\n {\r\n PostConditionDeclarationCS postConditionDeclarationCS = (PostConditionDeclarationCS)theEObject;\r\n T result = casePostConditionDeclarationCS(postConditionDeclarationCS);\r\n if (result == null) result = casePrePostOrBodyDeclarationCS(postConditionDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.BODY_DECLARATION_CS:\r\n {\r\n BodyDeclarationCS bodyDeclarationCS = (BodyDeclarationCS)theEObject;\r\n T result = caseBodyDeclarationCS(bodyDeclarationCS);\r\n if (result == null) result = casePrePostOrBodyDeclarationCS(bodyDeclarationCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_DEFINITION_CS:\r\n {\r\n OperationDefinitionCS operationDefinitionCS = (OperationDefinitionCS)theEObject;\r\n T result = caseOperationDefinitionCS(operationDefinitionCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_DEFINITION_IN_CONTEXT_CS:\r\n {\r\n OperationDefinitionInContextCS operationDefinitionInContextCS = (OperationDefinitionInContextCS)theEObject;\r\n T result = caseOperationDefinitionInContextCS(operationDefinitionInContextCS);\r\n if (result == null) result = caseOperationDefinitionCS(operationDefinitionInContextCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.OPERATION_DEFINITION_IN_DEF_CS:\r\n {\r\n OperationDefinitionInDefCS operationDefinitionInDefCS = (OperationDefinitionInDefCS)theEObject;\r\n T result = caseOperationDefinitionInDefCS(operationDefinitionInDefCS);\r\n if (result == null) result = caseOperationDefinitionCS(operationDefinitionInDefCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n case OclPackage.PARAMETER_CS:\r\n {\r\n ParameterCS parameterCS = (ParameterCS)theEObject;\r\n T result = caseParameterCS(parameterCS);\r\n if (result == null) result = defaultCase(theEObject);\r\n return result;\r\n }\r\n default: return defaultCase(theEObject);\r\n }\r\n }",
"void mo88522a(String str);",
"private static java.lang.String a(java.lang.String r5, java.util.Map r6, boolean r7) {\n /*\n r2 = F;\n r3 = new java.lang.StringBuilder;\n r0 = r5.length();\n r3.<init>(r0);\n r0 = 0;\n r1 = r0;\n L_0x000d:\n r0 = r5.length();\n if (r1 >= r0) goto L_0x0035;\n L_0x0013:\n r4 = r5.charAt(r1);\n r0 = java.lang.Character.toUpperCase(r4);\n r0 = java.lang.Character.valueOf(r0);\n r0 = r6.get(r0);\n r0 = (java.lang.Character) r0;\n if (r0 == 0) goto L_0x002c;\n L_0x0027:\n r3.append(r0);\t Catch:{ RuntimeException -> 0x003a }\n if (r2 == 0) goto L_0x0031;\n L_0x002c:\n if (r7 != 0) goto L_0x0031;\n L_0x002e:\n r3.append(r4);\t Catch:{ RuntimeException -> 0x003c }\n L_0x0031:\n r0 = r1 + 1;\n if (r2 == 0) goto L_0x003e;\n L_0x0035:\n r0 = r3.toString();\n return r0;\n L_0x003a:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x003c }\n L_0x003c:\n r0 = move-exception;\n throw r0;\n L_0x003e:\n r1 = r0;\n goto L_0x000d;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.e2.a(java.lang.String, java.util.Map, boolean):java.lang.String\");\n }",
"public abstract boolean mo70717b(String str);",
"static void perform_jp(String passed){\n\t\tint type = type_of_jp(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tjump_when_sign_not(passed);\n\t\t\tbreak;\n\t\t}\n\t}",
"private static String checkType(int i)\n {\n switch (i)\n {\n case 1:\n return \"typeI\";\n case 2:\n return \"typeII\";\n case 3:\n return \"typeIII\";\n case 4:\n return \"typeIV\";\n case 5:\n return \"typeV\";\n default:\n return \"\";\n }\n }",
"@Test\n\tpublic void caseNameWithEmpty() {\n\t\tString caseName = \" \";\n\t\ttry {\n\t\t\tStringNumberUtil.stringUtil(caseName);\n\t\t} catch (StringException e) {\n\t\t}\n\t}",
"public abstract C14407a mo11606a(String str);",
"public static String LangLabel(int X,int Y){\n \n if ( inicializovane == false){constructor();}\n \n String SlovoDaloSlovo = \"empty\";\n switch (X) {\n case 1: \n SlovoDaloSlovo=SK.get(Y);\n break;\n case 2:\n SlovoDaloSlovo=CZ.get(Y);\n break;\n case 3:\n SlovoDaloSlovo=EN.get(Y);\n break;\n }\n return SlovoDaloSlovo;\n}",
"static void jump_when_sign(String passed){\n\t\tif(S)\n\t\t\tcomplete_jump_req(passed.substring(3));\n\t}",
"public static void countryName (){\n System.out.println(\"Enter a country domain\");\n Scanner input = new Scanner(System.in);\n String userInput = input.nextLine();\n userInput = userInput.toLowerCase();\n\n switch (userInput) {\n case \"us\":\n System.out.println(\"United States\");\n break;\n case \"de\":\n System.out.println(\"Germany\");\n break;\n case \"hu\":\n System.out.println(\"Hungary:\");\n break;\n default:\n System.out.println(\"Unknown\");\n }\n\n }"
] | [
"0.61053425",
"0.6064415",
"0.6036314",
"0.60305154",
"0.60151786",
"0.6002757",
"0.59202516",
"0.5915301",
"0.5794267",
"0.57661307",
"0.57589823",
"0.5719485",
"0.5702922",
"0.5669481",
"0.5662932",
"0.5653723",
"0.5646944",
"0.56455714",
"0.56315494",
"0.56044734",
"0.56033975",
"0.559381",
"0.5567361",
"0.5556238",
"0.55187154",
"0.5517824",
"0.548865",
"0.54833126",
"0.5448167",
"0.54289323",
"0.5428812",
"0.54286295",
"0.5389712",
"0.5389338",
"0.53817445",
"0.53767705",
"0.5374696",
"0.5365952",
"0.5353587",
"0.5302783",
"0.5296332",
"0.5294762",
"0.528435",
"0.52824867",
"0.5281182",
"0.5278049",
"0.52734464",
"0.5269049",
"0.52681994",
"0.52653396",
"0.5262401",
"0.5247704",
"0.5247703",
"0.52444446",
"0.5237411",
"0.52303046",
"0.52303046",
"0.5220672",
"0.5219966",
"0.5215634",
"0.52094007",
"0.5208721",
"0.51984006",
"0.5194437",
"0.51862276",
"0.51853853",
"0.51832575",
"0.5182071",
"0.5180215",
"0.5179094",
"0.5174657",
"0.5173437",
"0.5170095",
"0.5168011",
"0.51645964",
"0.51644254",
"0.5163209",
"0.5161633",
"0.5161487",
"0.51516783",
"0.5151606",
"0.5151305",
"0.51509595",
"0.51509553",
"0.5149627",
"0.514942",
"0.5146595",
"0.5135766",
"0.51297086",
"0.5121732",
"0.5117275",
"0.51113",
"0.51039326",
"0.5100522",
"0.50992715",
"0.50969183",
"0.509427",
"0.50899464",
"0.5085882",
"0.5085742",
"0.50854033"
] | 0.0 | -1 |
Metodo para limpiar tabla completamente y evitar que se mezclen registros | public void limpiartabla(JTable listaempleados){
modelo = (DefaultTableModel) listaempleados.getModel();
while(modelo.getRowCount()>0)modelo.removeRow(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Tablero consultarTablero();",
"private EstabelecimentoTable() {\n\t\t\t}",
"void prepareTables();",
"public void preencherTabelaResultado() {\n\t\tArrayList<Cliente> lista = Fachada.getInstance().pesquisarCliente(txtNome.getText());\n\t\tDefaultTableModel modelo = (DefaultTableModel) tabelaResultado.getModel();\n\t\tObject[] linha = new Object[4];\n\t\tmodelo.setRowCount(0);\n\n\t\tfor (Cliente c : lista) {\n\t\t\tlinha[0] = c.getIdCliente();\n\t\t\tlinha[1] = c.getNome();\n\t\t\tlinha[2] = c.getTelefone().toString();\n\t\t\tif (c.isAptoAEmprestimos())\n\t\t\t\tlinha[3] = \"Apto\";\n\t\t\telse\n\t\t\t\tlinha[3] = \"A devolver\";\n\t\t\tmodelo.addRow(linha);\n\n\t\t}\n\n\t}",
"public void doCreateTable();",
"public void createTable() {\n try {\n tableLayout = findViewById(R.id.tabla);\n tb = new TableDinamic(tableLayout, getApplicationContext(), \"cargarDetalle\", clc, cap_1, cap_2, cap_ct, txtidReg, txtId, txtBloque, txtVariedad);\n tableLayout.removeAllViews();\n tb.addHeader(header);\n tb.addData(cargarTabla());\n tb.backgroundHeader(\n Color.parseColor(\"#20C0FF\")\n );\n tb.backgroundData(\n Color.parseColor(\"#FFFFFF\"),\n Color.parseColor(\"#81F0EDED\")\n );\n } catch (Exception e) {\n Toast.makeText(this, \"Error de la table: \" + e.toString(), Toast.LENGTH_LONG).show();\n }\n }",
"public void initTable();",
"void initTable();",
"private void limparTabela() {\n while (tmLivro.getRowCount() > 0) {\n tmLivro.removeRow(0);\n }\n }",
"private void pintarTabla() {\r\n ArrayList<Corredor> listCorredors = gestion.getCorredores();\r\n TableModelCorredores modelo = new TableModelCorredores(listCorredors);\r\n jTableCorredores.setModel(modelo);\r\n TableRowSorter<TableModel> elQueOrdena = new TableRowSorter<>(modelo);\r\n jTableCorredores.setRowSorter(elQueOrdena);\r\n\r\n }",
"private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Titular\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Dependente dependente : new NDependente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(dependente.getId() + \"\");\n linha.add(dependente.getNome());\n linha.add(dependente.getTelefone());\n linha.add(new NCliente().consultar(dependente.getCliente_id()).getNome());\n linha.add(dependente.getDataNascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblDependentes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }",
"@Override\n\tpublic Long totalRegistrosTabela(String table) throws Exception {\n\t\treturn null;\n\t}",
"private void limparTabela() { \n while (tmLivro.getRowCount() > 0) { \n tmLivro.removeRow(0);\n }\n }",
"private void createTable() {\n\t\t// Tao dataModel & table \n\t\tdataModel = new DefaultTableModel(headers, 0);\n\t\ttable.setModel(dataModel);\n\t\t\n\t\tnapDuLieuChoBang();\n\t}",
"TableFull createTableFull();",
"public void preencherTabela(ArrayList<Livro> lista) {\n\t\tDefaultTableModel modelo = (DefaultTableModel) table.getModel();\n\t\tObject[] linha = new Object[4];\n\t\tmodelo.setRowCount(0);\n\t\tfor (Livro l : lista) {\n\t\t\tlinha[0] = l.getNome();\n\t\t\tlinha[1] = l.getAutor();\n\t\t\tlinha[2] = l.getDataDeLancamento();\n\t\t\tif (l.isDisponivel())\n\t\t\t\tlinha[3] = \"Disponivel\";\n\t\t\telse\n\t\t\t\tlinha[3] = \"Indisponivel\";\n\t\t\tmodelo.addRow(linha);\n\n\t\t}\n\n\t}",
"protected abstract void initialiseTable();",
"private void preencherTabela() {\n\t\tList<Cidade> listCidade;\n\t\tCidadeDAO cidadeDAO;\n\t\tObservableList<Cidade> oListCidade;\n\n\t\t// Determina os atributos que irão preencher as colunas\n\t\tcolCidade.setCellValueFactory(new PropertyValueFactory<>(\"nomeCidades\"));\n\t\tcolEstado.setCellValueFactory(new PropertyValueFactory<>(\"nomeEstado\"));\n\t\tcolSigla.setCellValueFactory(new PropertyValueFactory<>(\"siglaEstado\"));\n\t\tcolCodigoCidade.setCellValueFactory(new PropertyValueFactory<>(\"idCidade\"));\n\t\tcolIdEstado.setCellValueFactory(new PropertyValueFactory<>(\"idEstado\"));\n\n\t\t// Instancia a lista de cidades e a DAO\n\t\tlistCidade = new ArrayList<Cidade>();\n\t\tcidadeDAO = new CidadeDAO();\n\n\t\t// Chama o metodo para selecionar todas as cidades e atribuir a lista\n\t\tlistCidade = cidadeDAO.selecionar();\n\n\t\t// Converte a lista de cidades em observablearray\n\t\toListCidade = FXCollections.observableArrayList(listCidade);\n\n\t\t// Adiciona a lista na tabela\n\t\ttblCidades.setItems(oListCidade);\n\t}",
"private void tableAdapt(ArrayList<String[]> lista, boolean isTraslateAvalible) {\n TableLayout table = (TableLayout) findViewById(R.id.table);\n //declaramos el objeto que nos creará la tabla dinámica\n TableModel tbModel = new TableModel(MainActivity.this, table);\n //indicamos los encabezados de la tabla\n if (isTraslateAvalible) {\n tbModel.setHeaders(new String[]{\"N\", \"Object\", \"Traslated\", \"Accuracy\"});\n } else {\n tbModel.setHeaders(new String[]{\"N\", \"Object\", \"Accuracy\"});\n }\n //enviamos los datos del cuerpo de la tabla\n tbModel.setRows(lista);\n //configuramos la tabla, colores del encabezado y el cuerpo\n // tanto del texto como el fondo\n tbModel.setHeaderBackGroundColor(R.color.back_black);\n tbModel.setRowsBackGroundColor(R.color.back_white);\n\n tbModel.setHeadersForeGroundColor(R.color.back_white);\n tbModel.setRowsForeGroundColor(R.color.back_black);\n //Modifica la tabla a partir de los datos enviados y los parámetros enviados\n tbModel.makeTable();\n\n MyLogs.info(\" FIN \");\n }",
"private void continuarInicializandoComponentes() {\n javax.swing.table.TableColumn columna1 = tablaDetalle.getColumn(\"Id\");\n columna1.setPreferredWidth(10); \n javax.swing.table.TableColumn columna2 = tablaDetalle.getColumn(\"Tipo\");\n columna2.setPreferredWidth(250); \n javax.swing.table.TableColumn columna3 = tablaDetalle.getColumn(\"Número\");\n columna3.setPreferredWidth(50); \n DefaultTableCellRenderer tcrr = new DefaultTableCellRenderer();\n tcrr.setHorizontalAlignment(SwingConstants.RIGHT);\n DefaultTableCellRenderer tcrc = new DefaultTableCellRenderer();\n tcrc.setHorizontalAlignment(SwingConstants.CENTER);\n tablaDetalle.getColumnModel().getColumn(0).setCellRenderer(tcrc);\n tablaDetalle.getColumnModel().getColumn(2).setCellRenderer(tcrr);\n tablaDetalle.getColumnModel().getColumn(3).setCellRenderer(tcrr);\n tablaDetalle.getColumnModel().getColumn(4).setCellRenderer(tcrr);\n }",
"private void UpdateTable() {\n\t\t\t\t\n\t\t\t}",
"public static void viewtable() {\r\n\t\tt.dibuixa(table);\r\n\t}",
"public void cargarTablaFiltro(JTable table, int tipo, String restriccion) {\n\t\t\n\t\tString filtro = restriccion + \"-\" + tipo; \n\t\tList<CocheTaller> coches = mecanicoController.filtrarCocheTaller(filtro);\n\t\tString[] columnNames = {\"Marticula\", \"Marca\", \"Modelo\", \"DNI Cliente\", \"Mecanico\", \"Coste\", \"Estado\"};\n\t\t\n\t\tif (!coches.isEmpty()) {\n\t\t\t DefaultTableModel model = new DefaultTableModel();\n\t\t\t table.setModel(model);\n\t\t\t model.setColumnIdentifiers(columnNames);\n\t\t\t \n\t\t\t for (CocheTaller c : coches) {\n\t\t\t\t Object[] o = new Object[7];\n\t\t\t\t o[0] = c.getMatricula();\n\t\t\t\t o[1] = c.getMarca();\n\t\t\t\t o[2] = c.getModelo();\n\t\t\t\t o[3] = c.getDniCliente();\n\t\t\t\t o[4] = c.getMecanico();\n\t\t\t\t o[5] = c.getCoste() + \"€\";\n\t\t\t\t o[6] = mecanicoController.traducirEstado(c.getEstado());\n\t\t\t\t model.addRow(o);\n\t\t\t\t }\n\t\t} else {\n\t\t\tlogger.error(\"No se dispone ningun vehiculo con ese filtrado.\");\n\t\t}\n\t}",
"private void fillTable(){\n tblModel.setRowCount(0);// xoa cac hang trong bang\n \n for(Student st: list){\n tblModel.addRow(new String[]{st.getStudentId(), st.getName(), st.getMajor(),\"\"\n + st.getMark(), st.getCapacity(), \"\" + st.isBonnus()});\n // them (\"\" + )de chuyen doi kieu float va boolean sang string\n \n }\n tblModel.fireTableDataChanged();\n }",
"public void llenarTabla(){\n pedidoMatDao.llenarTabla();\n }",
"private void popularTabela() {\n\n if (CadastroCliente.listaAluno.isEmpty()) {\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n modelo.setNumRows(0);\n }\n int t = 0;\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n modelo.setNumRows(0);\n int aux = CadastroCliente.listaAluno.size();\n\n while (t < aux) {\n aluno = CadastroCliente.listaAluno.get(t);\n modelo.addRow(new Object[]{aluno.getMatricula(), aluno.getNome(), aluno.getCpf(), aluno.getTel()});\n t++;\n }\n }",
"public void PreencherTabela2() throws SQLException {\n\n String[] colunas = new String[]{\"ID do Pedido\", \"Numero Grafica\", \"Data Emissao\",\"Boleto\"};\n ArrayList dados = new ArrayList();\n Connection connection = ConnectionFactory.getConnection();\n PedidoDAO pedidoDAO = new PedidoDAO(connection);\n ModeloPedido modeloPedido = new ModeloPedido();\n modeloPedido = pedidoDAO.buscaPorId(idPedidoClasse);\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n dados.add(new Object[]{modeloPedido.getId(), modeloPedido.getNumeroGrafica(), format.format(modeloPedido.getDataEmissao()), modeloPedido.isBoleto()});\n\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n\n jTablePedido.setModel(modelo);\n jTablePedido.setRowSorter(new TableRowSorter(modelo));\n jTablePedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTablePedido.getColumnModel().getColumn(0).setResizable(false);\n jTablePedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTablePedido.getColumnModel().getColumn(1).setResizable(false);\n\n jTablePedido.getTableHeader().setReorderingAllowed(false);\n connection.close();\n }",
"public void atualizarTabelaFunc() throws SQLException {\n DefaultTableModel model = (DefaultTableModel) tabelaFunc.getModel();\n model.setNumRows(0);\n dadosDAO dados = new dadosDAO();\n String pesquisa = funcField.getText().toUpperCase();\n for (funcionario func : dados.readFuncionarios()){\n if (!funcField.getText().equals(\"\")){\n if (nomeBtnFunc.isSelected()){\n if (func.getNome().contains(pesquisa)){\n model.addRow(new Object[]{\n func.getId_func(),\n nomeProprio(func.getNome()),\n func.getCpf(),\n func.getDt_nascimento(),\n func.getSexo(),\n func.getTelfix(),\n func.getRamal(),\n func.getTelcel(),\n func.getCep(),\n func.getCargo(),\n func.getTurno(),\n func.getSalario()\n });\n }\n } else if (cpfBtnFunc.isSelected()){\n if (funcField.getText().equals(func.getCpf())) {\n model.addRow(new Object[]{\n func.getId_func(),\n nomeProprio(func.getNome()),\n func.getCpf(),\n func.getDt_nascimento(),\n func.getSexo(),\n func.getTelfix(),\n func.getRamal(),\n func.getTelcel(),\n func.getCep(),\n func.getCargo(),\n func.getTurno(),\n func.getSalario()\n });\n }\n } else {\n if (funcField.getText().equals(String.valueOf(func.getId_func()))){\n model.addRow(new Object[]{\n func.getId_func(),\n nomeProprio(func.getNome()),\n func.getCpf(),\n func.getDt_nascimento(),\n func.getSexo(),\n func.getTelfix(),\n func.getRamal(),\n func.getTelcel(),\n func.getCep(),\n func.getCargo(),\n func.getTurno(),\n func.getSalario()\n });\n }\n }\n } else {\n model.addRow(new Object[]{\n func.getId_func(),\n nomeProprio(func.getNome()),\n func.getCpf(),\n func.getDt_nascimento(),\n func.getSexo(),\n func.getTelfix(),\n func.getRamal(),\n func.getTelcel(),\n func.getCep(),\n func.getCargo(),\n func.getTurno(),\n func.getSalario()\n });\n }\n }\n }",
"Table createTable();",
"public void llenarTabla(int inicio, int limite) {\n DefaultTableModel dtm = (DefaultTableModel) jTableVerRondas.getModel();//se usa DefaultTableModel para manipular facilmente el Tablemodel\n dtm.setRowCount(0);//eliminando la s filas que ya hay. para agregar desde el principio.\n //los datos se agregan la defaultTableModel.\n ArrayList<Partido> llenar = miOpenAustralia.getPartidos();//sacando al informacion a agregar en la tabla.\n\n //como se va a llenar una tabla de 5 columnas, se crea un vector de 3 elementos.\n //se usa un arreglo de Object para poder agregar a la tabla cualquier tipo de datos.\n Object[] datos = new Object[5];\n for (int i = inicio; i < limite; i++) {\n\n Partido parti = llenar.get(i);\n //Se agrega este if para evitar que el extraiga datos en un campo null\n if (parti != null) {\n\n datos[0] = parti.getId();\n datos[1] = parti.getFechaHora();//el primer elemetno del arreglo va a ser el id,la primera col en la Tabla.\n datos[2] = parti.getJugador1().getNombre();\n datos[3] = parti.getJugador2().getNombre();\n datos[4] = parti.getPista().getNombre();\n\n //agrego al TableModleo ese arreglo\n dtm.addRow(datos);\n }\n }\n }",
"public void PreencherTabela() throws SQLException {\n try (Connection connection = ConnectionFactory.getConnection()) {\n String[] colunas = new String[]{\"ID\", \"Nome\", \"Nomenclatura\", \"Quantidade\"};\n ArrayList dados = new ArrayList();\n for (ViewProdutoPedido v : viewProdutoPedidos) {\n dados.add(new Object[]{v.getId(), v.getNome(), v.getNomenclatura(), v.getQuantidade()});\n }\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n jTableItensPedido.setModel(modelo);\n jTableItensPedido.setRowSorter(new TableRowSorter(modelo));\n jTableItensPedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTableItensPedido.getColumnModel().getColumn(0).setResizable(false);\n jTableItensPedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTableItensPedido.getColumnModel().getColumn(1).setResizable(false);\n jTableItensPedido.getColumnModel().getColumn(2).setPreferredWidth(20);\n jTableItensPedido.getColumnModel().getColumn(2).setResizable(false);\n jTableItensPedido.getColumnModel().getColumn(3).setPreferredWidth(20);\n jTableItensPedido.getColumnModel().getColumn(3).setResizable(false);\n\n }\n }",
"private void inicializarTablero() {\r\n\t\t\r\n\t\tfor(int i = 0; i < filas; i++) {\r\n\t\t\tfor(int j = 0; j < columnas; j++) {\r\n\t\t\t\tsuperficie[i][j] = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void fill_table()\n {\n Secante secante = new Secante(GraficaSecanteController.a, GraficaSecanteController.b, GraficaSecanteController.ep, FuncionController.e);\n list = secante.algoritmo();\n }",
"private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"CPF\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Endereço\");\n cabecalho.add(\"E-mail\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Cliente cliente : new NCliente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(cliente.getId() + \"\");\n linha.add(cliente.getNome());\n linha.add(cliente.getCpf());\n linha.add(cliente.getTelefone());\n linha.add(cliente.getEndereco());\n linha.add(cliente.getEmail());\n linha.add(cliente.getData_nascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblClientes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }",
"@Override\n public void tableRows_()\n {\n }",
"private void loadTable() {\n model.getDataVector().removeAllElements();\n model.fireTableDataChanged();\n try {\n String sql = \"select * from tb_mahasiswa\";\n Statement n = a.createStatement();\n ResultSet rs = n.executeQuery(sql);\n while (rs.next()) {\n Object[] o = new Object[6];\n o[0] = rs.getString(\"id_mahasiswa\");\n o[1] = rs.getString(\"nama\");\n o[2] = rs.getString(\"tempat\");\n o[3] = rs.getString(\"waktu\");\n o[4] = rs.getString(\"status\");\n model.addRow(o);\n }\n } catch (Exception e) {\n }\n }",
"private void llenarTabla() {\n\t\t// TODO Auto-generated method stub\n\t\tif (gestionando.equals(\"Empleado\")) {\n\t\t\ttry {\n\t\t\t\tObservableList<PersonaObservable> empleados = administradorDelegado.listarEmpleadosObservables();\n\t\t\t\ttable.setItems(empleados);\n\t\t\t\tcolumnCedula.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"cedula\"));\n\t\t\t\tcolumnNombre.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"nombre\"));\n\t\t\t\tcolumnApellidos.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"apellido\"));\n\t\t\t\tcolumnTelefono.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"telefono\"));\n\t\t\t\ttable.getColumns().setAll(columnCedula, columnNombre, columnApellidos, columnTelefono);\n\t\t\t\ttable.setPrefWidth(450);\n\t\t\t\ttable.setPrefHeight(300);\n\t\t\t\ttable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);\n\n\t\t\t\ttable.getSelectionModel().selectedIndexProperty().addListener(new RowSelectChangeListener());\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else if (gestionando.equals(\"Recolector\")) {\n\t\t\ttry {\n\t\t\t\tObservableList<PersonaObservable> recolectores = administradorDelegado.listarRecolectoresObservables();\n\t\t\t\ttable.setItems(recolectores);\n\t\t\t\tcolumnCedula.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"cedula\"));\n\t\t\t\tcolumnNombre.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"nombre\"));\n\t\t\t\tcolumnApellidos.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"apellido\"));\n\t\t\t\tcolumnTelefono.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"telefono\"));\n\t\t\t\ttable.getColumns().setAll(columnCedula, columnNombre, columnApellidos, columnTelefono);\n\t\t\t\ttable.setPrefWidth(450);\n\t\t\t\ttable.setPrefHeight(300);\n\t\t\t\ttable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);\n\n\t\t\t\ttable.getSelectionModel().selectedIndexProperty().addListener(new RowSelectChangeListener());\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}",
"public void popularTabela() {\n\n try {\n\n RelatorioRN relatorioRN = new RelatorioRN();\n\n ArrayList<PedidoVO> pedidos = relatorioRN.buscarPedidos();\n\n javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) tRelatorio.getModel();\n dtm.fireTableDataChanged();\n dtm.setRowCount(0);\n\n for (PedidoVO pedidoVO : pedidos) {\n\n String[] linha = {\"\" + pedidoVO.getIdpedido(), \"\" + pedidoVO.getData(), \"\" + pedidoVO.getCliente(), \"\" + pedidoVO.getValor()};\n dtm.addRow(linha);\n }\n\n } catch (SQLException sqle) {\n\n JOptionPane.showMessageDialog(null, \"Erro: \" + sqle.getMessage(), \"Bordas\", JOptionPane.ERROR_MESSAGE);\n \n } catch (Exception e) {\n\n JOptionPane.showMessageDialog(null, \"Erro: \" + e.getMessage(), \"Bordas\", JOptionPane.ERROR_MESSAGE);\n }\n }",
"private void llenar_tabla() {\n \n try {\n DefaultTableModel modelo;\n conexion cnx = new conexion();\n Connection registros = cnx.conexion();\n String[] nombre_atributos = {\"id_producto\", \"nombre\",\"id_categoria\"};\n String sql = (\"SELECT *FROM producto\");\n modelo = new DefaultTableModel(null, nombre_atributos);\n Statement st = (Statement) registros.createStatement();\n ResultSet rs = st.executeQuery(sql);\n String[] filas = new String[3];\n\n while (rs.next()) {\n filas[0] = rs.getString(\"id_producto\");\n filas[1] = rs.getString(\"nombre\");\n filas[2] = rs.getString(\"id_categoria\");\n modelo.addRow(filas);\n\n }\n jtabla.setModel(modelo);\n registros.close();\n } catch (SQLException ex) {\n Logger.getLogger(responsable.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }",
"private void apresentarListaNaTabela() {\n DefaultTableModel modelo = (DefaultTableModel) tblAlunos.getModel();\n modelo.setNumRows(0);\n for (Aluno item : bus.getLista()) {\n modelo.addRow(new Object[]{\n item.getIdAluno(),\n item.getNome(),\n item.getEmail(),\n item.getTelefone()\n });\n }\n }",
"private void cargarTabla() {\n\t\tObject[] fila = new Object[7];\r\n\t\tfila[1] = txtCedula.getText();\r\n\t\tfila[2] = txtFuncionario.getText();\r\n\t\tfila[3] = util.getDateToString(dcDesde.getDate());\r\n\t\tif (cbTipo.getSelectedIndex() == 1 || cbTipo.getSelectedIndex() == 2) {\r\n\t\t\tfila[4] = util.getDateToString(dcDesde.getDate());\r\n\t\t} else {\r\n\t\t\tfila[4] = util.getDateToString(dcHasta.getDate());\r\n\t\t}\r\n\t\tfila[5] = cbTipo.getSelectedItem();\r\n\t\tfila[6] = txtMotivo.getText().toUpperCase();\r\n\t\tthis.modelo.addRow(fila);\r\n\t\ttbJustificaciones.setModel(this.modelo);\r\n\t}",
"private void carregaTable(List<Carro> listaCarros) {\n if (listaCarros == null) {\n return;\n }\n DefaultTableModel model = (DefaultTableModel) tabela.getModel();\n model.setRowCount(0);\n for (Carro f : listaCarros) {\n model.addRow(new Object[]{f.getCodigo(), f.getModelo(), f.getCor(), f.getValor()});\n }\n }",
"private JTable itensNaoRecebidos() {\n\t\tinitConexao();\t\t\n try {\t \n\t String select = \"SELECT cod_item_r, nome_item_r, valor_item_r FROM Item_receita WHERE recebimento_item_r = '0'\";\n\t PreparedStatement ptStatement = c.prepareStatement(select);\n\t rs = ptStatement.executeQuery();\n\t \n\t Object[] colunas = {\"Item de receita\", \"Valor total\", \"\", \"code\"}; \t\t\n\t\t\t DefaultTableModel model = new DefaultTableModel();\t\t \n\t\t\t model.setColumnIdentifiers(colunas); \t\t \n\t\t\t Vector<Object[]> linhas = new Vector<Object[]>(); \n\t\t\t \n\t while (rs.next()){\n\t\t linhas.add(new Object[]{rs.getString(\"nome_item_r\"),rs.getString(\"valor_item_r\"),\"Receber\", rs.getString(\"cod_item_r\")}); \t \t\n\t \t } \n\t \n\t\t\t for (Object[] linha : linhas) { \n\t\t model.addRow(linha); \n\t\t } \t\t \n\t\t\t final JTable tarefasTable = new JTable(); \t\t \n\t\t\t tarefasTable.setModel(model); \t\t\n\t\t\t \n\t\t\t ButtonColumn buttonColumn = new ButtonColumn(tarefasTable, 2, \"itemNaoRecebido\");\n\t\t\t \n\t\t\t tarefasTable.removeColumn(tarefasTable.getColumn(\"code\")); \t \n\t return tarefasTable; \n } catch (SQLException ex) {\n System.out.println(\"ERRO: \" + ex);\n }\n\t\treturn null; \n\t}",
"public void llenadoDeTablas() {\n DefaultTableModel modelo = new DefaultTableModel();\n modelo.addColumn(\"ID Articulo\");\n modelo.addColumn(\"Fecha Ingreso\");\n modelo.addColumn(\"Nombre Articulo\");\n modelo.addColumn(\"Talla XS\");\n modelo.addColumn(\"Talla S\");\n modelo.addColumn(\"Talla M\");\n modelo.addColumn(\"Talla L\");\n modelo.addColumn(\"Talla XL\");\n modelo.addColumn(\"Color Articulo\");\n modelo.addColumn(\"Nombre Proveedor\");\n modelo.addColumn(\"Existencias\");\n\n RegistroArticuloDAO registroarcticuloDAO = new RegistroArticuloDAO();\n\n List<RegistroArticulo> registroarticulos = registroarcticuloDAO.select();\n TablaArticulo.setModel(modelo);\n String[] dato = new String[11];\n for (int i = 0; i < registroarticulos.size(); i++) {\n dato[0] = Integer.toString(registroarticulos.get(i).getPK_id_articulo());\n dato[1] = registroarticulos.get(i).getFecha_ingreso();\n dato[2] = registroarticulos.get(i).getNombre_articulo();\n dato[3] = registroarticulos.get(i).getTalla_articuloXS();\n dato[4] = registroarticulos.get(i).getTalla_articuloS();\n dato[5] = registroarticulos.get(i).getTalla_articuloM();\n dato[6] = registroarticulos.get(i).getTalla_articuloL();\n dato[7] = registroarticulos.get(i).getTalla_articuloXL();\n dato[8] = registroarticulos.get(i).getColor_articulo();\n dato[9] = registroarticulos.get(i).getNombre_proveedor();\n dato[10] = registroarticulos.get(i).getExistencia_articulo();\n\n //System.out.println(\"vendedor:\" + vendedores);\n modelo.addRow(dato);\n }\n }",
"private void repopulateTableForAdd()\n {\n clearTable();\n populateTable(null);\n }",
"public final void detalleTabla()\n {\n \n try\n {\n ResultSet obj=nueva.executeQuery(\"SELECT cli_nit,cli_razon_social FROM clientes.cliente ORDER BY cli_razon_social ASC\");\n \n while (obj.next()) \n {\n \n Object [] datos = new Object[2];\n \n \n for (int i=0;i<2;i++)\n {\n datos[i] =obj.getObject(i+1);\n }\n\n modelo.addRow(datos);\n \n }\n tabla_cliente.setModel(modelo);\n nueva.desconectar();\n \n \n \n }catch(Exception e)\n {\n JOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n }",
"public void llenadoDeTablas() {\n /**\n *\n * creaccion de la tabla de de titulos \n */\n DefaultTableModel modelo = new DefaultTableModel();\n modelo.addColumn(\"ID Bitacora\");\n modelo.addColumn(\"Usuario\");\n modelo.addColumn(\"Fecha\");\n modelo.addColumn(\"Hora\");\n modelo.addColumn(\"Ip\");\n modelo.addColumn(\"host\");\n \n modelo.addColumn(\"Accion\");\n modelo.addColumn(\"Codigo Aplicacion\");\n modelo.addColumn(\"Modulo\");\n /**\n *\n * instaciamiento de las las clases Bitacora y BiracoraDAO\n * intaciamiento de la clases con el llenado de tablas\n */\n BitacoraDao BicDAO = new BitacoraDao();\n List<Bitacora> usuario = BicDAO.select();\n JtProductos1.setModel(modelo);\n String[] dato = new String[9];\n for (int i = 0; i < usuario.size(); i++) {\n dato[0] = usuario.get(i).getId_Bitacora();\n dato[1] = usuario.get(i).getId_Usuario();\n dato[2] = usuario.get(i).getFecha();\n dato[3] = usuario.get(i).getHora();\n dato[4] = usuario.get(i).getHost();\n dato[5] = usuario.get(i).getIp();\n dato[6] = usuario.get(i).getAccion();\n dato[7] = usuario.get(i).getCodigoAplicacion();\n dato[8] = usuario.get(i).getModulo();\n \n //System.out.println(\"vendedor:\" + vendedores);\n modelo.addRow(dato);\n }}",
"public void tabla_campos() {\n int rec = AgendarA.tblAgricultor.getSelectedRow();// devuelve un entero con la posicion de la seleccion en la tabla\n ccAgricultor = AgendarA.tblAgricultor.getValueAt(rec, 1).toString();\n crearModeloAgenda();\n }",
"public void crearTabla() {\n\t\tthis.tabla= new String[palabras.length+1][4];\t\n\t}",
"private ArrayList<FornecedorModelo> iniciaTabela() {\n int i;\n DefaultTableModel model=(DefaultTableModel)tblFornecedor.getModel();\n // atribui 0 linhas à coluna\n model.setNumRows(0);\n // atribui um tamanho fixo a coluna codigo\n tblFornecedor.getColumnModel().getColumn(0).setPreferredWidth(2);\n ArrayList<FornecedorModelo> listaFornecedores = new ArrayList<FornecedorModelo>();\n listaFornecedores = new FornecedorControle().listarFornecedor();\n //adiciona alunos as tabelas\n for (i=0;i<=listaFornecedores.size()-1;i++){\n model.addRow(\n new Object[]{\n listaFornecedores.get(i).getCodFornecedor(),\n listaFornecedores.get(i).getNomeFantasia(),\n listaFornecedores.get(i).getRazaoSocial(),\n listaFornecedores.get(i).getEndereco(),\n listaFornecedores.get(i).getEmail(),\n listaFornecedores.get(i).getTelefone(),\n listaFornecedores.get(i).getCnpj(),\n Boolean.FALSE\n }\n );\n }\n return listaFornecedores;\n }",
"public void cargarTabla(String servidor){\n String base_de_datos1=cbBaseDeDatos.getSelectedItem().toString();\n String sql =\"USE [\"+base_de_datos1+\"]\\n\" +\n \"SELECT name FROM sysobjects where xtype='U' and category <> 2\";\n // JOptionPane.showMessageDialog(null,\"SQL cargarbases \"+sql);\n Conexion cc = new Conexion();\n Connection cn=cc.conectarBase(servidor, base_de_datos1);\n modeloTabla=new DefaultTableModel();\n String fila[]=new String[1] ;\n String[] titulos={\"Tablas\"} ;\n try {\n Statement psd = cn.createStatement();\n ResultSet rs=psd.executeQuery(sql);\n if(modeloTabla.getColumnCount()<2){\n modeloTabla.addColumn(titulos[0]);\n //modeloTabla.addColumn(titulos[1]);\n }\n while(rs.next()){\n fila[0]=rs.getString(\"name\");\n // fila[1]=\"1\";\n modeloTabla.addRow(fila);\n }\n tblTablas.setModel(modeloTabla);\n }catch(Exception ex){\n JOptionPane.showMessageDialog(null, ex+\" al cargar tabla\");\n }\n }",
"@Override\n protected void initResultTable() {\n }",
"public void construirTabla(String tipo) {\r\n\r\n\t\t\r\n\t\tif(tipo == \"lis\") {\r\n\t\t\tlistaPersonas = datarPersonas();\r\n\t\t} else if (tipo == \"bus\") {\r\n\t\t\tlistaPersonas = datarPersonasBusqueda();\r\n\t\t}\r\n\t\t\r\n\t\tArrayList<String> titulosList=new ArrayList<>();\r\n\t\t\r\n\t\t//Estos son los encabezados de las columnas\r\n\t\t\r\n\t\ttitulosList.add(\"DNI\");\r\n\t\ttitulosList.add(\"NOMBRE\");\r\n\t\ttitulosList.add(\"APELLIDO\");\r\n\t\ttitulosList.add(\"CUENTA BANCARIA\");\r\n\t\ttitulosList.add(\"PASSWORD\");\r\n\t\ttitulosList.add(\"FECHA DE NACIMIENTO\");\r\n\t\ttitulosList.add(\"TELEFONO\");\r\n\t\ttitulosList.add(\"CORREO ELECTRONICO\");\r\n\t\ttitulosList.add(\"ROL\");\r\n\t\ttitulosList.add(\"Modificar\");\r\n\t\ttitulosList.add(\"Eliminar\"); \r\n\t\t\t\t\r\n\t\t//se asignan los tÃtulos de las columnas para enviarlas al constructor de la tabla\r\n\t\t\r\n\t\tString titulos[] = new String[titulosList.size()];\r\n\t\tfor (int i = 0; i < titulos.length; i++) {\r\n\t\t\ttitulos[i]=titulosList.get(i);\r\n\t\t}\r\n\t\t\r\n\t\tObject[][] data = arrayDatos(titulosList);\r\n\t\tcrearTabla(titulos,data);\r\n\t\t\r\n\t}",
"public void loadingTable() {\n this.setRowCount(1, true);\r\n this.setVisibleRangeAndClearData(this.getVisibleRange(), true);\r\n }",
"private void initTable() {\n\t\tDefaultTableModel dtm = (DefaultTableModel)table.getModel();\n\t\tdtm.setRowCount(0);\t\t\n\t\tfor(int i=0;i<MainUi.controller.sale.items.size();i++){\n\t\t\tVector v1 = new Vector();\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getProdSpec().getTitle());\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getCopies());\n\t\t\tdtm.addRow(v1);\n\t\t}\n\t\tlblNewLabel.setText(\"\"+MainUi.controller.sale.getTotal());\n\t}",
"public void llenarTabla() {\n\n String matriz[][] = new String[lPComunes.size()][2];\n\n for (int i = 0; i < AccesoFichero.lPComunes.size(); i++) {\n matriz[i][0] = AccesoFichero.lPComunes.get(i).getPalabra();\n matriz[i][1] = AccesoFichero.lPComunes.get(i).getCodigo();\n\n }\n\n jTableComun.setModel(new javax.swing.table.DefaultTableModel(\n matriz,\n new String[]{\n \"Palabra\", \"Morse\"\n }\n ) {// Bloquea que las columnas se puedan editar, haciendo doble click en ellas\n @SuppressWarnings(\"rawtypes\")\n Class[] columnTypes = new Class[]{\n String.class, String.class\n };\n\n @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n @Override\n public Class getColumnClass(int columnIndex) {\n return columnTypes[columnIndex];\n }\n boolean[] columnEditables = new boolean[]{\n false, false\n };\n\n @Override\n public boolean isCellEditable(int row, int column) {\n return columnEditables[column];\n }\n });\n\n }",
"public AllFieldsTableHandler(){}",
"public void llenadoDeTablas() {\n \n DefaultTableModel modelo1 = new DefaultTableModel();\n modelo1 = new DefaultTableModel();\n modelo1.addColumn(\"ID Usuario\");\n modelo1.addColumn(\"NOMBRE\");\n UsuarioDAO asignaciondao = new UsuarioDAO();\n List<Usuario> asignaciones = asignaciondao.select();\n TablaPerfiles.setModel(modelo1);\n String[] dato = new String[2];\n for (int i = 0; i < asignaciones.size(); i++) {\n dato[0] = (Integer.toString(asignaciones.get(i).getId_usuario()));\n dato[1] = asignaciones.get(i).getNombre_usuario();\n\n modelo1.addRow(dato);\n }\n }",
"protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }",
"private void Actualizar_Tabla() {\n String[] columNames = {\"iditem\", \"codigo\", \"descripcion\", \"p_vent\", \"p_comp\", \"cant\", \"fecha\"};\n dtPersona = db.Select_Item();\n // se colocan los datos en la tabla\n DefaultTableModel datos = new DefaultTableModel(dtPersona, columNames);\n jTable1.setModel(datos);\n }",
"private void createTable(){\n Object[][] data = new Object[0][8];\n int i = 0;\n for (Grupo grupo : etapa.getGrupos()) {\n Object[][] dataAux = new Object[data.length+1][8];\n System.arraycopy(data, 0, dataAux, 0, data.length);\n dataAux[i++] = new Object[]{grupo.getNum(),grupo.getAtletas().size(),\"Registar Valores\",\"Selecionar Vencedores\", \"Selecionar Atletas\"};\n data = dataAux.clone();\n }\n\n //COLUMN HEADERS\n String columnHeaders[]={\"Numero do Grupo\",\"Número de Atletas\",\"\",\"\",\"\"};\n\n tableEventos.setModel(new DefaultTableModel(\n data,columnHeaders\n ));\n //SET CUSTOM RENDERER TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(3).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(4).setCellRenderer(new ButtonRenderer());\n\n //SET CUSTOM EDITOR TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(3).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(4).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n\n }",
"protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }",
"@SuppressWarnings(\"unchecked\")\n private void createTable(ArrayList<Object> objects){\n log.setText(\"\");\n if(!objects.isEmpty()) {\n ArrayList<String> list = new ArrayList<String>();\n int index = 0, row = 0, column = 0;\n for (Field field : objects.get(0).getClass().getDeclaredFields()) {\n list.add(field.getName());\n }\n String[] columnName = new String[list.size()];\n for(String s:list) {\n columnName[index] = s;\n index++;\n }\n Object data[][] = getData(objects, index);\n if(data.length != 0) {\n tableMode = new DefaultTableModel(data, columnName);\n }\n else {\n tableMode = null;\n }\n }\n else {\n tableMode = null;\n }\n }",
"public void initTable() {\n this.table.setSelectable(true);\n this.table.setImmediate(true);\n this.table.setWidth(\"100%\");\n this.table.addListener(this);\n this.table.setDropHandler(this);\n this.table.addActionHandler(this);\n this.table.setDragMode(TableDragMode.ROW);\n this.table.setSizeFull();\n\n this.table.setColumnCollapsingAllowed(true);\n // table.setColumnReorderingAllowed(true);\n\n // BReiten definieren\n this.table.setColumnExpandRatio(LABEL_ICON, 1);\n this.table.setColumnExpandRatio(LABEL_DATEINAME, 3);\n this.table.setColumnExpandRatio(LABEL_DATUM, 2);\n this.table.setColumnExpandRatio(LABEL_GROESSE, 1);\n this.table.setColumnExpandRatio(LABEL_ACCESS_MODES, 1);\n this.table.setColumnHeader(LABEL_ICON, \"\");\n }",
"private void repopulateTableForDelete()\n {\n clearTable();\n populateTable(null);\n }",
"public void paramTable() {\n jTable2.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);\n mode = (DefaultTableModel) jTable2.getModel();\n dtcm = (DefaultTableColumnModel) jTable2.getColumnModel();\n\n jTable2.setRowHeight(40);\n largeurColoneMax(dtcm, 0, 70);\n largeurColoneMax(dtcm, 3, 50);\n largeurColoneMax(dtcm, 4, 100);\n largeurColoneMax(dtcm, 6, 90);\n largeurColoneMax(dtcm, 9, 70);\n\n TableCellRenderer tbcProjet = getTableCellRenderer();\n TableCellRenderer tbcProjet2 = getTableHeaderRenderer();\n for (int i = 0; i < jTable2.getColumnCount(); i++) {\n TableColumn tc = jTable2.getColumnModel().getColumn(i);\n tc.setCellRenderer(tbcProjet);\n tc.setHeaderRenderer(tbcProjet2);\n\n }\n\n }",
"Table getTable();",
"private void intiPlanTable(){\n //gets all plans that are linked with the current profile\n List<Plan> planList = profile.getPlans().getPlans();\n //now add all plans to the table\n DefaultTableModel model = (DefaultTableModel) this.jTable1.getModel();\n model.setRowCount(0);\n planList.forEach((p) -> {\n model.addRow(new Object[]{p.getPlanName(),p});\n });\n }",
"public void cargarTitulos1() throws SQLException {\n\n tabla1.addColumn(\"CLAVE\");\n tabla1.addColumn(\"NOMBRE\");\n tabla1.addColumn(\"DIAS\");\n tabla1.addColumn(\"ESTATUS\");\n\n this.tbpercep.setModel(tabla1);\n\n TableColumnModel columnModel = tbpercep.getColumnModel();\n\n columnModel.getColumn(0).setPreferredWidth(15);\n columnModel.getColumn(1).setPreferredWidth(150);\n columnModel.getColumn(2).setPreferredWidth(50);\n columnModel.getColumn(3).setPreferredWidth(70);\n\n }",
"private void MontarTabela(String where) {\n \n int linha = 0;\n int coluna = 0;\n \n String offset = String.valueOf(getPaginacao());\n \n while(linha < 10){\n while(coluna < 7){\n tbConFin.getModel().setValueAt(\"\", linha, coluna);\n coluna++;\n }\n linha++;\n coluna = 0;\n }\n \n linha = 0;\n \n String rd_id\n ,rd_codico\n ,rd_nome\n ,rd_receita_despesa\n ,rd_grupo\n ,rd_fixa\n ,rd_ativo;\n \n \n \n try{\n ResultSet rsConFin = cc.stm.executeQuery(\"select * from v_receitadespesa \"+where+\" order by rd_codico limit 10 offset \"+offset);\n \n while ( rsConFin.next() ) {\n rd_id = rsConFin.getString(\"RD_ID\");\n rd_codico = rsConFin.getString(\"rd_codico\");\n rd_nome = rsConFin.getString(\"rd_nome\");\n rd_receita_despesa = getRecDesp(rsConFin.getString(\"rd_receita_despesa\"));\n rd_grupo = getSimNao(rsConFin.getString(\"rd_grupo\"));\n rd_fixa = getSimNao(rsConFin.getString(\"rd_fixa\"));\n rd_ativo = getSimNao(rsConFin.getString(\"rd_ativo\"));\n \n tbConFin.getModel().setValueAt(rd_id, linha, 0);\n tbConFin.getModel().setValueAt(rd_codico, linha, 1);\n tbConFin.getModel().setValueAt(rd_nome, linha, 2);\n tbConFin.getModel().setValueAt(rd_receita_despesa, linha, 3);\n tbConFin.getModel().setValueAt(rd_grupo, linha, 4);\n tbConFin.getModel().setValueAt(rd_fixa, linha, 5);\n tbConFin.getModel().setValueAt(rd_ativo, linha, 6);\n \n linha++;\n }\n \n \n if(linha <= 10){\n setMensagem(\"A Busca retornou \"+linha+\" registros!\");\n }\n \n if(linha < 10){\n setFimConsulta(true);\n }else{\n setFimConsulta(false);\n }\n \n }catch(SQLException e){\n JOptionPane.showMessageDialog(this, \"Erro ao Carregar informações de contas financeiras!\\n\"+e.getMessage());\n }\n \n }",
"private void inicializarTablero() {\n for (int i = 0; i < casillas.length; i++) {\n for (int j = 0; j < casillas[i].length; j++) {\n casillas[i][j] = new Casilla();\n }\n }\n }",
"private void setTable() {\n try {\n DefaultTableModel dtm = (DefaultTableModel) table.getModel();\n dtm.setRowCount(0);\n ArrayList<Item> itemList = ItemController.getAllItem();\n if (itemList != null) {\n for (Item item : itemList) {\n String qoh = BatchController.getQOH(item.getCode());\n if (qoh != null) {\n if (item.getRol() >= Integer.valueOf(qoh)) {\n Object row[] = {item.getCode(), item.getDesciption(), item.getRol(), qoh};\n dtm.addRow(row);\n }\n }\n\n }\n }\n if (dtm.getRowCount() == 0) {\n JOptionPane.showMessageDialog(this, \"Stock level is above ROL\");\n }\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ROL.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(ROL.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void buscarxdescrip() {\r\n try {\r\n modelo.setDescripcion(vista.jTbdescripcion.getText());//C.P.M le enviamos al modelo la descripcion y consultamos\r\n rs = modelo.Buscarxdescrip();//C.P.M cachamos el resultado de la consulta\r\n\r\n DefaultTableModel buscar = new DefaultTableModel() {//C.P.M creamos el modelo de la tabla\r\n @Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {\r\n return false;\r\n }\r\n };\r\n vista.jTbuscar.setModel(buscar);//C.P.M le mandamos el modelo a la tabla\r\n modelo.estructuraProductos(buscar);//C.P.M obtenemos la estructura de la tabla \"encabezados\"\r\n ResultSetMetaData rsMd = rs.getMetaData();//C.P.M obtenemos los metadatos de la consulta\r\n int cantidadColumnas = rsMd.getColumnCount();//C.P.M obtenemos la cantidad de columnas de la consulta\r\n while (rs.next()) {//C.P.M recorremos el resultado\r\n Object[] fila = new Object[cantidadColumnas];//C.P.M creamos un arreglo con una dimencion igual a la cantidad de columnas\r\n for (int i = 0; i < cantidadColumnas; i++) { //C.P.M lo recorremos \r\n fila[i] = rs.getObject(i + 1); //C.P.M vamos insertando los resultados dentor del arreglo\r\n }\r\n buscar.addRow(fila);//C.P.M y lo agregamos como una nueva fila a la tabla\r\n }\r\n\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al buscar producto por descripcion\");\r\n }\r\n }",
"private void reloadShoppingCarTable() {\n\t\t\r\n\t}",
"public void readTable() {\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n modelo.setRowCount(0);\n\n }",
"public void cargarTabla(JTable table) {\n\t\tList<CocheTaller> coches = mecanicoController.cargarTablaCocheTaller();\n\t\t\n\t\tString[] columnNames = {\"Marticula\", \"Marca\", \"Modelo\", \"DNI Cliente\", \"Mecanico\", \"Coste\", \"Estado\"};\n\t\t\n\t\tif (!coches.isEmpty()) {\n\t\t\t DefaultTableModel model = new DefaultTableModel();\n\t\t\t table.setModel(model);\n\t\t\t model.setColumnIdentifiers(columnNames);\n\t\t\t \n\t\t\t for (CocheTaller c : coches) {\n\t\t\t\t Object[] o = new Object[7];\n\t\t\t\t o[0] = c.getMatricula();\n\t\t\t\t o[1] = c.getMarca();\n\t\t\t\t o[2] = c.getModelo();\n\t\t\t\t o[3] = c.getDniCliente();\n\t\t\t\t o[4] = c.getMecanico();\n\t\t\t\t o[5] = c.getCoste() + \"€\";\n\t\t\t\t o[6] = mecanicoController.traducirEstado(c.getEstado());\n\t\t\t\t model.addRow(o);\n\t\t\t\t }\n\t\t} else {\n\t\t\tlogger.error(\"No llegan correctamente los CocheTaller\");\n\t\t}\n\t}",
"private void IniciarTabla(){\n \n // limpia los datos de los Label y los datos relacionados a la actualizacion de los datos e inhabilita y habilitar botones\nthis.jLabelId.setText(\"Id\");\nthis.jnombre.setText(\"\");\ngrabarCambios.setEnabled(false);\njBotonAgregar.setEnabled(true);\n\n DefaultTableModel dfm = new DefaultTableModel();\n tabla = this.jTabla;\n tabla.setModel(dfm);\n \n // agrega los datos al index de la tabla \n dfm.setColumnIdentifiers(new Object[]{\"id\",\"Comuna\",\"Estado\"});\n Conexion cn = new Conexion();\n rs = cn.SeleccionarTodosComunas();\n try{\n // se recorre rs donde estan los resultados de la busqueda de los datos de la tabla comuna\n while(rs.next()){\n String activo =\"\";\n if (rs.getInt(\"COM_ESTADO\")==1) {\n activo = \"activo\";\n } else {\n activo = \"no activo\";};\n // se agrega la fila con los datos de la columna \n dfm.addRow(new Object[]{rs.getInt(\"COM_ID\"),rs.getString(\"COM_NOMBRE\"),activo});\n }\n \n } catch(Exception e){\n System.out.println(\"Error Revisar funcion TableModel\" + e);\n }\n }",
"private void criaJTable() {\n tabela = new JTable(modelo);\n modelo.addColumn(\"Codigo:\");\n modelo.addColumn(\"Data inicio:\");\n modelo.addColumn(\"Data Fim:\");\n modelo.addColumn(\"Valor produto:\");\n modelo.addColumn(\"Quantidade:\");\n\n preencherJTable();\n }",
"public DetalleTablaComplementario() {\r\n }",
"public void atualizarTabela() {\n\t\tJTAlocar.setModel(modelAlocar = new TableModelAlocar(ManipulacaoXml.getInstace().todasAlocacoes()));\n\t}",
"private void tablesice() {\n //Modificamos los tamaños de las columnas.\n tablastock.getColumnModel().getColumn(0).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(1).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(2).setMinWidth(100);\n tablastock.getColumnModel().getColumn(3).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(4).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(5).setMaxWidth(70);\n }",
"private void updateTabela() {\n\n if (txBuscar.getText().isEmpty()) {\n ListaEmprestimosBEANs = new ControlerEmprestimos().listaEmprestimoss();\n } else {\n try {\n Integer buscar = Integer.parseInt(txBuscar.getText());\n ListaEmprestimosBEANs = new ArrayList<>();\n ListaEmprestimosBEANs.add(new ControlerEmprestimos().findEmprestimos(buscar));\n } catch (Exception e) {\n\n }\n }\n DefaultTableModel model = new DefaultTableModel(null, new String[]{\"ID\", \"Data de Saida\", \"Data Estimada do Retorno\", \"Data do Retorno\"});\n try {\n jTable1.setModel(model);\n String[] dados = new String[9];\n for (EmprestimosBEAN a : ListaEmprestimosBEANs) {\n dados[0] = String.valueOf(a.getId_emprestimo());\n dados[1] = a.getDtSaida().toString();\n dados[2] = a.getDtVolta().toString();\n dados[3] = a.getDtRetorno() == null ? \"\" : a.getDtRetorno().toString();\n model.addRow(dados);\n }\n } catch (Exception ex) {\n\n }\n\n }",
"public void buscaxnombre() {\r\n try {\r\n modelo.setNombre(vistabuscapro.jTvnombre.getText());//C.P.M le mandamos a el modelo el nombre para consultarlo\r\n rs = modelo.Buscarxnombre();//C.P.M ejecutamo el metodo del modelo y atrapamos el resultado\r\n\r\n DefaultTableModel buscar = new DefaultTableModel() {//C.P.M se establese el modelo de la tabla\r\n @Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {//C.P.M no sera editable\r\n return false;\r\n }\r\n };\r\n vistabuscapro.Tproductos.setModel(buscar);//C.P.M le mandamos el modelo\r\n modelo.estructuraProductos(buscar);//C.P.M obtenemos la estructura de la tabla \"los encabeados\"\r\n ResultSetMetaData rsMd = rs.getMetaData();//C.P.M obtenemos los metadatos de el resultado\r\n int cantidadColumnas = rsMd.getColumnCount();//C.P.M obtenemos la cantidad de columnas\r\n while (rs.next()) {//C.P.M recorremos el resultado\r\n Object[] fila = new Object[cantidadColumnas];//C.P.M creamos un objeto con la cantidad de columnas obtenidas\r\n for (int i = 0; i < cantidadColumnas; i++) {//C.P.M lo recorremos\r\n fila[i] = rs.getObject(i + 1);//C.P.M le agregamos la informacion obtenida\r\n }\r\n buscar.addRow(fila);//C.P.M lo agregamos a la tabla como una nueva fila\r\n }\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al buscar por nombre\");\r\n }\r\n }",
"public void preencherTabela(){\n imagemEnunciado.setImage(imageDefault);\n pergunta.setImagemEnunciado(caminho);\n imagemResposta.setImage(imageDefault);\n pergunta.setImagemResposta(caminho);\n ///////////////////////////////\n perguntas = dao.read();\n if(perguntas != null){\n perguntasFormatadas = FXCollections.observableList(perguntas);\n\n tablePerguntas.setItems(perguntasFormatadas);\n }\n \n }",
"private void establecerTablaPlatillos() {\n Object[] columnas = {\"Platillo\", \"Cantidad\", \"Costo\"};\n Object[][] modelo = new Object[platillosAVender.size()][3];\n int x = 0;\n\n for (VentaPlatillo ventaPlatillo : platillosAVender) {\n\n modelo[x][0] = ventaPlatillo.getPlatillo().getNombre();\n modelo[x][1] = ventaPlatillo.getCantidad();\n modelo[x][2] = ventaPlatillo.getCosto();\n x++;\n }\n // Se establece el modelo en la tabla con los datos\n tablaPlatillosAVender.setDefaultEditor(Object.class, null);\n tablaPlatillosAVender.setModel(new DefaultTableModel(modelo, columnas));\n tablaPlatillosAVender.setCellSelectionEnabled(false);\n tablaPlatillosAVender.setRowSelectionAllowed(false);\n txtTotal.setText(total + \"\");\n }",
"private void cargarColumnasTabla(){\n \n modeloTabla.addColumn(\"Nombre\");\n modeloTabla.addColumn(\"Telefono\");\n modeloTabla.addColumn(\"Direccion\");\n }",
"void LlenarModelo(){\n datos.addColumn(\"ID\");\n datos.addColumn(\"Descripcion\");\n datos.addColumn(\"Cantidad\");\n String []ingresar=new String[4];\n try {\n Connection con = Conexion.getConection();\n Statement estado = con.createStatement();\n //ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago where codigo>=\" + SIGEPSA.IDOtrosPagosMin + \";\");\n //ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago ;\");\n ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago where codigo<9 or codigo>10 and activo = 1;\");\n while(resultado.next()){\n ingresar[0]=String.valueOf((String)resultado.getObject(\"CODIGO\").toString());\n ingresar[1]=String.valueOf((String)resultado.getObject(\"DESCRIPCION\").toString());\n ingresar[2]=String.valueOf((String)resultado.getObject(\"CANTIDAD\").toString());\n datos.addRow(ingresar);\n }\n }catch (Exception ex) {\n \n }\n }",
"private void preencheTable(){\n\t\t\n\t\tlistaArquivos.setItemCount(0);\n\t\t\n\t\tfor(File f : arquivos){\n\t\t\tTableItem it = new TableItem(listaArquivos, SWT.NONE);\n\t\t\tit.setText(0, f.getName());\n\t\t\tit.setText(1, formataDouble(f.length()));\n\t\t\tit.setText(2, formataData(f.lastModified()));\n\t\t}\n\t\t\n\t}",
"public static void buildTable() {\r\n\t\t//This method keeps the user from editing the table\r\n\t\ttableModel = new DefaultTableModel() {\r\n\t\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isCellEditable(int row, int column) {\r\n\t\t\t\t//All cells false\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\ttableModel.setNumRows(dblogic.getSize());\r\n\t\ttableModel.setColumnCount(COL_COUNT);\r\n\t\ttableModel.setColumnIdentifiers(columnNames);\r\n\t\ttable.setRowSelectionAllowed(true);\r\n\t\ttable.setColumnSelectionAllowed(false);\r\n\t\ttable.setDragEnabled(false);\r\n\t\ttable.getTableHeader().setReorderingAllowed(false);\r\n\t\ttable.setModel(tableModel);\r\n\r\n\t\t//Build rows\r\n\t\tfor (int i = 0; i < dblogic.getSize(); i++) {\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getLastName(), i, COL_LAST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getFirstName(), i, COL_FIRST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronEmail(), i, COL_EMAIL);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getDOB(), i, COL_BIRTH);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronSinceString(), i, COL_ADDED);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getAnniv().toString(), i, COL_ANNIV);\r\n\t\t}\r\n\t}",
"private void calcTableList() throws SQLException {\n tableList = new TableList(session);\n SQLTokenizer[] tzs = tableListTokens.parse(SQLTokenizer.COMMA);\n for(int i = 0; tzs != null && i < tzs.length; i++) {\n if(tzs[i].countTokens() == 0) throw new SQLException(\"Syntax error\");\n String correlation = null;\n String table = tzs[i].getToken(0);\n int n = 1;\n if(tzs[i].getType(1) == Keyword.AS) {\n n++;\n }\n correlation = tzs[i].getToken(n);\n tableList.addTable(table, correlation);\n }\n }",
"public void comprobarclientes(JTable pantallaclientes, ClienteHabitual cliente) throws SQLException{\n //Boolean auxiliar que detiene o permite la ejecucion del metodo\n boolean enmarcha = true;\n //Recorremos la tabla con un for recogiendo con el String auxiliar \"comparador\" el valor de las celdas de DNI\n for(int i = 0; i<pantallaclientes.getRowCount();i++){\n String comparador = pantallaclientes.getValueAt(i, 1).toString();\n //Si este encuentra que ese DNI ya esta se mostrara la informacion cambiando el Boolean a false y evitando que el metodo siga\n if(comparador.equals(cliente.getDNI())){\n JOptionPane.showMessageDialog(null, \"Este DNI ya se encuentra en nuestra BD\");\n String nombre = pantallaclientes.getValueAt(i, 2).toString();\n System.out.println(\"El cliente ya existe\");\n System.out.println(\"Bajo el nombre: \"+nombre);\n enmarcha=false;\n }\n }\n //Si no se encuentra el DNI en la tabla el programa procedera a añadir al Cliente\n if(enmarcha){\n try{\n añadircliente(cliente);\n }catch(SQLException e){\n System.out.println(\"Error al añadir tras la comprobacion: \"+e);\n }\n }\n }",
"private void displayAllTable() {\n\n nhacungcap = new NhaCungCap();\n nhacungcap.setVisible(true);\n jDestopTable.add(nhacungcap);\n\n thuoc = new SanPham();\n thuoc.setVisible(true);\n jDestopTable.add(thuoc);\n\n khachHang = new KhachHang();\n khachHang.setVisible(true);\n jDestopTable.add(khachHang);\n\n hoaDon = new HoaDon();\n hoaDon.setVisible(true);\n jDestopTable.add(hoaDon);\n\n }",
"protected abstract void addTables();",
"public void mostrarTablero(){\n\t\tIterator<String> itr = getIteradorMinas();\n\t\tString mina = null;\n\t\tint col;\n\t\tint fila;\n\t\tint conta=1;\n\t\tCasilla casilla;\n\t\tif (lMinas.size()>0){\n\t\t\twhile(itr.hasNext()){\n\t\t\t\tconta++;\n\t\t\t\tmina=itr.next(); \n\t\t\t\tcol=this.separarCoordenadasCol(this.separarCoordenadasString(mina));\n\t\t\t\tfila=this.separarCoordenadasFil(this.separarCoordenadasString(mina));\n\t\t\t\tcasilla=buscarCasilla(fila, col);\n\t\t\t\tif(!casilla.estaDesvelada()&&!casilla.tieneBandera()){\n\t\t\t\t\tcasilla.descubrir();\n\t\t\t\t\tsetChanged();\n\t\t\t\t\tnotifyObservers(fila+\",\"+col+\",\"+10);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcomprobarBanderas();\n\t\t\n\t}",
"public void cargarTablas(){\n ControladorEmpleados empleados= new ControladorEmpleados();\n ControladorProyectos proyectos= new ControladorProyectos();\n ControladorCasos casos= new ControladorCasos();\n actualizarListadoObservable(empleados.consultarEmpleadosAdminProyectos(ESTADO_ASIGNADO, TIPO_3),casos.consultarCasos(devolverUser()),casos.consultarTiposCaso());\n }",
"public void prepareTable() {\n \tthis.table = new Tape(this.height,this.width,2,this.map);\n }",
"private void populateTable() {\n \n DefaultTableModel dtm = (DefaultTableModel) tblAllCars.getModel();\n dtm.setRowCount(0);\n \n for(Car car : carFleet.getCarFleet()){\n \n Object[] row = new Object[8];\n row[0]=car.getBrandName();\n row[1]=car.getModelNumber();\n row[2]=car.getSerialNumber();\n row[3]=car.getMax_seats();\n row[4]=car.isAvailable();\n row[5]=car.getYearOfManufacturing();\n row[6]=car.isMaintenenceCerticateExpiry();\n row[7]=car.getCity();\n \n dtm.addRow(row);\n \n }\n }",
"public void llenarTabla(ResultSet resultadoCalificaciones) throws SQLException {\n totaldeAlumnos = 0;\n\n int total = 0;\n while (resultadoCalificaciones.next()) {\n total++;\n }\n resultadoCalificaciones.beforeFirst();\n\n DefaultTableModel modelo = (DefaultTableModel) table1Calificaciones.getModel();\n while (resultadoCalificaciones.next()) {\n modelo.addRow(new Object[]{\n (totaldeAlumnos + 1),\n resultadoCalificaciones.getObject(1).toString(),\n resultadoCalificaciones.getObject(2).toString(),\n resultadoCalificaciones.getObject(3).toString(),\n resultadoCalificaciones.getObject(4).toString(),\n resultadoCalificaciones.getObject(5).toString()\n });\n\n totaldeAlumnos++;\n\n }\n if (total == 0) {\n JOptionPane.showMessageDialog(rootPane, \"NO SE ENCONTRARON ALUMNOS\", \"ERROR\", JOptionPane.ERROR_MESSAGE);\n }\n\n }",
"private JTable fontesNaoRecebidas() {\n\t\tinitConexao();\t\t\n try {\t \n\t String select = \"SELECT data_ultimo_recebimento_fonte_r, cod_fonte_r, nome_fonte_r, valor_fonte_r, tipo_valor_fonte_r, periodo_fonte_r FROM Fonte_receita WHERE status_fonte_r = '0'\";\n\t \n\t PreparedStatement ptStatement = c.prepareStatement(select);\n\t rs = ptStatement.executeQuery();\n\t \n\t Object[] colunas = {\"Fonte de receita\", \"Valor previsto\", \"Data prevista do recebimento\", \"\", \"code\"}; \t\t\n\t\t\t DefaultTableModel model = new DefaultTableModel();\t\t \n\t\t\t model.setColumnIdentifiers(colunas); \t\t \n\t\t\t Vector<Object[]> linhas = new Vector<Object[]>(); \n\t\t\t \n\t\t\t select = \"select DATE_ADD(?,INTERVAL ? day)\";\n\t while (rs.next()){\n\t \t \n\t \tptStatement = c.prepareStatement(select);\n\t\t\t\tptStatement.setString(1, rs.getString(\"data_ultimo_recebimento_fonte_r\"));\n\t\t\t\tptStatement.setString(2, rs.getString(\"periodo_fonte_r\"));\n\t\t\t\trs2 = ptStatement.executeQuery();\n\t\t\t\trs2.next();\n\t\t linhas.add(new Object[]{rs.getString(\"nome_fonte_r\"),rs.getString(\"valor_fonte_r\"),rs2.getString(1), \"Receber\", rs.getString(\"cod_fonte_r\")}); \t \t\n\t \t } \n\t \n\t\t\t for (Object[] linha : linhas) { \n\t\t model.addRow(linha); \n\t\t } \t\t \n\t\t\t final JTable tarefasTable = new JTable(); \t\t \n\t\t\t tarefasTable.setModel(model); \t\t\n\t\t\t \n\t\t\t ButtonColumn buttonColumn = new ButtonColumn(tarefasTable, 3, \"fonteNaoRecebida\");\n\t\t\t \n\t\t\t tarefasTable.removeColumn(tarefasTable.getColumn(\"code\")); \t \n\t return tarefasTable; \n } catch (SQLException ex) {\n System.out.println(\"ERRO: \" + ex);\n }\n\t\treturn null; \n\t}",
"TABLE createTABLE();",
"private void addRows() {\n this.SaleList.forEach(Factura -> {\n this.modelo.addRow(new Object[]{\n Factura.getId_Factura(),\n Factura.getPersona().getNombre(),\n Factura.getFecha().getTimestamp(),\n Factura.getCorreo(),\n Factura.getGran_Total()});\n });\n }"
] | [
"0.66364527",
"0.6622994",
"0.6617216",
"0.66113",
"0.65709513",
"0.6534935",
"0.6527364",
"0.6513902",
"0.6479109",
"0.64456934",
"0.64425534",
"0.6428465",
"0.6411281",
"0.64066285",
"0.6388567",
"0.63787514",
"0.63521564",
"0.63302094",
"0.6266195",
"0.6257273",
"0.62396175",
"0.62308896",
"0.6217099",
"0.6208519",
"0.61522317",
"0.61503714",
"0.6147774",
"0.6144352",
"0.6143635",
"0.61378205",
"0.61213404",
"0.6107602",
"0.6103726",
"0.6078527",
"0.60783136",
"0.60644525",
"0.60545796",
"0.60534716",
"0.6053086",
"0.6037122",
"0.6020537",
"0.5990719",
"0.59881943",
"0.59815735",
"0.59774655",
"0.5969579",
"0.59603643",
"0.59587497",
"0.59585005",
"0.595492",
"0.59506214",
"0.5950284",
"0.5950015",
"0.5935348",
"0.59335107",
"0.59258264",
"0.5911287",
"0.5909864",
"0.59075457",
"0.5907148",
"0.5904257",
"0.5894575",
"0.5893324",
"0.58930653",
"0.58915466",
"0.58836395",
"0.5880659",
"0.58750564",
"0.58687234",
"0.5862686",
"0.585641",
"0.5856183",
"0.5855474",
"0.58514434",
"0.58409005",
"0.5840703",
"0.58405316",
"0.5840257",
"0.5837728",
"0.5827204",
"0.5826893",
"0.58236486",
"0.58136463",
"0.5810141",
"0.5808094",
"0.58059144",
"0.5805259",
"0.5804647",
"0.58004075",
"0.5799338",
"0.57978946",
"0.5791935",
"0.5790015",
"0.5789921",
"0.578475",
"0.5782861",
"0.5772438",
"0.57720506",
"0.5771309",
"0.57705456",
"0.5768615"
] | 0.0 | -1 |
Metodo que forma nuestra tablaempleados usando el select recogido en ProductosDatos | public DefaultTableModel tablaempleados(JTable listaempleados)throws SQLException{
Connection conexion = null;
limpiartabla(listaempleados);
try{
conexion = GestionSQL.openConnection();
if(conexion.getAutoCommit()){
conexion.setAutoCommit(false);
}
DefaultTableModel modelo = (DefaultTableModel) listaempleados.getModel();
EmpleadosDatos empleadodatos = new EmpleadosDatos();
List<Empleado>empleados = empleadodatos.select();
datosfila = new Object[modelo.getColumnCount()];
//La tabla de se llena mediante un FOR usando la lista de objectos empleado traida desde metodo select
for(int i = 0; i<empleados.size(); i++){
datosfila[0]=empleados.get(i).getIdempleado();
datosfila[1]=empleados.get(i).getNombre();
datosfila[2]=empleados.get(i).getDNI();
datosfila[3]=empleados.get(i).getTelefono();
datosfila[4]=empleados.get(i).getEmail();
modelo.addRow(datosfila);
}
}catch(SQLException e){
System.out.println("Error en listadoempleados: "+e);
System.out.println("Entramos al rollback ¿Whynot?");
try{
conexion.rollback();
}catch(SQLException ex){
ex.printStackTrace();
System.out.println("Error en rollback");
}finally{
if(conexion != null){
conexion.close();
}
}
}
//retornamos el modelo que es el aspecto y los datos que le daremos a la tabla
return modelo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void llenar_tabla() {\n \n try {\n DefaultTableModel modelo;\n conexion cnx = new conexion();\n Connection registros = cnx.conexion();\n String[] nombre_atributos = {\"id_producto\", \"nombre\",\"id_categoria\"};\n String sql = (\"SELECT *FROM producto\");\n modelo = new DefaultTableModel(null, nombre_atributos);\n Statement st = (Statement) registros.createStatement();\n ResultSet rs = st.executeQuery(sql);\n String[] filas = new String[3];\n\n while (rs.next()) {\n filas[0] = rs.getString(\"id_producto\");\n filas[1] = rs.getString(\"nombre\");\n filas[2] = rs.getString(\"id_categoria\");\n modelo.addRow(filas);\n\n }\n jtabla.setModel(modelo);\n registros.close();\n } catch (SQLException ex) {\n Logger.getLogger(responsable.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }",
"public void PreencherTabela() throws SQLException {\n try (Connection connection = ConnectionFactory.getConnection()) {\n String[] colunas = new String[]{\"ID\", \"Nome\", \"Nomenclatura\", \"Quantidade\"};\n ArrayList dados = new ArrayList();\n for (ViewProdutoPedido v : viewProdutoPedidos) {\n dados.add(new Object[]{v.getId(), v.getNome(), v.getNomenclatura(), v.getQuantidade()});\n }\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n jTableItensPedido.setModel(modelo);\n jTableItensPedido.setRowSorter(new TableRowSorter(modelo));\n jTableItensPedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTableItensPedido.getColumnModel().getColumn(0).setResizable(false);\n jTableItensPedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTableItensPedido.getColumnModel().getColumn(1).setResizable(false);\n jTableItensPedido.getColumnModel().getColumn(2).setPreferredWidth(20);\n jTableItensPedido.getColumnModel().getColumn(2).setResizable(false);\n jTableItensPedido.getColumnModel().getColumn(3).setPreferredWidth(20);\n jTableItensPedido.getColumnModel().getColumn(3).setResizable(false);\n\n }\n }",
"public void buscarxdescrip() {\r\n try {\r\n modelo.setDescripcion(vista.jTbdescripcion.getText());//C.P.M le enviamos al modelo la descripcion y consultamos\r\n rs = modelo.Buscarxdescrip();//C.P.M cachamos el resultado de la consulta\r\n\r\n DefaultTableModel buscar = new DefaultTableModel() {//C.P.M creamos el modelo de la tabla\r\n @Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {\r\n return false;\r\n }\r\n };\r\n vista.jTbuscar.setModel(buscar);//C.P.M le mandamos el modelo a la tabla\r\n modelo.estructuraProductos(buscar);//C.P.M obtenemos la estructura de la tabla \"encabezados\"\r\n ResultSetMetaData rsMd = rs.getMetaData();//C.P.M obtenemos los metadatos de la consulta\r\n int cantidadColumnas = rsMd.getColumnCount();//C.P.M obtenemos la cantidad de columnas de la consulta\r\n while (rs.next()) {//C.P.M recorremos el resultado\r\n Object[] fila = new Object[cantidadColumnas];//C.P.M creamos un arreglo con una dimencion igual a la cantidad de columnas\r\n for (int i = 0; i < cantidadColumnas; i++) { //C.P.M lo recorremos \r\n fila[i] = rs.getObject(i + 1); //C.P.M vamos insertando los resultados dentor del arreglo\r\n }\r\n buscar.addRow(fila);//C.P.M y lo agregamos como una nueva fila a la tabla\r\n }\r\n\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al buscar producto por descripcion\");\r\n }\r\n }",
"private void buscarProducto() {\n EntityManagerFactory emf= Persistence.createEntityManagerFactory(\"pintureriaPU\");\n List<Almacen> listaproducto= new FacadeAlmacen().buscarxnombre(jTextField1.getText().toUpperCase());\n DefaultTableModel modeloTabla=new DefaultTableModel();\n modeloTabla.addColumn(\"Id\");\n modeloTabla.addColumn(\"Producto\");\n modeloTabla.addColumn(\"Proveedor\");\n modeloTabla.addColumn(\"Precio\");\n modeloTabla.addColumn(\"Unidades Disponibles\");\n modeloTabla.addColumn(\"Localizacion\");\n \n \n for(int i=0; i<listaproducto.size(); i++){\n Vector vector=new Vector();\n vector.add(listaproducto.get(i).getId());\n vector.add(listaproducto.get(i).getProducto().getDescripcion());\n vector.add(listaproducto.get(i).getProducto().getProveedor().getNombre());\n vector.add(listaproducto.get(i).getProducto().getPrecio().getPrecio_contado());\n vector.add(listaproducto.get(i).getCantidad());\n vector.add(listaproducto.get(i).getLocalizacion());\n modeloTabla.addRow(vector);\n }\n jTable1.setModel(modeloTabla);\n }",
"public void buscarproducto() {\r\n try {\r\n modelo.setNombre(vista.jTbnombre2.getText());//C.P.M le mandamos al modelo el nombre del producto\r\n rs = modelo.Buscar();//C.P.M obtenemos el resultado del modelos\r\n if (rs.equals(\"\")) {//C.P.M en caso de que el resultado venga vacio notificamos a el usuario que no encontro el producto\r\n JOptionPane.showMessageDialog(null, \"No se encontro: \" + vista.jTbnombre2.getText() + \" en la base de datos.\");\r\n }\r\n //C.P.M Para establecer el modelo al JTable\r\n DefaultTableModel buscar = new DefaultTableModel() {\r\n @Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {//C.P.M Aqui le decimos que no seran editables los campos de la tabla\r\n return false;\r\n }\r\n };\r\n vista.jTbuscar.setModel(buscar);//C.P.M le mandamos el modelo\r\n modelo.estructuraProductos(buscar);//C.P.M Auui obtenemos la estructura de la tabla(\"Los encabezados\")\r\n ResultSetMetaData rsMd = rs.getMetaData();//C.P.M Obtenemos los metadatos para obtener la cantidad del columnas que llegan\r\n int cantidadColumnas = rsMd.getColumnCount();//C.P.M la cantidad la alojamos dentro de un entero\r\n while (rs.next()) {//C.P.M recorremos el resultado \r\n Object[] fila = new Object[cantidadColumnas];//C.P.M Creamos un objeto con el numero de columnas\r\n for (int i = 0; i < cantidadColumnas; i++) {//C.P.M lo recoremos ese vector\r\n fila[i] = rs.getObject(i + 1);//C.P.M Aqui vamos insertando la informacion obtenida de la base de datos\r\n }\r\n buscar.addRow(fila);//C.P.M y agregamos el arreglo como una nueva fila a la tabla\r\n }\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Ocurio un error al buscar el producto\");\r\n }\r\n\r\n }",
"public void buscaxnombre() {\r\n try {\r\n modelo.setNombre(vistabuscapro.jTvnombre.getText());//C.P.M le mandamos a el modelo el nombre para consultarlo\r\n rs = modelo.Buscarxnombre();//C.P.M ejecutamo el metodo del modelo y atrapamos el resultado\r\n\r\n DefaultTableModel buscar = new DefaultTableModel() {//C.P.M se establese el modelo de la tabla\r\n @Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {//C.P.M no sera editable\r\n return false;\r\n }\r\n };\r\n vistabuscapro.Tproductos.setModel(buscar);//C.P.M le mandamos el modelo\r\n modelo.estructuraProductos(buscar);//C.P.M obtenemos la estructura de la tabla \"los encabeados\"\r\n ResultSetMetaData rsMd = rs.getMetaData();//C.P.M obtenemos los metadatos de el resultado\r\n int cantidadColumnas = rsMd.getColumnCount();//C.P.M obtenemos la cantidad de columnas\r\n while (rs.next()) {//C.P.M recorremos el resultado\r\n Object[] fila = new Object[cantidadColumnas];//C.P.M creamos un objeto con la cantidad de columnas obtenidas\r\n for (int i = 0; i < cantidadColumnas; i++) {//C.P.M lo recorremos\r\n fila[i] = rs.getObject(i + 1);//C.P.M le agregamos la informacion obtenida\r\n }\r\n buscar.addRow(fila);//C.P.M lo agregamos a la tabla como una nueva fila\r\n }\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al buscar por nombre\");\r\n }\r\n }",
"public void llenarTabla() {\n DefaultTableModel modelos = (DefaultTableModel) tableProducto.getModel();\n while (modelos.getRowCount() > 0) {\n modelos.removeRow(0);\n }\n MarcaDAO marcaDao = new MarcaDAO();\n CategoriaProductoDAO catProDao = new CategoriaProductoDAO();\n ProductoDAO proDao = new ProductoDAO();\n Marca marca = new Marca();\n CategoriaProducto catPro = new CategoriaProducto();\n\n for (Producto producto : proDao.findAll()) {\n DefaultTableModel modelo = (DefaultTableModel) tableProducto.getModel();\n modelo.addRow(new Object[10]);\n int nuevaFila = modelo.getRowCount() - 1;\n tableProducto.setValueAt(producto.getIdProducto(), nuevaFila, 0);\n tableProducto.setValueAt(producto.getNombreProducto(), nuevaFila, 1);\n tableProducto.setValueAt(producto.getCantidadProducto(), nuevaFila, 2);\n tableProducto.setValueAt(producto.getPrecioCompra(), nuevaFila, 3);\n tableProducto.setValueAt(producto.getPrecioVenta(), nuevaFila, 4);\n tableProducto.setValueAt(producto.getFechaCaducidadProducto(), nuevaFila, 5);\n tableProducto.setValueAt(producto.getFechaCaducidadProducto(), nuevaFila, 6);\n tableProducto.setValueAt(producto.getDescripcionProducto(), nuevaFila, 7);\n marca.setIdMarca(producto.getFK_idMarca());\n tableProducto.setValueAt(marcaDao.findBy(marca, \"idMarca\").get(0).getNombreMarca(), nuevaFila, 8);//PARA FK ID MARCA\n catPro.setIdCategoriaProducto(producto.getFK_idCategoriaProducto());\n tableProducto.setValueAt(catProDao.findBy(catPro, \"idCategoriaProducto\").get(0).getNombreCategoriaProducto(), nuevaFila, 9);\n //PARA FK ID CATEGORIA PRODUCTO\n\n }\n }",
"Tablero consultarTablero();",
"private void cargarTabla() {\n\t\tObject[] fila = new Object[7];\r\n\t\tfila[1] = txtCedula.getText();\r\n\t\tfila[2] = txtFuncionario.getText();\r\n\t\tfila[3] = util.getDateToString(dcDesde.getDate());\r\n\t\tif (cbTipo.getSelectedIndex() == 1 || cbTipo.getSelectedIndex() == 2) {\r\n\t\t\tfila[4] = util.getDateToString(dcDesde.getDate());\r\n\t\t} else {\r\n\t\t\tfila[4] = util.getDateToString(dcHasta.getDate());\r\n\t\t}\r\n\t\tfila[5] = cbTipo.getSelectedItem();\r\n\t\tfila[6] = txtMotivo.getText().toUpperCase();\r\n\t\tthis.modelo.addRow(fila);\r\n\t\ttbJustificaciones.setModel(this.modelo);\r\n\t}",
"private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Titular\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Dependente dependente : new NDependente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(dependente.getId() + \"\");\n linha.add(dependente.getNome());\n linha.add(dependente.getTelefone());\n linha.add(new NCliente().consultar(dependente.getCliente_id()).getNome());\n linha.add(dependente.getDataNascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblDependentes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }",
"private TableModel getTabelaProduto() {\r\n\t\tString[] columnNames = { \"id_c\", \"nome\", \"telefone\", \"endereco\", \"cidade\", \"estado\", \"email\", \"genero\" };\r\n\r\n\t\tObject[][] dados = new Object[listacliente.size()][8];\r\n\t\tfor (int i = 0; i < listacliente.size(); i++) {\r\n\t\t\tint x = 0;\r\n\t\t\tdados[i][x++] = listacliente.get(i).getId();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getNome();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getTelefone();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEndereco();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getCidade();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEstado().getNome();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEmail();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getGenero().getNome();\r\n\t\t}\r\n\r\n\t\treturn new DefaultTableModel(dados, columnNames);\r\n\r\n\t}",
"public PanelTableProduct(JTable tProductos, ArrayList productList) {\n\n // ToolsInterface\n InterfaceTools tools = new InterfaceTools();\n\n ModelTableProduct tmodel = new ModelTableProduct(productList);\n tProductos.setModel(tmodel);\n\n /// PanelTableProduct model = new PanelTableProduct();\n\n\n // BaseDatosProducto baseDatos = new BaseDatosProducto();\n\n // Modificar encabezado\n tProductos.getTableHeader().setReorderingAllowed(false);\n\n tProductos.getTableHeader().setBackground(tools.getColorThree());\n tProductos.getTableHeader().setForeground(tools.getColorFour());\n\n\n tProductos.getTableHeader().setFont(new Font(\"Arial\",Font.PLAIN,14));\n // tProductos.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n tProductos.setSelectionBackground(tools.getColorOne());\n\n\n // tProductos.setEnabled(false);\n tProductos.setRowHeight(20);\n\n\n // Alinear a la Izquierda columna precios e inventario\n\n DefaultTableCellRenderer alignRight = new DefaultTableCellRenderer();\n alignRight.setHorizontalAlignment(SwingConstants.RIGHT);\n tProductos.getColumnModel().getColumn(1).setCellRenderer(alignRight);\n tProductos.getColumnModel().getColumn(2).setCellRenderer(alignRight);\n\n // Edición de celdas\n\n JScrollPane scrollPane = new JScrollPane(tProductos);\n\n scrollPane.setPreferredSize(new Dimension(450,363));\n scrollPane.setViewportView(tProductos);\n\n\n add(scrollPane);\n\n }",
"public void PreencherTabela2() throws SQLException {\n\n String[] colunas = new String[]{\"ID do Pedido\", \"Numero Grafica\", \"Data Emissao\",\"Boleto\"};\n ArrayList dados = new ArrayList();\n Connection connection = ConnectionFactory.getConnection();\n PedidoDAO pedidoDAO = new PedidoDAO(connection);\n ModeloPedido modeloPedido = new ModeloPedido();\n modeloPedido = pedidoDAO.buscaPorId(idPedidoClasse);\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n dados.add(new Object[]{modeloPedido.getId(), modeloPedido.getNumeroGrafica(), format.format(modeloPedido.getDataEmissao()), modeloPedido.isBoleto()});\n\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n\n jTablePedido.setModel(modelo);\n jTablePedido.setRowSorter(new TableRowSorter(modelo));\n jTablePedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTablePedido.getColumnModel().getColumn(0).setResizable(false);\n jTablePedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTablePedido.getColumnModel().getColumn(1).setResizable(false);\n\n jTablePedido.getTableHeader().setReorderingAllowed(false);\n connection.close();\n }",
"public void llenadoDeTablas() {\n DefaultTableModel modelo = new DefaultTableModel();\n modelo.addColumn(\"ID Articulo\");\n modelo.addColumn(\"Fecha Ingreso\");\n modelo.addColumn(\"Nombre Articulo\");\n modelo.addColumn(\"Talla XS\");\n modelo.addColumn(\"Talla S\");\n modelo.addColumn(\"Talla M\");\n modelo.addColumn(\"Talla L\");\n modelo.addColumn(\"Talla XL\");\n modelo.addColumn(\"Color Articulo\");\n modelo.addColumn(\"Nombre Proveedor\");\n modelo.addColumn(\"Existencias\");\n\n RegistroArticuloDAO registroarcticuloDAO = new RegistroArticuloDAO();\n\n List<RegistroArticulo> registroarticulos = registroarcticuloDAO.select();\n TablaArticulo.setModel(modelo);\n String[] dato = new String[11];\n for (int i = 0; i < registroarticulos.size(); i++) {\n dato[0] = Integer.toString(registroarticulos.get(i).getPK_id_articulo());\n dato[1] = registroarticulos.get(i).getFecha_ingreso();\n dato[2] = registroarticulos.get(i).getNombre_articulo();\n dato[3] = registroarticulos.get(i).getTalla_articuloXS();\n dato[4] = registroarticulos.get(i).getTalla_articuloS();\n dato[5] = registroarticulos.get(i).getTalla_articuloM();\n dato[6] = registroarticulos.get(i).getTalla_articuloL();\n dato[7] = registroarticulos.get(i).getTalla_articuloXL();\n dato[8] = registroarticulos.get(i).getColor_articulo();\n dato[9] = registroarticulos.get(i).getNombre_proveedor();\n dato[10] = registroarticulos.get(i).getExistencia_articulo();\n\n //System.out.println(\"vendedor:\" + vendedores);\n modelo.addRow(dato);\n }\n }",
"public void CargarProveedores() {\n DefaultTableModel modelo = (DefaultTableModel) vista.Proveedores.jTable1.getModel();\n modelo.setRowCount(0);\n res = Conexion.Consulta(\"select * From proveedores\");\n try {\n while (res.next()) {\n Vector v = new Vector();\n v.add(res.getInt(1));\n v.add(res.getString(2));\n v.add(res.getString(3));\n v.add(res.getString(4));\n modelo.addRow(v);\n vista.Proveedores.jTable1.setModel(modelo);\n }\n } catch (SQLException e) {\n }\n }",
"public void tabla_campos() {\n int rec = AgendarA.tblAgricultor.getSelectedRow();// devuelve un entero con la posicion de la seleccion en la tabla\n ccAgricultor = AgendarA.tblAgricultor.getValueAt(rec, 1).toString();\n crearModeloAgenda();\n }",
"public void ProductsContent(DefaultTableModel tableModel, int parameter){\n connect();\n ResultSet result = null;\n tableModel.setRowCount(0);\n tableModel.setColumnCount(0);\n String sql =\"SELECT productos.descripcion, productos.presentacion, productos.precio, contenido.cantidad, \"\n + \"contenido.importe FROM productos JOIN contenido JOIN requisiciones ON productos.id_producto = \"\n + \"contenido.producto AND contenido.requisicion = requisiciones.id_requisicion \"\n + \"WHERE requisiciones.id_requisicion = ? ORDER BY descripcion\";\n \n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setInt(1, parameter);\n result = ps.executeQuery();\n if(result != null){\n int columnNumber = result.getMetaData().getColumnCount();\n for(int i = 1; i <= columnNumber; i++){\n tableModel.addColumn(result.getMetaData().getColumnName(i));\n }\n while(result.next()){\n Object []obj = new Object[columnNumber];\n for(int i = 1; i <= columnNumber; i++){\n obj[i-1] = result.getObject(i);\n }\n tableModel.addRow(obj);\n }\n }\n connect.close();\n }catch(SQLException ex){\n ex.printStackTrace();\n } \n }",
"public void llenadoDeTablas() {\n \n DefaultTableModel modelo1 = new DefaultTableModel();\n modelo1 = new DefaultTableModel();\n modelo1.addColumn(\"ID Usuario\");\n modelo1.addColumn(\"NOMBRE\");\n UsuarioDAO asignaciondao = new UsuarioDAO();\n List<Usuario> asignaciones = asignaciondao.select();\n TablaPerfiles.setModel(modelo1);\n String[] dato = new String[2];\n for (int i = 0; i < asignaciones.size(); i++) {\n dato[0] = (Integer.toString(asignaciones.get(i).getId_usuario()));\n dato[1] = asignaciones.get(i).getNombre_usuario();\n\n modelo1.addRow(dato);\n }\n }",
"public void ProductsProvider(DefaultTableModel tableModel, int parameter){\n connect();\n ResultSet result = null;\n tableModel.setRowCount(0);\n tableModel.setColumnCount(0);\n String sql = \"SELECT id_producto as Id, descripcion, presentacion, cantidad, precio, subtotal, proveedor FROM \"+\n \"productos WHERE proveedor = ? ORDER BY descripcion\";\n \n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setInt(1, parameter);\n result = ps.executeQuery();\n if(result != null){\n int columnNumber = result.getMetaData().getColumnCount();\n for(int i = 1; i < columnNumber; i++){\n tableModel.addColumn(result.getMetaData().getColumnName(i));\n }\n while(result.next()){\n Object []obj = new Object[columnNumber];\n for(int i = 1; i < columnNumber; i++){\n obj[i-1] = result.getObject(i);\n }\n tableModel.addRow(obj);\n }\n }\n connect.close();\n }catch(SQLException ex){\n ex.printStackTrace();\n } \n }",
"public void llenadoDeTablas() {\n /**\n *\n * creaccion de la tabla de de titulos \n */\n DefaultTableModel modelo = new DefaultTableModel();\n modelo.addColumn(\"ID Bitacora\");\n modelo.addColumn(\"Usuario\");\n modelo.addColumn(\"Fecha\");\n modelo.addColumn(\"Hora\");\n modelo.addColumn(\"Ip\");\n modelo.addColumn(\"host\");\n \n modelo.addColumn(\"Accion\");\n modelo.addColumn(\"Codigo Aplicacion\");\n modelo.addColumn(\"Modulo\");\n /**\n *\n * instaciamiento de las las clases Bitacora y BiracoraDAO\n * intaciamiento de la clases con el llenado de tablas\n */\n BitacoraDao BicDAO = new BitacoraDao();\n List<Bitacora> usuario = BicDAO.select();\n JtProductos1.setModel(modelo);\n String[] dato = new String[9];\n for (int i = 0; i < usuario.size(); i++) {\n dato[0] = usuario.get(i).getId_Bitacora();\n dato[1] = usuario.get(i).getId_Usuario();\n dato[2] = usuario.get(i).getFecha();\n dato[3] = usuario.get(i).getHora();\n dato[4] = usuario.get(i).getHost();\n dato[5] = usuario.get(i).getIp();\n dato[6] = usuario.get(i).getAccion();\n dato[7] = usuario.get(i).getCodigoAplicacion();\n dato[8] = usuario.get(i).getModulo();\n \n //System.out.println(\"vendedor:\" + vendedores);\n modelo.addRow(dato);\n }}",
"void LlenarModelo(){\n datos.addColumn(\"ID\");\n datos.addColumn(\"Descripcion\");\n datos.addColumn(\"Cantidad\");\n String []ingresar=new String[4];\n try {\n Connection con = Conexion.getConection();\n Statement estado = con.createStatement();\n //ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago where codigo>=\" + SIGEPSA.IDOtrosPagosMin + \";\");\n //ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago ;\");\n ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago where codigo<9 or codigo>10 and activo = 1;\");\n while(resultado.next()){\n ingresar[0]=String.valueOf((String)resultado.getObject(\"CODIGO\").toString());\n ingresar[1]=String.valueOf((String)resultado.getObject(\"DESCRIPCION\").toString());\n ingresar[2]=String.valueOf((String)resultado.getObject(\"CANTIDAD\").toString());\n datos.addRow(ingresar);\n }\n }catch (Exception ex) {\n \n }\n }",
"private void pintarTabla() {\r\n ArrayList<Corredor> listCorredors = gestion.getCorredores();\r\n TableModelCorredores modelo = new TableModelCorredores(listCorredors);\r\n jTableCorredores.setModel(modelo);\r\n TableRowSorter<TableModel> elQueOrdena = new TableRowSorter<>(modelo);\r\n jTableCorredores.setRowSorter(elQueOrdena);\r\n\r\n }",
"private void createTable(){\n Object[][] data = new Object[0][8];\n int i = 0;\n for (Grupo grupo : etapa.getGrupos()) {\n Object[][] dataAux = new Object[data.length+1][8];\n System.arraycopy(data, 0, dataAux, 0, data.length);\n dataAux[i++] = new Object[]{grupo.getNum(),grupo.getAtletas().size(),\"Registar Valores\",\"Selecionar Vencedores\", \"Selecionar Atletas\"};\n data = dataAux.clone();\n }\n\n //COLUMN HEADERS\n String columnHeaders[]={\"Numero do Grupo\",\"Número de Atletas\",\"\",\"\",\"\"};\n\n tableEventos.setModel(new DefaultTableModel(\n data,columnHeaders\n ));\n //SET CUSTOM RENDERER TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(3).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(4).setCellRenderer(new ButtonRenderer());\n\n //SET CUSTOM EDITOR TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(3).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(4).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n\n }",
"private void establecerTablaPlatillos() {\n Object[] columnas = {\"Platillo\", \"Cantidad\", \"Costo\"};\n Object[][] modelo = new Object[platillosAVender.size()][3];\n int x = 0;\n\n for (VentaPlatillo ventaPlatillo : platillosAVender) {\n\n modelo[x][0] = ventaPlatillo.getPlatillo().getNombre();\n modelo[x][1] = ventaPlatillo.getCantidad();\n modelo[x][2] = ventaPlatillo.getCosto();\n x++;\n }\n // Se establece el modelo en la tabla con los datos\n tablaPlatillosAVender.setDefaultEditor(Object.class, null);\n tablaPlatillosAVender.setModel(new DefaultTableModel(modelo, columnas));\n tablaPlatillosAVender.setCellSelectionEnabled(false);\n tablaPlatillosAVender.setRowSelectionAllowed(false);\n txtTotal.setText(total + \"\");\n }",
"public void ProductsAcquisition(DefaultTableModel tableModel, int parameter){\n connect();\n ResultSet result = null;\n tableModel.setRowCount(0);\n tableModel.setColumnCount(0);\n String sql = \"SELECT productos.descripcion, productos.presentacion, productos.precio, adquisicion.cantidad,\"\n + \" adquisicion.importe FROM productos JOIN adquisicion JOIN facturas ON productos.id_producto =\"\n + \" adquisicion.producto AND adquisicion.factura = facturas.folio WHERE facturas.folio = ? ORDER BY descripcion\";\n \n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setInt(1, parameter);\n result = ps.executeQuery();\n if(result != null){\n int columnNumber = result.getMetaData().getColumnCount();\n for(int i = 1; i <= columnNumber; i++){\n tableModel.addColumn(result.getMetaData().getColumnName(i));\n }\n while(result.next()){\n Object []obj = new Object[columnNumber];\n for(int i = 1; i <= columnNumber; i++){\n obj[i-1] = result.getObject(i);\n }\n tableModel.addRow(obj);\n }\n }\n connect.close();\n }catch(SQLException ex){\n ex.printStackTrace();\n } \n }",
"private void cargarTablaConPaquetes() {\n tcId.setCellValueFactory(\n new PropertyValueFactory<Paquete, String>(\"codigo\"));\n tcdescripcion.setCellValueFactory(\n new PropertyValueFactory<Paquete, String>(\"descripcion\"));\n tcDestino.setCellValueFactory(\n new PropertyValueFactory<Paquete, String>(\"destino\"));\n tcEntregado.setCellValueFactory(\n new PropertyValueFactory<Paquete, Boolean>(\"entregado\"));\n\n tbPaqueteria.setItems(data);\n tbPaqueteria.getSelectionModel().selectFirst();\n\n //TODO futura implementacion\n //setDobleClickFila();\n }",
"private void Actualizar_Tabla() {\n String[] columNames = {\"iditem\", \"codigo\", \"descripcion\", \"p_vent\", \"p_comp\", \"cant\", \"fecha\"};\n dtPersona = db.Select_Item();\n // se colocan los datos en la tabla\n DefaultTableModel datos = new DefaultTableModel(dtPersona, columNames);\n jTable1.setModel(datos);\n }",
"private void iniciaTela() {\n try {\n tfCod.setText(String.valueOf(reservaCliDAO.getLastId()));\n desabilitaCampos(false);\n DefaultComboBoxModel modeloComboCliente;\n modeloComboCliente = new DefaultComboBoxModel(funDAO.getAll().toArray());\n cbFunc.setModel(modeloComboCliente);\n modeloComboCliente = new DefaultComboBoxModel(quartoDAO.getAll().toArray());\n cbQuarto.setModel(modeloComboCliente);\n modeloComboCliente = new DefaultComboBoxModel(cliDAO.getAll().toArray());\n cbCliente.setModel(modeloComboCliente);\n btSelect.setEnabled(false);\n verificaCampos();\n carregaTableReserva(reservaDAO.getAll());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"private void listarDatos() {\n DBConnection conListar = new DBConnection();\n DefaultTableModel tableModel = new DefaultTableModel();\n String querty = \"SELECT P.codigo AS Cod_Prod, P.nombre, P.precio_compra AS P_Compra, P.precio_venta AS P_Venta, P.cantidad AS Stock, C.nombre AS Categoria FROM productos AS P JOIN categorias AS C ON P.categorias_id = C.categorias_id\";\n \n tableModel.addColumn(\"Cod. Prod\");\n tableModel.addColumn(\"Nombre\");\n tableModel.addColumn(\"P. Compra\");\n tableModel.addColumn(\"P. Venta\");\n tableModel.addColumn(\"Stock\");\n tableModel.addColumn(\"Categoria\");\n tableStock.setModel(tableModel);\n \n String datos[] = new String[6];\n\n try {\n Statement st = conListar.connetion().createStatement();\n ResultSet rs = st.executeQuery(querty);\n \n while (rs.next()) {\n \n datos[0] = rs.getString(1);\n datos[1] = rs.getString(2);\n datos[2] = rs.getString(3);\n datos[3] = rs.getString(4);\n datos[4] = rs.getString(5);\n datos[5] = rs.getString(6);\n \n tableModel.addRow(datos);\n \n }\n tableStock.setModel(tableModel);\n\n } catch (SQLException e) {\n System.out.println(e.getMessage() + e);\n JOptionPane.showMessageDialog(null, \"Insercion!\", \"Error\", JOptionPane.ERROR);\n } finally {\n try {\n conListar.closeConnection();\n System.err.println(\"Conexion listar stock cerrada\");\n } catch (SQLException ex) {\n Logger.getLogger(Stock.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n \n }",
"public void crearModelo() {\n modeloagr = new DefaultTableModel(null, columnasAgr) {\n public boolean isCellEditable(int fila, int columna) {\n return false;\n }\n };\n tbl.llenarTabla(AgendarA.tblAgricultor, modeloagr, columnasAgr.length, \"SELECT idPersonalExterno,cedula,CONCAT(nombres,' ',apellidos),municipios.nombre,telefono,telefono2,telefono3 FROM personalexterno,municipios WHERE tipo='agricultor' AND personalexterno.idMunicipio=municipios.idMunicipio\");\n tbl.alinearHeaderTable(AgendarA.tblAgricultor, headerColumnas);\n tbl.alinearCamposTable(AgendarA.tblAgricultor, camposColumnas);\n tbl.rowNumberTabel(AgendarA.tblAgricultor);\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jMenu1 = new javax.swing.JMenu();\n jMenu2 = new javax.swing.JMenu();\n txtProducto = new javax.swing.JTextField();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n txtPrecioCompra = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n txtPrecioVenta = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n tableProducto = new javax.swing.JTable();\n jScrollPane3 = new javax.swing.JScrollPane();\n txtAreaDescripcion = new javax.swing.JTextArea();\n jLabel7 = new javax.swing.JLabel();\n SpnCantidad = new javax.swing.JSpinner();\n btnModificar = new javax.swing.JButton();\n btnEliminar = new javax.swing.JButton();\n btnAgregar = new javax.swing.JButton();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n txtId = new javax.swing.JTextField();\n ComboBoxMarca = new javax.swing.JComboBox<>();\n ComboBoxCategoriaProducto = new javax.swing.JComboBox<>();\n jLabel10 = new javax.swing.JLabel();\n jLabel11 = new javax.swing.JLabel();\n btnCategoriaProducto = new javax.swing.JButton();\n jButton1 = new javax.swing.JButton();\n txtFechaCaducidad = new datechooser.beans.DateChooserCombo();\n txtFechaIngreso = new datechooser.beans.DateChooserCombo();\n jMenuBar1 = new javax.swing.JMenuBar();\n btnRegresar = new javax.swing.JMenu();\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jMenu1.setText(\"jMenu1\");\n\n jMenu2.setText(\"jMenu2\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n txtProducto.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtProductoActionPerformed(evt);\n }\n });\n txtProducto.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtProductoKeyTyped(evt);\n }\n });\n\n jLabel1.setText(\"Producto:\");\n\n jLabel2.setText(\"Precio Compra:\");\n\n txtPrecioCompra.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtPrecioCompraActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"Precio Venta:\");\n\n txtPrecioVenta.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtPrecioVentaActionPerformed(evt);\n }\n });\n\n jLabel4.setText(\"Fecha Ingreso:\");\n\n jLabel5.setText(\"Fecha Caducidad:\");\n\n jLabel6.setText(\"Descripcion:\");\n\n tableProducto.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"idProducto\", \"Nombre\", \"Cantidad\", \"Precio de Compra\", \"Precio de Venta\", \"Fecha Ingreso\", \"Fecha de Caducidad\", \"Descripcion Producto\", \"Marca\", \"Categoria\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n tableProducto.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tableProductoMouseClicked(evt);\n }\n });\n jScrollPane2.setViewportView(tableProducto);\n if (tableProducto.getColumnModel().getColumnCount() > 0) {\n tableProducto.getColumnModel().getColumn(0).setMinWidth(0);\n tableProducto.getColumnModel().getColumn(0).setMaxWidth(0);\n tableProducto.getColumnModel().getColumn(3).setMinWidth(0);\n tableProducto.getColumnModel().getColumn(3).setMaxWidth(0);\n tableProducto.getColumnModel().getColumn(6).setMinWidth(0);\n tableProducto.getColumnModel().getColumn(6).setMaxWidth(0);\n tableProducto.getColumnModel().getColumn(7).setMinWidth(0);\n tableProducto.getColumnModel().getColumn(7).setMaxWidth(0);\n }\n\n txtAreaDescripcion.setColumns(20);\n txtAreaDescripcion.setRows(5);\n jScrollPane3.setViewportView(txtAreaDescripcion);\n\n jLabel7.setText(\"Cantidad:\");\n\n btnModificar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/img/1434607676_system-software-update.png\"))); // NOI18N\n btnModificar.setText(\"Modificar\");\n btnModificar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnModificarActionPerformed(evt);\n }\n });\n\n btnEliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/img/1434841655_f-cross_256.png\"))); // NOI18N\n btnEliminar.setText(\"Eliminar\");\n btnEliminar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnEliminarActionPerformed(evt);\n }\n });\n\n btnAgregar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/img/1434608001_save_as-2.png\"))); // NOI18N\n btnAgregar.setText(\"Agregar\");\n btnAgregar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAgregarActionPerformed(evt);\n }\n });\n\n jLabel9.setText(\"Codigo:\");\n\n txtId.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtIdActionPerformed(evt);\n }\n });\n txtId.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtIdKeyTyped(evt);\n }\n });\n\n ComboBoxMarca.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Seleccione una opción\" }));\n\n ComboBoxCategoriaProducto.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Seleccione una opción\" }));\n\n jLabel10.setText(\"Marca:\");\n\n jLabel11.setText(\"Categoria:\");\n\n btnCategoriaProducto.setText(\"...\");\n btnCategoriaProducto.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCategoriaProductoActionPerformed(evt);\n }\n });\n\n jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/img/1434664404_edit-clear.png\"))); // NOI18N\n jButton1.setText(\"Limpiar\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n txtFechaCaducidad.setBehavior(datechooser.model.multiple.MultyModelBehavior.SELECT_SINGLE);\n\n txtFechaIngreso.setBehavior(datechooser.model.multiple.MultyModelBehavior.SELECT_SINGLE);\n\n btnRegresar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/img/1434853539_go-back.png\"))); // NOI18N\n btnRegresar.setText(\"Regresar\");\n btnRegresar.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n btnRegresarMouseClicked(evt);\n }\n });\n jMenuBar1.add(btnRegresar);\n\n setJMenuBar(jMenuBar1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel7)))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel6)))\n .addGap(25, 25, 25)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtPrecioVenta, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(SpnCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel2)\n .addGap(17, 17, 17)\n .addComponent(txtPrecioCompra, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel1))\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addComponent(jLabel9)))\n .addGap(44, 44, 44)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtFechaCaducidad, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jButton1)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnAgregar)\n .addGap(6, 6, 6)\n .addComponent(btnModificar)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnEliminar))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(txtFechaIngreso, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addGap(61, 61, 61))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel11)\n .addComponent(jLabel10))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(ComboBoxCategoriaProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnCategoriaProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(ComboBoxMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(117, 117, 117))))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel5)\n .addComponent(txtFechaCaducidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(9, 9, 9)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel4)\n .addComponent(txtFechaIngreso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel10)\n .addComponent(ComboBoxMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(12, 12, 12)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(ComboBoxCategoriaProducto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel11)\n .addComponent(btnCategoriaProducto))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnAgregar)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnModificar)\n .addComponent(btnEliminar)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton1))\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel9)\n .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(9, 9, 9)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(txtProducto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(11, 11, 11)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(txtPrecioCompra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(11, 11, 11)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel3)\n .addGap(15, 15, 15)\n .addComponent(jLabel7))\n .addGroup(layout.createSequentialGroup()\n .addComponent(txtPrecioVenta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(SpnCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(jLabel6))\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n pack();\n }",
"public void cargarTabla(String servidor){\n String base_de_datos1=cbBaseDeDatos.getSelectedItem().toString();\n String sql =\"USE [\"+base_de_datos1+\"]\\n\" +\n \"SELECT name FROM sysobjects where xtype='U' and category <> 2\";\n // JOptionPane.showMessageDialog(null,\"SQL cargarbases \"+sql);\n Conexion cc = new Conexion();\n Connection cn=cc.conectarBase(servidor, base_de_datos1);\n modeloTabla=new DefaultTableModel();\n String fila[]=new String[1] ;\n String[] titulos={\"Tablas\"} ;\n try {\n Statement psd = cn.createStatement();\n ResultSet rs=psd.executeQuery(sql);\n if(modeloTabla.getColumnCount()<2){\n modeloTabla.addColumn(titulos[0]);\n //modeloTabla.addColumn(titulos[1]);\n }\n while(rs.next()){\n fila[0]=rs.getString(\"name\");\n // fila[1]=\"1\";\n modeloTabla.addRow(fila);\n }\n tblTablas.setModel(modeloTabla);\n }catch(Exception ex){\n JOptionPane.showMessageDialog(null, ex+\" al cargar tabla\");\n }\n }",
"private TableModel getTableModelProduto() {\n\t\tString[] columnNames = { \"cod_p\", \"cod_barra\", \"categoria\", \"descricao\", \"unidade\", \"custo\", \"marge_lucro\" };\n\n\t\tObject[][] data = new Object[listaP.size()][7];\n\t\tfor (int i = 0; i < listaP.size(); i++) {\n\t\t\tint j = 0;\n\t\t\tdata[i][j++] = Long.valueOf(listaP.get(i).getCod());\n\t\t\tdata[i][j++] = listaP.get(i).getCodBarra();\n\t\t\tdata[i][j++] = listaP.get(i).getCategoria();\n\t\t\tdata[i][j++] = listaP.get(i).getDescricao();\n\t\t\tdata[i][j++] = listaP.get(i).getUnidade();\n\t\t\tdata[i][j++] = listaP.get(i).getCusto();\n\t\t\tdata[i][j++] = listaP.get(i).getMargenLucro();\n\t\t}\n\t\treturn new DefaultTableModel(data, columnNames);\n\t}",
"public void iniciarUI()\n\t{\n\t\tDefaultTableModel model = new DefaultTableModel(columnas, 1);\n\t\tpasabordos = new JTable(model);\n\n\t\tvuelos = new JComboBox();\n\t\tllenarVuelos();\n\t\t\n\t\tVuelo v = (Vuelo) vuelos.getSelectedItem();\n\t\tif(v!=null)\n\t\t{\n\t\t\tllenarPasabordos(v.getId());\n\t\t}\n\n\t}",
"public void preencherTabela(){\n imagemEnunciado.setImage(imageDefault);\n pergunta.setImagemEnunciado(caminho);\n imagemResposta.setImage(imageDefault);\n pergunta.setImagemResposta(caminho);\n ///////////////////////////////\n perguntas = dao.read();\n if(perguntas != null){\n perguntasFormatadas = FXCollections.observableList(perguntas);\n\n tablePerguntas.setItems(perguntasFormatadas);\n }\n \n }",
"public void listar_mais_pedidos(String tipo_pedido){\n \n \n OrdemCorteDAO dao = new OrdemCorteDAO();\n DefaultTableModel model = (DefaultTableModel) jTable_MaisPedidos.getModel(); \n \n model.setNumRows(0);\n \n for (OrdemCorteDTO mp : dao.getMaisPedidos(tipo_pedido)) {\n \n model.addRow(new Object[]{mp.getCodigo(), mp.getQtd_pedido()});\n }\n \n \n }",
"public VistaProductos() {\n setUndecorated(true);\n initComponents();\n ValidadSoloNumeros(TextCodProduct);\n ValidadCaracteres(TextDescripcion);\n ValidadSoloNumeros(TextPrecio);\n ValidadSoloNumeros(TextCostoproduc);\n ValidadSoloNumeros(txtIvap);\n cn = Conexion.getConn();\n cargar();\n\n LitsadeProovedores.setModel(new javax.swing.DefaultComboBoxModel(cc.listaProvee().toArray()));\n\n obj = ControllerSql.getInstancia();\n proveedores = cc.listaProvee();\n // LitsadeProovedores.setModel(new javax.swing.DefaultComboBoxModel(proveedores.toArray()));\n LitsadeProovedores.setSelectedIndex(-1);\n }",
"private void mostrar() {\n //DefaultTableModel m = new DefaultTableModel();\n m = new DefaultTableModel(){\n @Override\n public boolean isCellEditable(int row, int column) {\n if (column==6) {\n return true;\n }else{\n return false;\n }\n }\n \n };\n tr = new TableRowSorter(m);\n m.setColumnCount(0);\n m.addColumn(\"Id\");\n m.addColumn(\"Nombre\");\n m.addColumn(\"Apellido\");\n m.addColumn(\"Direccion\");\n m.addColumn(\"Correo\");\n m.addColumn(\"Clave\");\n for (ClienteVO cvo : cdao.consultarTabla()) {\n m.addRow(new Object[]{cvo.getId_cliente(),cvo.getNombre_cliente(),cvo.getApellido_cliente(),cvo.getDireccion_cliente(),cvo.getCorreo_cliente(),cvo.getClave_cliente()});\n }\n vista.tblClientes.setModel(m);\n vista.tblClientes.setRowSorter(tr);\n }",
"private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"CPF\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Endereço\");\n cabecalho.add(\"E-mail\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Cliente cliente : new NCliente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(cliente.getId() + \"\");\n linha.add(cliente.getNome());\n linha.add(cliente.getCpf());\n linha.add(cliente.getTelefone());\n linha.add(cliente.getEndereco());\n linha.add(cliente.getEmail());\n linha.add(cliente.getData_nascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblClientes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jButton1 = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblProductos = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jButton1.setText(\"Seleccionar\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n tblProductos.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Id\", \"Nombre\", \"Cantidad\", \"Precio\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tblProductos);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(13, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 427, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(27, 27, 27)\n .addComponent(jButton1)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(36, Short.MAX_VALUE))\n );\n\n pack();\n }",
"public void llenarDatos() {\n String nombre = \"\";\n String descripcion = \"\";\n try {\n ResultSet resultado = buscador.getResultSet(\"select nombre, descripcion from NODO where ID = \" + IDNodoPadre + \";\");\n if (resultado.next()) {\n nombre = resultado.getObject(\"nombre\").toString();\n descripcion = resultado.getObject(\"descripcion\").toString();\n }\n } catch (SQLException e) {\n System.out.println(\"*SQL Exception: *\" + e.toString());\n }\n campoNombre.setText(nombre);\n campoDescripcion.setText(descripcion);\n //Si esta asociada a categorias\n if(conCategorias)\n llenarComboCategoria();\n else{\n comboCategoria.setVisible(false);\n labelCategoria.setVisible(false);\n }\n }",
"public void cargarDatos() {\n \n if(drogasIncautadoList==null){\n return;\n }\n \n \n \n List<Droga> datos = drogasIncautadoList;\n\n Object[][] matriz = new Object[datos.size()][4];\n \n for (int i = 0; i < datos.size(); i++) {\n \n \n //System.out.println(s[0]);\n \n matriz[i][0] = datos.get(i).getTipoDroga();\n matriz[i][1] = datos.get(i).getKgDroga();\n matriz[i][2] = datos.get(i).getQuetesDroga();\n matriz[i][3] = datos.get(i).getDescripcion();\n \n }\n Object[][] data = matriz;\n String[] cabecera = {\"Tipo Droga\",\"KG\", \"Quetes\", \"Descripción\"};\n dtm = new DefaultTableModel(data, cabecera);\n tableDatos.setModel(dtm);\n }",
"private DefaultTableModel getDatos3(){\n String folio = String.valueOf(venta.ns);\n //consulta sql\n String SQL_SELECT = \"SELECT p.Nombres,dv.Cantidad,dv.PrecioVenta FROM ventas v JOIN detalle_ventas dv ON v.IdVentas=dv.IdVentas JOIN producto p ON p.IdProducto=dv.IdProducto WHERE v.NumeroSerie = \"+folio+\"\";\n try {\n setTitutlos3();\n ps = con.getConnection().prepareStatement(SQL_SELECT);\n RS = ps.executeQuery();\n Object[] fila = new Object[3];\n while (RS.next()){\n fila[0] = RS.getString(1);\n fila[1] = RS.getInt(2);\n fila[2] = RS.getDouble(3);\n DT.addRow(fila);\n }\n //System.out.println(\"si hizo el desmadre\");\n } catch (SQLException e) {\n System.out.println(\"error en la tabla de ticket\");\n }\n \n return DT;\n \n }",
"public DefaultTableModel cargarDatos () {\r\n DefaultTableModel modelo = new DefaultTableModel(\r\n new String[]{\"ID SALIDA\", \"IDENTIFICACIÓN CAPITÁN\", \"NÚMERO MATRICULA\", \"FECHA\", \"HORA\", \"DESTINO\"}, 0); //Creo un objeto del modelo de la tabla con los titulos cargados\r\n String[] info = new String[6];\r\n String query = \"SELECT * FROM actividad WHERE eliminar = false\";\r\n try {\r\n Statement st = con.createStatement();\r\n ResultSet rs = st.executeQuery(query);\r\n while (rs.next()) { \r\n info[0] = rs.getString(\"id_salida\");\r\n info[1] = rs.getString(\"identificacion_navegate\");\r\n info[2] = rs.getString(\"numero_matricula\");\r\n info[3] = rs.getString(\"fecha\");\r\n info[4] = rs.getString(\"hora\");\r\n info[5] = rs.getString(\"destino\");\r\n Object[] fila = new Object[]{info[0], info[1], info[2], info[3], info[4], info[5]};\r\n modelo.addRow(fila);\r\n }\r\n st.close();\r\n rs.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(PActividad.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return modelo;\r\n }",
"public void carga_bd_empleados(){\n try {\n Connection conectar = Conexion.conectar();\n PreparedStatement pst = conectar.prepareStatement(\n \"select nombre, edad, cargo, direccion, telefono from empleados\");\n\n ResultSet rs = pst.executeQuery();\n\n table = new JTable(model);\n jScrollPane1.setViewportView(table);\n table.setBackground(Color.yellow);\n\n model.addColumn(\"Nombre\");\n model.addColumn(\"Edad\");\n model.addColumn(\"Cargo\");\n model.addColumn(\"Direccion\");\n model.addColumn(\"Telefono\");\n\n while (rs.next()) {\n Object[] fila = new Object[8];\n //material mimaterial = new material();\n\n for (int i = 0; i < 5; i++) {\n fila[i] = rs.getObject(i + 1);\n }\n\n// model.addRow(fila);\n Empleado mimaterial = this.ChangetoEmpleado(fila);\n this.AddToArrayTableEmpleado(mimaterial);\n\n }\n\n conectar.close();\n \n } catch (SQLException e) {\n System.err.println(\"Error al llenar tabla\" + e);\n JOptionPane.showMessageDialog(null, \"Error al mostrar informacion\");\n\n }\n }",
"private void preencherTabelaVeiculoCarga() {\n\n ArrayList dados = new ArrayList();\n cargaDao = new CargaDao();\n Carga carga;\n String[] colunas = new String[]{\"ID\", \"DESCRICAO\", \"STATUS\"};\n\n try {\n final List<Object> listaCarga = cargaDao.listarCargasDoVeiculo(idVeiculoSelecionado);\n\n if (listaCarga != null && listaCarga.size() > 0) {\n for (Object cargaAtual : listaCarga) {\n carga = (Carga) cargaAtual;\n dados.add(new Object[]{carga.getIdCarga(), carga.getDescricao(), carga.getStatus()});\n }\n }\n\n ModeloTabela modTabela = new ModeloTabela(dados, colunas);\n jTB_VeiculoCarga.setModel(modTabela);\n jTB_VeiculoCarga.getColumnModel().getColumn(0).setPreferredWidth(100);\n jTB_VeiculoCarga.getColumnModel().getColumn(0).setResizable(false);\n jTB_VeiculoCarga.getColumnModel().getColumn(1).setPreferredWidth(300);\n jTB_VeiculoCarga.getColumnModel().getColumn(1).setResizable(false);\n jTB_VeiculoCarga.getColumnModel().getColumn(2).setPreferredWidth(150);\n jTB_VeiculoCarga.getColumnModel().getColumn(2).setResizable(false);\n\n jTB_VeiculoCarga.getTableHeader().setReorderingAllowed(false);\n jTB_VeiculoCarga.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n jTB_VeiculoCarga.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n jTB_VeiculoCarga.addMouseListener(new MouseAdapter() {\n\n @Override\n public void mouseClicked(MouseEvent e) {\n try {\n List<Object> lista = cargaDao.listarCargasDoVeiculo(idVeiculoSelecionado);\n cargaSelecionada = (Carga) lista.\n get(jTB_VeiculoCarga.convertRowIndexToModel(jTB_VeiculoCarga.getSelectedRow()));\n\n // if (veiculoDao.listarVeiculosAtivos().size() > 0 && veiculoDao.listarVeiculosAtivos() != null) {}\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(FormVeiculoCargas.this, \"Erro genérico1: \" + ex.getMessage());\n ex.printStackTrace(System.err);\n }\n }\n\n });\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"Erro genérico2: \" + e.getMessage());\n }\n }",
"public void cargarTablas(){\n ControladorEmpleados empleados= new ControladorEmpleados();\n ControladorProyectos proyectos= new ControladorProyectos();\n ControladorCasos casos= new ControladorCasos();\n actualizarListadoObservable(empleados.consultarEmpleadosAdminProyectos(ESTADO_ASIGNADO, TIPO_3),casos.consultarCasos(devolverUser()),casos.consultarTiposCaso());\n }",
"public void llenarTabla() {\n\n String matriz[][] = new String[lPComunes.size()][2];\n\n for (int i = 0; i < AccesoFichero.lPComunes.size(); i++) {\n matriz[i][0] = AccesoFichero.lPComunes.get(i).getPalabra();\n matriz[i][1] = AccesoFichero.lPComunes.get(i).getCodigo();\n\n }\n\n jTableComun.setModel(new javax.swing.table.DefaultTableModel(\n matriz,\n new String[]{\n \"Palabra\", \"Morse\"\n }\n ) {// Bloquea que las columnas se puedan editar, haciendo doble click en ellas\n @SuppressWarnings(\"rawtypes\")\n Class[] columnTypes = new Class[]{\n String.class, String.class\n };\n\n @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n @Override\n public Class getColumnClass(int columnIndex) {\n return columnTypes[columnIndex];\n }\n boolean[] columnEditables = new boolean[]{\n false, false\n };\n\n @Override\n public boolean isCellEditable(int row, int column) {\n return columnEditables[column];\n }\n });\n\n }",
"public void llenarTabla(int inicio, int limite) {\n DefaultTableModel dtm = (DefaultTableModel) jTableVerRondas.getModel();//se usa DefaultTableModel para manipular facilmente el Tablemodel\n dtm.setRowCount(0);//eliminando la s filas que ya hay. para agregar desde el principio.\n //los datos se agregan la defaultTableModel.\n ArrayList<Partido> llenar = miOpenAustralia.getPartidos();//sacando al informacion a agregar en la tabla.\n\n //como se va a llenar una tabla de 5 columnas, se crea un vector de 3 elementos.\n //se usa un arreglo de Object para poder agregar a la tabla cualquier tipo de datos.\n Object[] datos = new Object[5];\n for (int i = inicio; i < limite; i++) {\n\n Partido parti = llenar.get(i);\n //Se agrega este if para evitar que el extraiga datos en un campo null\n if (parti != null) {\n\n datos[0] = parti.getId();\n datos[1] = parti.getFechaHora();//el primer elemetno del arreglo va a ser el id,la primera col en la Tabla.\n datos[2] = parti.getJugador1().getNombre();\n datos[3] = parti.getJugador2().getNombre();\n datos[4] = parti.getPista().getNombre();\n\n //agrego al TableModleo ese arreglo\n dtm.addRow(datos);\n }\n }\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tabelaDados = new javax.swing.JTable();\n lblNome = new javax.swing.JLabel();\n txtNome = new javax.swing.JTextField();\n lblCategoria = new javax.swing.JLabel();\n cbCategoria = new javax.swing.JComboBox<>();\n lblPrecoCusto = new javax.swing.JLabel();\n txtPrecoCusto = new javax.swing.JTextField();\n lblData = new javax.swing.JLabel();\n lblQuantidade = new javax.swing.JLabel();\n txtQuantidade = new javax.swing.JTextField();\n lblFornecedor = new javax.swing.JLabel();\n cbMarca = new javax.swing.JComboBox<>();\n lblVendedor = new javax.swing.JLabel();\n txtVendedor = new javax.swing.JTextField();\n jSeparator1 = new javax.swing.JSeparator();\n lblDescricao = new javax.swing.JLabel();\n txtDescricao = new javax.swing.JTextField();\n txtEmail = new javax.swing.JTextField();\n lblEmail = new javax.swing.JLabel();\n lblTelefone = new javax.swing.JLabel();\n txtTelefone = new javax.swing.JTextField();\n jSeparator2 = new javax.swing.JSeparator();\n lblDadosProdutos = new javax.swing.JLabel();\n jSeparator3 = new javax.swing.JSeparator();\n jLabel3 = new javax.swing.JLabel();\n lblCidade = new javax.swing.JLabel();\n txtCidade = new javax.swing.JTextField();\n txtData1 = new javax.swing.JFormattedTextField();\n btnNovo = new javax.swing.JButton();\n btnIncluir = new javax.swing.JButton();\n btnAlterar = new javax.swing.JButton();\n btnExcluir = new javax.swing.JButton();\n btnImprimir = new javax.swing.JButton();\n btnSair = new javax.swing.JButton();\n lblEstadoProduto = new javax.swing.JLabel();\n cbEstadoProduto = new javax.swing.JComboBox<>();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Cadastro dos produtos\");\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n tabelaDados.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Id\", \"Nome\", \"Marca\", \"Vendedor\", \"Preço Unitário\", \"Quantidade\", \"Data\", \"Estado\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n tabelaDados.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tabelaDadosMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tabelaDados);\n\n getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(12, 10, 630, 100));\n\n lblNome.setText(\"Nome do Produto:\");\n getContentPane().add(lblNome, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 150, -1, -1));\n\n txtNome.setToolTipText(\"Digite o nome do produto\");\n txtNome.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtNomeActionPerformed(evt);\n }\n });\n getContentPane().add(txtNome, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 170, 310, -1));\n\n lblCategoria.setText(\"Categoria do Produto:\");\n getContentPane().add(lblCategoria, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 200, -1, -1));\n\n cbCategoria.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Periféricos\", \"Componentes de Computador\", \"Televisores\", \"Projetores\", \"Cabos\", \"Ferramentas\", \" \", \" \" }));\n cbCategoria.setToolTipText(\"Escolha a categoria do produto\");\n getContentPane().add(cbCategoria, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 220, 190, -1));\n\n lblPrecoCusto.setText(\"Preço Unitário\");\n getContentPane().add(lblPrecoCusto, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 250, -1, -1));\n\n txtPrecoCusto.setToolTipText(\"Informe o preço de custo\");\n getContentPane().add(txtPrecoCusto, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 270, 150, -1));\n\n lblData.setText(\"Data:\");\n getContentPane().add(lblData, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 250, -1, -1));\n\n lblQuantidade.setText(\"Quantidade:\");\n getContentPane().add(lblQuantidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 250, -1, -1));\n\n txtQuantidade.setToolTipText(\"Informe a quantidade\");\n getContentPane().add(txtQuantidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 270, 150, -1));\n\n lblFornecedor.setText(\"Marca:\");\n getContentPane().add(lblFornecedor, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 200, -1, -1));\n\n cbMarca.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Intel\", \"Logitech\", \"Dell\", \"Asus\", \"Samsung\" }));\n cbMarca.setToolTipText(\"Informe a marca\");\n getContentPane().add(cbMarca, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 220, 190, -1));\n\n lblVendedor.setText(\"Vendedor:\");\n getContentPane().add(lblVendedor, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 330, -1, -1));\n getContentPane().add(txtVendedor, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 350, 150, -1));\n getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 160, -1, -1));\n\n lblDescricao.setText(\"Descrição:\");\n getContentPane().add(lblDescricao, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 150, -1, -1));\n\n txtDescricao.setToolTipText(\"Descrição do produto\");\n txtDescricao.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtDescricaoActionPerformed(evt);\n }\n });\n getContentPane().add(txtDescricao, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 170, 310, -1));\n getContentPane().add(txtEmail, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 350, 150, -1));\n\n lblEmail.setText(\"Email do Vendedor:\");\n getContentPane().add(lblEmail, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 330, -1, -1));\n\n lblTelefone.setText(\"Telefone do Vendedor:\");\n getContentPane().add(lblTelefone, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 330, -1, -1));\n getContentPane().add(txtTelefone, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 350, 150, -1));\n getContentPane().add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 142, 630, 10));\n\n lblDadosProdutos.setForeground(new java.awt.Color(0, 0, 255));\n lblDadosProdutos.setText(\"Dados Produto:\");\n getContentPane().add(lblDadosProdutos, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 124, -1, 10));\n getContentPane().add(jSeparator3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 322, 630, 10));\n\n jLabel3.setForeground(new java.awt.Color(0, 0, 255));\n jLabel3.setText(\"Dados do Fornecedor:\");\n getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 300, -1, -1));\n\n lblCidade.setText(\"Cidade:\");\n getContentPane().add(lblCidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 380, -1, -1));\n getContentPane().add(txtCidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 400, 150, -1));\n\n txtData1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter()));\n getContentPane().add(txtData1, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 270, 150, -1));\n\n btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/controleprodutos/ícones/icons8-password-reset-24.png\"))); // NOI18N\n btnNovo.setText(\"Novo\");\n btnNovo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnNovoActionPerformed(evt);\n }\n });\n getContentPane().add(btnNovo, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 440, 100, -1));\n\n btnIncluir.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/controleprodutos/ícones/icons8-save-close-24.png\"))); // NOI18N\n btnIncluir.setText(\"Incluir\");\n btnIncluir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnIncluirActionPerformed(evt);\n }\n });\n getContentPane().add(btnIncluir, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 440, 100, -1));\n\n btnAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/controleprodutos/ícones/icons8-change-24.png\"))); // NOI18N\n btnAlterar.setText(\"Alterar\");\n btnAlterar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAlterarActionPerformed(evt);\n }\n });\n getContentPane().add(btnAlterar, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 440, 100, -1));\n\n btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/controleprodutos/ícones/icons8-trash-can-24.png\"))); // NOI18N\n btnExcluir.setText(\"Excluir\");\n btnExcluir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnExcluirActionPerformed(evt);\n }\n });\n getContentPane().add(btnExcluir, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 440, 100, -1));\n\n btnImprimir.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/controleprodutos/ícones/icons8-printer-maintenance-24.png\"))); // NOI18N\n btnImprimir.setText(\"Imprimir\");\n btnImprimir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnImprimirActionPerformed(evt);\n }\n });\n getContentPane().add(btnImprimir, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 440, 110, -1));\n\n btnSair.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/controleprodutos/ícones/icons8-close-window-24.png\"))); // NOI18N\n btnSair.setText(\"Sair\");\n btnSair.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSairActionPerformed(evt);\n }\n });\n getContentPane().add(btnSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 440, -1, -1));\n\n lblEstadoProduto.setText(\"Estado do produto:\");\n getContentPane().add(lblEstadoProduto, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 200, -1, -1));\n\n cbEstadoProduto.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Novo\", \"Usado\", \"Conservado\", \"Antigo\" }));\n getContentPane().add(cbEstadoProduto, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 220, 190, -1));\n\n setSize(new java.awt.Dimension(670, 520));\n setLocationRelativeTo(null);\n }",
"private void llenarTabla() {\n\t\t// TODO Auto-generated method stub\n\t\tif (gestionando.equals(\"Empleado\")) {\n\t\t\ttry {\n\t\t\t\tObservableList<PersonaObservable> empleados = administradorDelegado.listarEmpleadosObservables();\n\t\t\t\ttable.setItems(empleados);\n\t\t\t\tcolumnCedula.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"cedula\"));\n\t\t\t\tcolumnNombre.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"nombre\"));\n\t\t\t\tcolumnApellidos.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"apellido\"));\n\t\t\t\tcolumnTelefono.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"telefono\"));\n\t\t\t\ttable.getColumns().setAll(columnCedula, columnNombre, columnApellidos, columnTelefono);\n\t\t\t\ttable.setPrefWidth(450);\n\t\t\t\ttable.setPrefHeight(300);\n\t\t\t\ttable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);\n\n\t\t\t\ttable.getSelectionModel().selectedIndexProperty().addListener(new RowSelectChangeListener());\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else if (gestionando.equals(\"Recolector\")) {\n\t\t\ttry {\n\t\t\t\tObservableList<PersonaObservable> recolectores = administradorDelegado.listarRecolectoresObservables();\n\t\t\t\ttable.setItems(recolectores);\n\t\t\t\tcolumnCedula.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"cedula\"));\n\t\t\t\tcolumnNombre.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"nombre\"));\n\t\t\t\tcolumnApellidos.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"apellido\"));\n\t\t\t\tcolumnTelefono.setCellValueFactory(new PropertyValueFactory<PersonaObservable, String>(\"telefono\"));\n\t\t\t\ttable.getColumns().setAll(columnCedula, columnNombre, columnApellidos, columnTelefono);\n\t\t\t\ttable.setPrefWidth(450);\n\t\t\t\ttable.setPrefHeight(300);\n\t\t\t\ttable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);\n\n\t\t\t\ttable.getSelectionModel().selectedIndexProperty().addListener(new RowSelectChangeListener());\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}",
"public ConsultaPNporproducto() {\n initComponents();\n ListarPro();\n }",
"private void selectData() {\n String kolom[] = {\"ID\",\"Kasir\",\"Makanan\",\"Harga Makanan\",\"Minuman\",\"Harga Minuman\",\"Bayar\",\"Kembali\",\"Total\"};\n DefaultTableModel dtm = new DefaultTableModel(null, kolom);\n String SQL = \"SELECT * FROM tb_harga\";\n ResultSet rs = KoneksiDB.executeQuery(SQL);\n \n try\n {\n rs = KoneksiDB.executeQuery(SQL);\n while(rs.next())\n {\n String id = rs.getString(1);\n String kasir = rs.getString(2);\n String makanan = rs.getString(3);\n String hrg_makan = rs.getString(4);\n String minum = rs.getString(5);\n String hrg_minum = rs.getString(6);\n String bayar = rs.getString(7);\n String kembali = rs.getString(8);\n String total = rs.getString(9);\n \n String data[] = {id,kasir,makanan,hrg_makan,minum,hrg_minum,bayar,kembali,total};\n dtm.addRow(data);\n }\n }\n catch(SQLException ex)\n {\n Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);\n }\n tData.setModel(dtm); //To change body of generated methods, choose Tools | Templates.\n }",
"public void tabelaktivitas() {\n DefaultTableModel tbl= new DefaultTableModel();\n tbl.addColumn(\"Group\");\n tbl.addColumn(\"Compart\");\n tbl.addColumn(\"Activity\");\n tbl.addColumn(\"HA\");\n tbl.addColumn(\"Harga\");\n tbl.addColumn(\"Total\");\n tblaktivitas.setModel(tbl);\n try{\n java.sql.Statement statement=(java.sql.Statement)conek.GetConnection().createStatement();\n ResultSet res=statement.executeQuery(\"select * from tblaktivitas\");\n while(res.next())\n {\n tbl.addRow(new Object[]{\n res.getString(\"nama_grup\"),\n res.getString(\"compart\"),\n res.getString(\"pekerjaan\"),\n res.getInt(\"ha\"),\n res.getInt(\"harga\"),\n res.getInt(\"total\")\n });\n tblaktivitas.setModel(tbl); \n }\n }catch (Exception e){\n JOptionPane.showMessageDialog(rootPane,\"Salah\");\n }\n }",
"public FrmNuevoAlumno() {\n initComponents();\n obtenerCarreras();\n comboCarrera.setSelectedIndex(-1);\n obtenerDependencias();\n comboPlantel.setSelectedIndex(-1);\n mostrarAlumnos();\n deshabilitar();\n lblId.setVisible(false);\n }",
"public void alertasexistencia() {\r\n try {\r\n rs = modelo.alertaexistenciapro();//C.P.M consultamos los producto con alerta en existencia\r\n DefaultTableModel tabla = new DefaultTableModel() {//C.P.M creamos el modelo de la tabla\r\n @Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {\r\n return false;\r\n }\r\n };\r\n vista.Talertas.setModel(tabla);//C.P.M le mandamos el modelo\r\n modelo.estructuraAlrta(tabla);//C.P.M obtenemos la estructura de la tabla \"los encabezados\"\r\n ResultSetMetaData rsMd = rs.getMetaData();//C.P.M obtenemos los metadatos de la consulta\r\n int cantidadColumnas = rsMd.getColumnCount();//C.P.M obtenemos la cantidad de las columnas de la consulta\r\n while (rs.next()) {\r\n Object[] fila = new Object[cantidadColumnas];//C.P.M creamos un arreglo con la cantidad de columnas \r\n for (int i = 0; i < cantidadColumnas; i++) {//C.P.M lo recorremos \r\n fila[i] = rs.getObject(i + 1);//C.P.M y agregamos la informacion de la consulta\r\n }\r\n tabla.addRow(fila);//C.P.M lo agregamos a la tabla como una nueva fila\r\n }\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio algun error al consultar las alertas\");\r\n }\r\n }",
"public void cargarTablaFiltro(JTable table, int tipo, String restriccion) {\n\t\t\n\t\tString filtro = restriccion + \"-\" + tipo; \n\t\tList<CocheTaller> coches = mecanicoController.filtrarCocheTaller(filtro);\n\t\tString[] columnNames = {\"Marticula\", \"Marca\", \"Modelo\", \"DNI Cliente\", \"Mecanico\", \"Coste\", \"Estado\"};\n\t\t\n\t\tif (!coches.isEmpty()) {\n\t\t\t DefaultTableModel model = new DefaultTableModel();\n\t\t\t table.setModel(model);\n\t\t\t model.setColumnIdentifiers(columnNames);\n\t\t\t \n\t\t\t for (CocheTaller c : coches) {\n\t\t\t\t Object[] o = new Object[7];\n\t\t\t\t o[0] = c.getMatricula();\n\t\t\t\t o[1] = c.getMarca();\n\t\t\t\t o[2] = c.getModelo();\n\t\t\t\t o[3] = c.getDniCliente();\n\t\t\t\t o[4] = c.getMecanico();\n\t\t\t\t o[5] = c.getCoste() + \"€\";\n\t\t\t\t o[6] = mecanicoController.traducirEstado(c.getEstado());\n\t\t\t\t model.addRow(o);\n\t\t\t\t }\n\t\t} else {\n\t\t\tlogger.error(\"No se dispone ningun vehiculo con ese filtrado.\");\n\t\t}\n\t}",
"public CaracteristicasProducto() {\n initComponents();\n setTitle(\"Los Productos\");\n this.setFrameIcon(new ImageIcon(this.getClass().getResource(\"/Imagenes/icoChiqui.png\")));\n tbProducto.setModel(modelo);\n modelo.setColumnIdentifiers(new String[]{\"Item\", \"Nombre\", \"codigo\", \"Serie\"});\n \n tbProducto.getColumnModel().getColumn(0).setPreferredWidth(50);\n tbProducto.getColumnModel().getColumn(1).setPreferredWidth(200);\n tbProducto.getColumnModel().getColumn(2).setPreferredWidth(70);\n tbProducto.getColumnModel().getColumn(3).setPreferredWidth(60);\n \n tbCaracteristicas.setModel(modelo1);\n modelo1.setColumnIdentifiers(new String[]{\"Item\", \"Caracteristica\"});\n tbCaracteristicas.getColumnModel().getColumn(0).setPreferredWidth(40);\n tbCaracteristicas.getColumnModel().getColumn(1).setPreferredWidth(250);\n \n tbCaracteristicasSimilares.setModel(modelo2);\n modelo2.setColumnIdentifiers(new String[]{\"Item\", \"Caracteristica\"});\n tbCaracteristicasSimilares.getColumnModel().getColumn(0).setPreferredWidth(40);\n tbCaracteristicasSimilares.getColumnModel().getColumn(1).setPreferredWidth(250);\n MostrarProductos();\n txtCarateristica.setEnabled(false);\n txtBuscar.grabFocus();\n FormatoTabla ft= new FormatoTabla(1);\n tbCaracteristicas.setDefaultRenderer(Object.class, ft);\n tbCaracteristicasSimilares.setDefaultRenderer(Object.class, ft);\n tbProducto.setDefaultRenderer(Object.class, ft);\n }",
"public ControleVendas() {\n initComponents();\n DefaultTableModel modelo = (DefaultTableModel) tabelaVendas.getModel();\n tabelaVendas.setRowSorter(new TableRowSorter(modelo));\n atualizarTabela();\n }",
"private void IniciarTabla(){\n \n // limpia los datos de los Label y los datos relacionados a la actualizacion de los datos e inhabilita y habilitar botones\nthis.jLabelId.setText(\"Id\");\nthis.jnombre.setText(\"\");\ngrabarCambios.setEnabled(false);\njBotonAgregar.setEnabled(true);\n\n DefaultTableModel dfm = new DefaultTableModel();\n tabla = this.jTabla;\n tabla.setModel(dfm);\n \n // agrega los datos al index de la tabla \n dfm.setColumnIdentifiers(new Object[]{\"id\",\"Comuna\",\"Estado\"});\n Conexion cn = new Conexion();\n rs = cn.SeleccionarTodosComunas();\n try{\n // se recorre rs donde estan los resultados de la busqueda de los datos de la tabla comuna\n while(rs.next()){\n String activo =\"\";\n if (rs.getInt(\"COM_ESTADO\")==1) {\n activo = \"activo\";\n } else {\n activo = \"no activo\";};\n // se agrega la fila con los datos de la columna \n dfm.addRow(new Object[]{rs.getInt(\"COM_ID\"),rs.getString(\"COM_NOMBRE\"),activo});\n }\n \n } catch(Exception e){\n System.out.println(\"Error Revisar funcion TableModel\" + e);\n }\n }",
"public void LlenarPagos(){\n datos=new DefaultTableModel();\n LlenarModelo();\n this.TablaPagos.setModel(datos);\n }",
"private void tablaConsultasMouseClicked(java.awt.event.MouseEvent evt) {\n datosconsulta = new DefaultTableModel();\n datosconsulta.addColumn(\"Cod Mascota\");\n datosconsulta.addColumn(\"Mascota\");\n datosconsulta.addColumn(\"Cod Enfermedad\");\n datosconsulta.addColumn(\"Enfermedad\");\n datosconsulta.addColumn(\"Diagnostico\");\n datosconsulta.addColumn(\"Notas\");\n datosconsulta.addColumn(\"Cod Vacuna\");\n datosconsulta.addColumn(\"Vacuna\");\n datosconsulta.addColumn(\"Aplicación\");\n datosconsulta.addColumn(\"Proxima\");\n tablaDatosDeconsulta.setModel(datosconsulta);\n cargarDatos();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jPanel2 = new javax.swing.JPanel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n id_producto = new javax.swing.JTextField();\n nombre = new javax.swing.JTextField();\n bagregar = new javax.swing.JButton();\n bmodificar = new javax.swing.JButton();\n beliminar = new javax.swing.JButton();\n jScrollPane2 = new javax.swing.JScrollPane();\n jtabla = new javax.swing.JTable();\n COMBO1 = new javax.swing.JComboBox<>();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel5.setText(\"PRODUCTOS\");\n\n jLabel6.setText(\"ID_PRODUCTO:\");\n\n jLabel7.setText(\"NOMBRE:\");\n\n jLabel8.setText(\"CATEGORIA:\");\n\n id_producto.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n id_productoActionPerformed(evt);\n }\n });\n\n bagregar.setText(\"AGREGAR\");\n bagregar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bagregarActionPerformed(evt);\n }\n });\n\n bmodificar.setText(\"MODIFICAR\");\n bmodificar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bmodificarActionPerformed(evt);\n }\n });\n\n beliminar.setText(\"ACTUALIZAR\");\n beliminar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n beliminarActionPerformed(evt);\n }\n });\n\n jtabla.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane2.setViewportView(jtabla);\n\n COMBO1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n COMBO1ActionPerformed(evt);\n }\n });\n\n jButton1.setText(\"buscar\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"ELIMINAR\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(295, 295, 295)\n .addComponent(jLabel5))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(95, 95, 95)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 482, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel7)\n .addGap(18, 18, 18)\n .addComponent(nombre, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addGap(21, 21, 21)\n .addComponent(id_producto, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(17, 17, 17)\n .addComponent(jLabel8)\n .addGap(18, 18, 18)\n .addComponent(COMBO1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGap(31, 31, 31)\n .addComponent(jButton1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(bagregar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(bmodificar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(beliminar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))))\n .addContainerGap(175, Short.MAX_VALUE))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(24, 24, 24)\n .addComponent(jLabel5)\n .addGap(25, 25, 25)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(id_producto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bagregar)\n .addComponent(jButton1))\n .addGap(30, 30, 30)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(nombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bmodificar)\n .addComponent(jLabel7))\n .addGap(30, 30, 30)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(beliminar)\n .addComponent(jLabel8)\n .addComponent(COMBO1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(28, 28, 28)\n .addComponent(jButton2)\n .addGap(34, 34, 34)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(241, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }",
"public Item_Productos() {\n initComponents();\n Actualizar_Tabla();\n //oculta columna ID\n \n this.setLocationRelativeTo(null);\n jTable1.getColumnModel().getColumn(0).setMaxWidth(0);\n jTable1.getColumnModel().getColumn(0).setMinWidth(0);\n jTable1.getTableHeader().getColumnModel().getColumn(0).setMaxWidth(0);\n jTable1.getTableHeader().getColumnModel().getColumn(0).setMinWidth(0);\n //editor de caldas\n jTable1.getColumnModel().getColumn(1).setCellEditor(new MyTableCellEditor(db, \"Codigo\"));\n jTable1.getColumnModel().getColumn(2).setCellEditor(new MyTableCellEditor(db, \"Descripcion\"));\n jTable1.getColumnModel().getColumn(3).setCellEditor(new MyTableCellEditor(db, \"Precio de venta\"));\n jTable1.getColumnModel().getColumn(4).setCellEditor(new MyTableCellEditor(db, \"Precion de compra\"));\n jTable1.getColumnModel().getColumn(5).setCellEditor(new MyTableCellEditor(db, \"Cantidad\"));\n jTable1.getColumnModel().getColumn(6).setCellEditor(new MyTableCellEditor(db, \"Fecha\"));\n\n }",
"public void listarEquipamentos() {\n \n \n List<Equipamento> formandos =new EquipamentoJpaController().findEquipamentoEntities();\n \n DefaultTableModel tbm=(DefaultTableModel) listadeEquipamento.getModel();\n \n for (int i = tbm.getRowCount()-1; i >= 0; i--) {\n tbm.removeRow(i);\n }\n int i=0;\n for (Equipamento f : formandos) {\n tbm.addRow(new String[1]);\n \n listadeEquipamento.setValueAt(f.getIdequipamento(), i, 0);\n listadeEquipamento.setValueAt(f.getEquipamento(), i, 1);\n \n i++;\n }\n \n \n \n }",
"public final void detalleTabla()\n {\n \n try\n {\n ResultSet obj=nueva.executeQuery(\"SELECT cli_nit,cli_razon_social FROM clientes.cliente ORDER BY cli_razon_social ASC\");\n \n while (obj.next()) \n {\n \n Object [] datos = new Object[2];\n \n \n for (int i=0;i<2;i++)\n {\n datos[i] =obj.getObject(i+1);\n }\n\n modelo.addRow(datos);\n \n }\n tabla_cliente.setModel(modelo);\n nueva.desconectar();\n \n \n \n }catch(Exception e)\n {\n JOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n }",
"private void apresentarListaNaTabela() {\n DefaultTableModel modelo = (DefaultTableModel) tblAlunos.getModel();\n modelo.setNumRows(0);\n for (Aluno item : bus.getLista()) {\n modelo.addRow(new Object[]{\n item.getIdAluno(),\n item.getNome(),\n item.getEmail(),\n item.getTelefone()\n });\n }\n }",
"private void enlazarListadoTabla() {\n tblCursos.setItems(listaCursos);\n\n //Enlazar columnas con atributos\n clmNombre.setCellValueFactory(new PropertyValueFactory<Curso, String>(\"nombre\"));\n clmAmbito.setCellValueFactory(new PropertyValueFactory<Curso, String>(\"familiaProfesional\"));\n clmDuracion.setCellValueFactory(new PropertyValueFactory<Curso, Integer>(\"duracion\"));\n }",
"public void clicTable(View v) {\n try {\n conteoTab ct = clc.get(tb.getIdTabla() - 1);\n\n if(ct.getEstado().equals(\"0\")) {\n String variedad = ct.getVariedad();\n String bloque = ct.getBloque();\n Long idSiembra = ct.getIdSiembra();\n String idSiempar = String.valueOf(idSiembra);\n\n long idReg = ct.getIdConteo();\n int cuadro = ct.getCuadro();\n int conteo1 = ct.getConteo1();\n int conteo4 = ct.getConteo4();\n int total = ct.getTotal();\n\n txtidReg.setText(\"idReg:\" + idReg);\n txtCuadro.setText(\"Cuadro: \" + cuadro);\n cap_1.setText(String.valueOf(conteo1));\n cap_2.setText(String.valueOf(conteo4));\n cap_ct.setText(String.valueOf(total));\n txtId.setText(\"Siembra: \" + idSiempar);\n txtVariedad.setText(\"Variedad: \" + variedad);\n txtBloque.setText(\"Bloque: \" + bloque);\n }else{\n Toast.makeText(this, \"No se puede cargar el registro por que ya ha sido enviado\", Toast.LENGTH_SHORT).show();\n }\n\n } catch (Exception E) {\n Toast.makeText(getApplicationContext(), \"No has seleccionado aún una fila \\n\" + E, Toast.LENGTH_LONG).show();\n }\n }",
"private void establecerMenu(ArrayList<PlatilloMenu> lMenu) {\n Object[] columnas = {\"Platillo\", \"Reservados\", \"Para vender\"};\n Object[][] modelo = new Object[lMenu.size()][3];\n int x = 0;\n DefaultComboBoxModel modeloLista;\n ArrayList<Platillo> listaPlatilllos = new ArrayList<>();\n for (PlatilloMenu platilloMenu : lMenu) {\n int paraVender = platilloMenu.getCantidad();\n int reservados = platilloMenu.getReservados();\n // Si el platillo del menu aún se puede vender\n if (paraVender > 0 || reservados > 0) {\n // Se agrega el platillo a la lista de platillos\n listaPlatilllos.add(platilloMenu.getPlatillo());\n }\n modelo[x][0] = platilloMenu.getPlatillo().getNombre();\n modelo[x][1] = reservados;\n modelo[x][2] = paraVender;\n x++;\n }\n // Se establece el modelo en la tabla con los datos\n tablaMenu.setDefaultEditor(Object.class, null);\n tablaMenu.setModel(new DefaultTableModel(modelo, columnas));\n tablaMenu.setCellSelectionEnabled(false);\n tablaMenu.setRowSelectionAllowed(false);\n Object[] arregloPlatillos;\n // Si hay platillos que se puedan vender\n if (listaPlatilllos.size() > 0) {\n // Se guardan en el arreglo\n arregloPlatillos = listaPlatilllos.toArray();\n modeloLista = new DefaultComboBoxModel(arregloPlatillos);\n comboPlatillos.setModel(modeloLista);\n // Si es horario de comidas\n if (this.categoría.equals(\"COMIDA\")) {\n // Consulta la sopa del día\n this.sopaDelDia = Control.menu.consultarSopaDia(diaSemana);\n // si hay una sopa establecida en el menú\n if (sopaDelDia != null) {\n // Se habilita el checkbox y se establece el nombre\n checkBoxSopa.setEnabled(true);\n checkBoxSopa.setText(sopaDelDia.getNombre());\n } else {\n checkBoxSopa.setEnabled(false);\n checkBoxSopa.setText(\"SOPA NO ESTABLECIDA\");\n }\n } else {\n checkBoxSopa.setEnabled(false);\n }\n \n }//Si no\n else {\n \n // Se guarda un solo valor indicando el resultado de la búsqueda\n arregloPlatillos = new Object[1];\n arregloPlatillos[0] = \"-------SIN PLATILLOS DISPONIBLES------\";\n modeloLista = new DefaultComboBoxModel(arregloPlatillos);\n comboPlatillos.setModel(modeloLista);\n // Se desactivan todos los componentes\n //desactivarComponentes(this);\n }\n }",
"public void listar_saldoData(String data_entrega,String tipo_pedido){\n \n \n OrdemCorteDAO dao = new OrdemCorteDAO();\n DefaultTableModel model = (DefaultTableModel) jTable_Saldo.getModel(); \n \n model.setNumRows(0);\n \n for (OrdemCorteDTO mp : dao.getSaldoVendaCorte(data_entrega, tipo_pedido)) {\n \n model.addRow(new Object[]{mp.getCodigo(), mp.getTotal()});\n }\n \n \n }",
"public NuevaOrden() {\n initComponents();\n this.setTitle(\"Nueva orden\");\n this.setIconImage(img.getImage());\n this.setLocationRelativeTo(null);\n control = FachadaControl.getInstance();\n modelTablaBusqueda = (DefaultTableModel) tablaProductos.getModel();\n modelTablaOrden = (DefaultTableModel) tablaOrden.getModel();\n }",
"private void cargaLista() {\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Aclaracion\", \"Aclaracion\"));\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Revision\", \"Revision\"));\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Revocatoria\", \"Revocatoria\"));\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Subsidiaria\", \"Subsidiaria\"));\n \n }",
"public void popularTabela() {\n\n try {\n\n RelatorioRN relatorioRN = new RelatorioRN();\n\n ArrayList<PedidoVO> pedidos = relatorioRN.buscarPedidos();\n\n javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) tRelatorio.getModel();\n dtm.fireTableDataChanged();\n dtm.setRowCount(0);\n\n for (PedidoVO pedidoVO : pedidos) {\n\n String[] linha = {\"\" + pedidoVO.getIdpedido(), \"\" + pedidoVO.getData(), \"\" + pedidoVO.getCliente(), \"\" + pedidoVO.getValor()};\n dtm.addRow(linha);\n }\n\n } catch (SQLException sqle) {\n\n JOptionPane.showMessageDialog(null, \"Erro: \" + sqle.getMessage(), \"Bordas\", JOptionPane.ERROR_MESSAGE);\n \n } catch (Exception e) {\n\n JOptionPane.showMessageDialog(null, \"Erro: \" + e.getMessage(), \"Bordas\", JOptionPane.ERROR_MESSAGE);\n }\n }",
"public void Tabla_Credito(int numero, String campo) {\r\n DefaultTableModel modelo = new DefaultTableModel();\r\n String[] cabeceras = new String[]{\"Cod_Venta\", \"Abonado\", \"Total\"};\r\n modelo.setColumnIdentifiers(cabeceras);\r\n switch (numero) {\r\n case 1:\r\n CadSql = \"SELECT c.cod_venta, c.abono, c.total FROM credito c, clientes cli WHERE cli.id=c.id_cliente AND cli.rut='\" + campo + \"';\";\r\n break;\r\n case 2:\r\n CadSql = \"SELECT c.cod_venta, c.abono, c.total FROM credito c, clientes cli WHERE cli.id=c.id_cliente AND cli.rut='\" + campo + \"';\";\r\n break;\r\n }\r\n try {\r\n String[] datos = new String[3];\r\n Statement st = this.cn.createStatement();\r\n ResultSet rs = st.executeQuery(CadSql);\r\n while (rs.next()) {\r\n datos[0] = rs.getString(1);\r\n datos[1] = rs.getString(2);\r\n datos[2] = rs.getString(3);\r\n modelo.addRow(datos);\r\n }\r\n if (numero == 1) {\r\n tbIngresoAbonos.setModel(modelo);\r\n } else if (numero == 2) {\r\n tblistadoclientescredito.setModel(modelo);\r\n }\r\n\r\n //if(numero==1){interfaz_venta_.tbventa.setModel(modelo);}else{interfaz_administracion.tblistado.setModel(modelo);}\r\n } catch (Exception ex) {\r\n //JOptionPane.showMessageDialog(null, ex);\r\n }\r\n }",
"public void buscaxcodigo() {\r\n try {\r\n modelo.setCodigobarras(vista.jTbcodigobarras.getText());//C.P.M mandamos el codigo de barras ingresado\r\n rs = modelo.Buscarxcodigobarras();//C.P.M mandamos a consultar ese codigo de barras\r\n DefaultTableModel buscar = new DefaultTableModel() {//C.P.M instanciamos el modelo de la tabla\r\n @Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {\r\n return false;\r\n }\r\n };\r\n vista.jTbuscar.setModel(buscar);//C.P.M le mandamos el modelo a la tabla\r\n modelo.estructuraProductos(buscar);//C.P.M obtenemos la estructura de la tabla \"Encabezados\"\r\n ResultSetMetaData rsMd = rs.getMetaData();//C.P.M obtenemos los metadatos de la consulta\r\n int cantidadColumnas = rsMd.getColumnCount();//C.P.M obtenemos las columnas de la consulta\r\n\r\n while (rs.next()) {//C.P.M recorremos el resultado\r\n Object[] fila = new Object[cantidadColumnas];//C.P.M creamos un vector con el tamano de las columnas de el resultado\r\n for (int i = 0; i < cantidadColumnas; i++) {//C.P.M recorremos el arreglo\r\n fila[i] = rs.getObject(i + 1);//C.P.M y vamos insertando el resultado\r\n }\r\n buscar.addRow(fila);//C.P.M le mandamos el arreglo como renglon nuevo\r\n }\r\n\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al buscar por codigo de barras\");\r\n }\r\n }",
"public void cargarTabla(String servidor){\n String base_de_datos=\"Renta de Autos\";\n String sql =\"USE [\"+base_de_datos+\"]\\n\" +\n \"SELECT name FROM sysobjects where xtype='U' and name='Clientes' \";\n Conexion cc = new Conexion();\n Connection cn=cc.conectarBase(servidor, base_de_datos);\n \n try {\n Statement psd = cn.createStatement();\n ResultSet rs=psd.executeQuery(sql);\n while(rs.next()){\n cbTablas.addItem(rs.getString(\"name\"));\n }\n }catch(Exception ex){\n JOptionPane.showMessageDialog(null, ex+\" al cargar tabla\");\n }\n }",
"public tiendaJF() {\n initComponents();\n \n boolean conectado = tiendaBo.conectar();\n ResultSet rs = tiendaBo.listar();\n if(!conectado)///Mensaje de error\n JOptionPane.showMessageDialog(null, \"Falló conexion a BD\");\n \n jTableProductos.addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent Mouse_evt){\n JTable jTableProductos = (JTable) Mouse_evt.getSource();\n Point point = Mouse_evt.getPoint();\n int row = jTableProductos.rowAtPoint(point);\n if (Mouse_evt.getClickCount()==1){\n campo1.setText(jTableProductos.getValueAt(jTableProductos.getSelectedRow(), 8).toString());\n }\n }\n });\n }",
"private void selectAll() {\n //To change body of generated methods, choose Tools | Templates.\n \n tabelpulsa.setModel(model);\n model.getDataVector().removeAllElements();\n model.fireTableDataChanged();\n \n \n try {\n Connection c=koneksidb.getkoneksi();\n Statement s=c.createStatement();\n ResultSet r=s.executeQuery(\"select* from pulsa\");\n while(r.next()){\n Object[] pulsa = new Object[5]; \n pulsa[0]=r.getString(\"operator\");\n pulsa[1]=r.getString(\"id_pulsa\");\n pulsa[2]=r.getString(\"harga_default\");\n pulsa[3]=r.getString(\"harga_jual\");\n pulsa[4]=r.getString(\"harga_member\");\n model.addRow(pulsa);\n }\n }catch (SQLException e){\n System.out.println(\"terjadi error :\" +e);\n }\n }",
"public void cargarTitulos1() throws SQLException {\n\n tabla1.addColumn(\"CLAVE\");\n tabla1.addColumn(\"NOMBRE\");\n tabla1.addColumn(\"DIAS\");\n tabla1.addColumn(\"ESTATUS\");\n\n this.tbpercep.setModel(tabla1);\n\n TableColumnModel columnModel = tbpercep.getColumnModel();\n\n columnModel.getColumn(0).setPreferredWidth(15);\n columnModel.getColumn(1).setPreferredWidth(150);\n columnModel.getColumn(2).setPreferredWidth(50);\n columnModel.getColumn(3).setPreferredWidth(70);\n\n }",
"public DefaultTableModel Ordernar() {\n String sql;\n sql = \"SELECT idempleado,empleados.documento,nombre,apellido,sueldo,trabajo FROM empleados,personas WHERE empleados.documento=personas.documento ORDER BY idempleado\";\n try {\n setTitulos();\n PS = con.Conectarse().prepareStatement(sql);\n rst = PS.executeQuery();\n Object[] fila = new Object[6];\n while (rst.next()) {\n fila[0] = rst.getInt(\"idempleado\");\n fila[1] = rst.getString(\"documento\");\n fila[2] = rst.getString(\"nombre\");\n fila[3] = rst.getString(\"apellido\");\n fila[4] = rst.getDouble(\"sueldo\");\n fila[5] = rst.getString(\"trabajo\");\n DIM.addRow(fila);\n }\n\n } catch (SQLException e) {\n Toolkit.getDefaultToolkit().beep();\n JOptionPane.showMessageDialog(null, \"NO EXISTEN DATOS\", \"AVISO\", JOptionPane.INFORMATION_MESSAGE);\n }\n return DIM;\n }",
"public void populateListaObjetos() {\n listaObjetos.clear();\n Session session = HibernateUtil.getSessionFactory().openSession();\n try {\n String tipo = null;\n if (selectedTipo.equals(\"submenu\")) {\n tipo = \"menu\";\n } else if (selectedTipo.equals(\"accion\")) {\n tipo = \"submenu\";\n }\n\n Criteria cObjetos = session.createCriteria(Tblobjeto.class);\n cObjetos.add(Restrictions.eq(\"tipoObjeto\", tipo));\n Iterator iteObjetos = cObjetos.list().iterator();\n while (iteObjetos.hasNext()) {\n Tblobjeto o = (Tblobjeto) iteObjetos.next();\n listaObjetos.add(new SelectItem(new Short(o.getIdObjeto()).toString(), o.getNombreObjeto(), \"\"));\n }\n } catch (HibernateException e) {\n //logger.throwing(getClass().getName(), \"populateListaObjetos\", e);\n } finally {\n session.close();\n }\n }",
"public void ActaulizarTabla() {\n int id = Integer.parseInt(txtId.getText());\n int unidad = Integer.parseInt(txtUsuario.getText());\n String placa = txtCorreo.getText();\n\n try {\n PreparedStatement ps = null;\n ResultSet rs = null;\n Conexion obj_con = new Conexion();\n Connection con = obj_con.getConexion();\n String SQL = \"UPDATE `carros` SET `nro_unidad`=?,`placa`=?,`color`=?,`id_marca`=?,`id_modelo`=?,`cant_puestos`=?,`ano_unidad`=?,`estatus_table`=?,`id_estado_actual`=? WHERE `id_unidad`=?\";\n ps = con.prepareStatement(SQL);\n\n ps.setInt(1, unidad);////////////////////////////YA///////////////////////\n ps.setString(2, placa);\n ps.setInt(10, id);\n System.out.println(ps);\n ps.execute();\n JOptionPane.showMessageDialog(null, \"Registro Modificado Exitosamente\");\n //limpiar();\n this.dispose();\n tabla.setVisible(true);\n //tabla.cargarDatos(); \n \n int Fila = tabla.jTableVehiculos.getSelectedRow();\n /*obtener el nro de fila sellecioando*/\n System.out.println(Fila);\n Object[] filas = new Object[7]; //OBJETO PARA CREAR FILA NUEVA GUARDADA EN LA TABLA\n filas[0] = txtUsuario.getText();\n filas[1] = txtCorreo.getText();\n \n modelTable.addRow(filas);\n tabla.jTableVehiculos.setModel(modelTable);\n \n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error al guardar registro\");\n System.err.println(e.toString());\n } \n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tabla1 = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Consulta general productos\");\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n\n tabla1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n },\n new String [] {\n \"Clave\", \"Nombre del producto\", \"Tipo de producto\", \"Precio del producto\" , \"Tamaño del producto\" , \"Existencia\"\n }\n ));\n jScrollPane1.setViewportView(tabla1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 779, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)\n );\n\n pack();\n setLocationRelativeTo(null);\n }",
"public void listar_mais_vendeu(String tipo_pedido){\n \n \n OrdemCorteDAO dao = new OrdemCorteDAO();\n DefaultTableModel model = (DefaultTableModel) jTable_MaisVendidas.getModel(); \n \n model.setNumRows(0);\n \n for (OrdemCorteDTO mp : dao.getMaisVendeu(tipo_pedido)) {\n \n model.addRow(new Object[]{mp.getCodigo(), mp.getTotal_vendido()});\n }\n \n \n }",
"public NuevoPrestamo() {\n initComponents();\n \n modeloHer = new DefaultTableModel();\n modeloPer = new DefaultTableModel();\n herramientasTable.setModel(modeloHer);\n personalTable.setModel(modeloPer);\n modeloHer.setColumnIdentifiers(titulosHer);\n modeloPer.setColumnIdentifiers(titulosPer);\n \n try {\n herramientas = herImp.lista_herramientas();\n for(Herramienta her : herramientas){\n Object[]o = new Object[4];\n o[0] = her.getCodigoProducto();\n o[1] = her.getNombre();\n o[2] = her.getDescripcion();\n o[3] = her.getCantidadDisponible();\n \n modeloHer.addRow(o);\n }\n } catch (Exception e) {\n System.out.println(\"Error al mostrar las herramientas en la tabla\");\n }\n \n try {\n listaPersonal = perImp.lista_personal();\n for(Personal per : listaPersonal){\n Object[]o = new Object[3];\n o[0] = per.getNombre();\n o[1] = per.getArea();\n o[2] = per.getPuesto();\n \n modeloPer.addRow(o);\n }\n } catch (Exception e) {\n System.out.println(\"Error al mostrar el personal en la tabla\");\n }\n \n }",
"public void StockSelect() {\n try {\n stat = cnct.createStatement();\n resst = stat.executeQuery(\"select product_ID, product_name, quantity from product\");\n tbStock.setModel(DbUtils.resultSetToTableModel(resst));\n } catch (SQLException ex) {\n Logger.getLogger(Others.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void filtrarTablaNomProducto(JTable table, String filtro) throws Conexion.DataBaseException {\n String[] titulos = {\"Id Producto\", \"Nombre Producto\", \"Tipo\", \"Cantidad en Stock\", \"Descripción\", \"Proveedor\", \"Precio\"};\n String[] registros = new String[7];\n DefaultTableModel model = new DefaultTableModel(null, titulos);\n String sql = \"SELECT * FROM Productos WHERE name LIKE '%\" + filtro + \"%'\";\n try {\n con = conectar.getConnexion();\n ps = con.prepareStatement(sql);\n rs = ps.executeQuery();\n while (rs.next()) {\n registros[0] = rs.getString(\"idProducto\"); //como se llama el campo en la base de datos\n registros[1] = rs.getString(\"name\");\n registros[2] = rs.getString(\"type\");\n registros[3] = rs.getString(\"quantity\");\n registros[4] = rs.getString(\"description\");\n registros[5] = rs.getString(\"idProveedor\");\n registros[6] = rs.getString(\"price\");\n model.addRow(registros);\n }\n table.setModel(model);\n } catch (SQLException e) {\n System.out.println(\"Error al buscar los datos: \" + e.getMessage());\n }\n }",
"private void preencherTabela() {\n\t\tList<Cidade> listCidade;\n\t\tCidadeDAO cidadeDAO;\n\t\tObservableList<Cidade> oListCidade;\n\n\t\t// Determina os atributos que irão preencher as colunas\n\t\tcolCidade.setCellValueFactory(new PropertyValueFactory<>(\"nomeCidades\"));\n\t\tcolEstado.setCellValueFactory(new PropertyValueFactory<>(\"nomeEstado\"));\n\t\tcolSigla.setCellValueFactory(new PropertyValueFactory<>(\"siglaEstado\"));\n\t\tcolCodigoCidade.setCellValueFactory(new PropertyValueFactory<>(\"idCidade\"));\n\t\tcolIdEstado.setCellValueFactory(new PropertyValueFactory<>(\"idEstado\"));\n\n\t\t// Instancia a lista de cidades e a DAO\n\t\tlistCidade = new ArrayList<Cidade>();\n\t\tcidadeDAO = new CidadeDAO();\n\n\t\t// Chama o metodo para selecionar todas as cidades e atribuir a lista\n\t\tlistCidade = cidadeDAO.selecionar();\n\n\t\t// Converte a lista de cidades em observablearray\n\t\toListCidade = FXCollections.observableArrayList(listCidade);\n\n\t\t// Adiciona a lista na tabela\n\t\ttblCidades.setItems(oListCidade);\n\t}",
"public ExibeTarefas() {\n initComponents();\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n jTable1.setRowSorter(new TableRowSorter(modelo));\n readJTable();\n readItemBox();\n }",
"private void cargarColumnasTabla(){\n \n modeloTabla.addColumn(\"Nombre\");\n modeloTabla.addColumn(\"Telefono\");\n modeloTabla.addColumn(\"Direccion\");\n }",
"private void selectData() {\n String kolom[] = {\"NIS\", \"NamaSiswa\", \"TempatLahir\", \"TanggalLahir\", \"JenisKelamin\", \"Kelas\", \"Email\", \"Alamat\"};\n DefaultTableModel dtm = new DefaultTableModel(null, kolom);\n String SQL = \"SELECT * FROM t_siswa\";\n ResultSet rs = KoneksiDB.executeQuery(SQL);\n try {\n while (rs.next()) {\n String NIS = rs.getString(1);\n String NamaSiswa = rs.getString(2);\n String TempatLahir = rs.getString(3);\n String TanggalLahir = rs.getString(4);\n String JenisKelamin = \"\";\n if (\"L\".equals(rs.getString(5))) {\n JenisKelamin = \"Laki-Laki\";\n } else {\n JenisKelamin = \"Perempuan\";\n }\n String Kelas = rs.getString(6);\n String Email = rs.getString(7);\n String Alamat = rs.getString(8);\n String data[] = {NIS, NamaSiswa, TempatLahir, TanggalLahir, JenisKelamin, Kelas, Email, Alamat};\n dtm.addRow(data);\n }\n } catch (SQLException ex) {\n Logger.getLogger(frmMain.class).log(Level.SEVERE, null, ex);\n }\n tblData.setModel(dtm); //To change body of generated methods, choose Tools | Templates.\n }",
"private void setUpSelect(){\n\t\tEPFuncion fun = new EPFuncion();\n\t\tEPPropiedad pro = new EPPropiedad();\n\t\tArrayList<EPExpresion> exps = new ArrayList<>();\n\t\t//seteamos la propiedad de la funcion.\n\t\tpro.setNombre(\"a1.p1\");\n\t\tpro.setPseudonombre(\"\");\n\t\t//metemos la propiedad en la funcion.\n\t\texps.add(pro);\n\t\tfun.setExpresiones(exps);\n\t\t//seteamos la funcion con el resto de valores.\n\t\tfun.setNombreFuncion(\"f1\");\n\t\tfun.setPseudonombre(\"fun1\");\n\t\t//metemos la funcion en la lista del select.\n\t\texpresionesSelect.add(fun);\n\t\t//seteamos el resto de propiedades.\n\t\tpro = new EPPropiedad();\n\t\tpro.setNombre(\"a1.p2\");\n\t\tpro.setPseudonombre(\"pro2\");\n\t\texpresionesSelect.add(pro);\n\t\tpro = new EPPropiedad();\n\t\tpro.setNombre(\"a1.p3\");\n\t\tpro.setPseudonombre(\"pro3\");\n\t\texpresionesSelect.add(pro);\n\t}",
"public Complementos() {\n initComponents();\n String cabecera []={\"Producto\",\"Precio\"};\nString datos[][]={};\nboolean t=true;\nboolean f=false;\nmodelo = new Tablachida(datos,cabecera);\ntabla.setModel(modelo);\nTableColumnModel columnModel = tabla.getColumnModel();\ncolumnModel.getColumn(0).setPreferredWidth(250);\ntabla.setRowHeight(40);\n\n }",
"private JTable itensNaoPagos() {\n\t\tinitConexao();\n\t\t\n try {\t \n\t String select = \"SELECT cod_item_d, nome_item_d, valor_item_d, data_vencimento_item_d FROM Item_despesa WHERE vencimento_item_d = '0'\";\n\t PreparedStatement ptStatement = c.prepareStatement(select);\n\t rs = ptStatement.executeQuery();\n\t \n\t Object[] colunas = {\"Item de despesa\", \"Valor total\", \"Data do vencimento\", \"\", \"code\"}; \t\t\n\t\t\t DefaultTableModel model = new DefaultTableModel();\t\t \n\t\t\t model.setColumnIdentifiers(colunas); \t\t \n\t\t\t Vector<Object[]> linhas = new Vector<Object[]>(); \n\t\t\t \n\t\t\t \n\t while (rs.next()){\n\t\t linhas.add(new Object[]{rs.getString(\"nome_item_d\"),rs.getString(\"valor_item_d\"),rs.getString(\"data_vencimento_item_d\"), \"Pagar\", rs.getString(\"cod_item_d\")}); \t \t\n\t \t } \n\t \n\t\t\t for (Object[] linha : linhas) { \n\t\t model.addRow(linha); \n\t\t } \t\t \n\t\t\t final JTable tarefasTable = new JTable(); \t\t \n\t\t\t tarefasTable.setModel(model); \t\t\n\t\t\t \n\t\t\t ButtonColumn buttonColumn = new ButtonColumn(tarefasTable, 3, \"itemPedido\");\n\t\t\t \n\t\t\t tarefasTable.removeColumn(tarefasTable.getColumn(\"code\")); \t \n\t return tarefasTable; \n } catch (SQLException ex) {\n System.out.println(\"ERRO: \" + ex);\n }\n\t\treturn null; \n\t}",
"public void preencherTabelaResultado() {\n\t\tArrayList<Cliente> lista = Fachada.getInstance().pesquisarCliente(txtNome.getText());\n\t\tDefaultTableModel modelo = (DefaultTableModel) tabelaResultado.getModel();\n\t\tObject[] linha = new Object[4];\n\t\tmodelo.setRowCount(0);\n\n\t\tfor (Cliente c : lista) {\n\t\t\tlinha[0] = c.getIdCliente();\n\t\t\tlinha[1] = c.getNome();\n\t\t\tlinha[2] = c.getTelefone().toString();\n\t\t\tif (c.isAptoAEmprestimos())\n\t\t\t\tlinha[3] = \"Apto\";\n\t\t\telse\n\t\t\t\tlinha[3] = \"A devolver\";\n\t\t\tmodelo.addRow(linha);\n\n\t\t}\n\n\t}",
"public PromocionTableModel() {\n \n //Establecemos la sentencia SQL que vamos a ejecutar\n super(\"SELECT ID_PROMOCION , NOMBRE, DESCUENTO FROM PROMOCION\");\n \n }",
"public void selecteazaComanda()\n {\n for(String[] comanda : date) {\n if (comanda[0].compareTo(\"insert client\") == 0)\n clientBll.insert(idClient++, comanda[1], comanda[2]);\n else if (comanda[0].compareTo(\"insert product\") == 0)\n {\n Product p = productBll.findProductByName(comanda[1]);\n if(p!=null)//daca produsul exista deja\n productBll.prelucreaza(p.getId(), comanda[1], Float.parseFloat(comanda[2]), Float.parseFloat(comanda[3]));\n else\n productBll.prelucreaza(idProduct++, comanda[1], Float.parseFloat(comanda[2]), Float.parseFloat(comanda[3]));\n\n }\n else if (comanda[0].contains(\"delete client\"))\n clientBll.sterge(comanda[1]);\n else if (comanda[0].contains(\"delete product\"))\n productBll.sterge(comanda[1]);\n else if (comanda[0].compareTo(\"order\")==0)\n order(comanda);\n else if (comanda[0].contains(\"report\"))\n report(comanda[0]);\n }\n }",
"public void Buscar(){\n String consulta=\"\";\n try {\n tb_Grupo1.setModel(new DefaultTableModel());\n String titulos[]={\"Codigo\",\"Forma de Pago\",\"Descripcion Forma de pago\",\"CPT\",\"Descripcion Nomenclatura\",\"Precio\",\"\",\"\"};\n m=new DefaultTableModel(null,titulos);\n JTable p=new JTable(m);\n String fila[]=new String[8];\n\n Caja_Precio obj=new Caja_Precio();\n consulta=\"exec Caja_Precios_BUSCAR ?\";\n \n PreparedStatement cmd = obj.getCn().prepareStatement(consulta);\n cmd.setString(1, buscartodo.getText());\n ResultSet r= cmd.executeQuery();\n int c=1;\n while(r.next()){\n fila[0]=r.getString(1); // id de hc\n fila[1]=r.getString(2); // codigo de hc\n fila[2]=r.getString(3);\n fila[3]=r.getString(4);\n fila[4]=r.getString(5);\n fila[5]=r.getString(6);\n fila[6]=r.getString(7);\n fila[7]=r.getString(8);\n\n m.addRow(fila);\n c++;\n }\n tb_Grupo1.setModel(m);\n TableRowSorter<TableModel> elQueOrdena=new TableRowSorter<TableModel>(m);\n tb_Grupo1.setRowSorter(elQueOrdena);\n this.tb_Grupo1.setModel(m);\n\n formato();\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }",
"public void alerta() {\r\n try {\r\n rs = modelo.Alerta();//C.P.M consultamos los producto con alerta en existencia\r\n DefaultTableModel alerta = new DefaultTableModel() {//C.P.M Creamos el modelo de nuestra tabla\r\n @Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {//C.P.M le decimos que no seran editables los componetnes\r\n return false;\r\n }\r\n };\r\n vista.Talertas.setModel(alerta);//C.P.M le mandamos el modelo a la tabla de la vista\r\n modelo.estructuraAlrta(alerta);//C.P.M obtenemos la estructura de la tabla \"los encabezados\"\r\n ResultSetMetaData rsMd = rs.getMetaData();//C.P.M Obtenemos los metadatos para obtener la cantidad del columnas que llegan\r\n int cantidadColumnas = rsMd.getColumnCount();//C.P.M la cantidad la alojamos dentro de un entero\r\n while (rs.next()) {//C.P.M recorremos la informacion obtenida\r\n Object[] fila = new Object[cantidadColumnas];//C.P.M creamos un arreglo con el tamano de el resultado\r\n for (int i = 0; i < cantidadColumnas; i++) {//C.P.M lo recorremos \r\n fila[i] = rs.getObject(i + 1);//C.P.M y insertamos los valores que trajo del modelo\r\n }\r\n alerta.addRow(fila);//C.P.M agregamos el arreglo como una nueva fila dentro de la tabla\r\n }\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al consultar los producto con alerta\");\r\n }\r\n }",
"public void fill_table()\n {\n Secante secante = new Secante(GraficaSecanteController.a, GraficaSecanteController.b, GraficaSecanteController.ep, FuncionController.e);\n list = secante.algoritmo();\n }"
] | [
"0.7448676",
"0.71476233",
"0.7110609",
"0.7063502",
"0.7035647",
"0.69687974",
"0.6955667",
"0.69260997",
"0.683008",
"0.68252236",
"0.6801255",
"0.6785039",
"0.67708015",
"0.675181",
"0.6740188",
"0.67388946",
"0.67237633",
"0.67221385",
"0.6707901",
"0.6696837",
"0.66908306",
"0.6678692",
"0.6661752",
"0.6655267",
"0.6651873",
"0.664584",
"0.66413945",
"0.6633598",
"0.6614909",
"0.6580903",
"0.65672517",
"0.65654653",
"0.6559235",
"0.65582633",
"0.6536626",
"0.65331954",
"0.6523449",
"0.652153",
"0.6517312",
"0.6502737",
"0.65014195",
"0.65007824",
"0.6497306",
"0.64929664",
"0.6492342",
"0.6482716",
"0.64649236",
"0.64641696",
"0.6444683",
"0.64406526",
"0.64400566",
"0.6432783",
"0.64306396",
"0.64160305",
"0.6414821",
"0.6408001",
"0.64064956",
"0.6404466",
"0.6403543",
"0.64028126",
"0.63890797",
"0.63888305",
"0.638875",
"0.63808525",
"0.6378935",
"0.6376506",
"0.6368952",
"0.63671845",
"0.63645196",
"0.6350075",
"0.6347174",
"0.6345896",
"0.63455176",
"0.63448817",
"0.6342148",
"0.63413596",
"0.634055",
"0.63396305",
"0.6334005",
"0.6330712",
"0.6330083",
"0.63287216",
"0.6327528",
"0.63239056",
"0.63238627",
"0.6321247",
"0.6317157",
"0.63151556",
"0.63145274",
"0.63133067",
"0.63115144",
"0.6308149",
"0.63038945",
"0.62967765",
"0.62911916",
"0.6290753",
"0.6282583",
"0.6267061",
"0.62659293",
"0.6257421",
"0.6252476"
] | 0.0 | -1 |
Metodo para modificar el email y/o telefono de los empleados usando su id | public void modificarempleado(Empleado empleado)throws SQLException{
Connection conexion = null;
try{
conexion = GestionSQL.openConnection();
if(conexion.getAutoCommit()){
conexion.setAutoCommit(false);
}
EmpleadosDatos empleadodatos = new EmpleadosDatos();
empleadodatos.update(empleado);
conexion.commit();
System.out.println("Empleado modificado con exito");
}catch(SQLException e){
System.out.println("Error en modificacion de empleado");
e.printStackTrace();
try{
conexion.rollback();
}catch(SQLException ex){
ex.printStackTrace();
System.out.println("Error en rollback, vamos a morir todos");
ex.printStackTrace();
}
}finally{
if(conexion != null){
conexion.close();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void actualizarUsuario(Integer id, String nombre, long documento, String email, Boolean activo) throws Exception;",
"public void alterar() {\n //metodo para alterar\n String sql = \"UPDATE empresa SET empresa = ?, cnpj = ?, \"\n + \"endereco = ?, telefone = ?, email = ? WHERE (id = ?)\";\n try {\n pst = conexao.prepareStatement(sql);\n pst.setString(1, txtEmpNome.getText());\n pst.setString(2, txtEmpCNPJ.getText());\n pst.setString(3, txtEmpEnd.getText());\n pst.setString(4, txtEmpTel.getText());\n pst.setString(5, txtEmpEmail.getText());\n pst.setString(6, txtEmpId.getText());\n if ((txtEmpNome.getText().isEmpty()) || (txtEmpCNPJ.getText().isEmpty())) {\n JOptionPane.showMessageDialog(null, \"Preencha todos os campos obrigatórios\");\n } else {\n //a linha abaixo atualiza a tabela usuarios com os dados do formulario\n // a esttrutura abaixo confirma a ALTERACAO dos dados na tabela\n int adicionado = pst.executeUpdate();\n if (adicionado > 0) {\n JOptionPane.showMessageDialog(null, \"Dados do cliente alterado com sucesso\");\n txtEmpNome.setText(null);\n txtEmpEnd.setText(null);\n txtEmpTel.setText(null);\n txtEmpEmail.setText(null);\n txtEmpId.setText(null);\n txtEmpCNPJ.setText(null);\n btnAdicionar.setEnabled(true);\n }\n }\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }",
"public void modificarUsuario(Long id, String nombre);",
"@Override\r\n\tpublic Loja editar(String nomeResponsavel, int telefoneEmpresa, String rua, String cidade, String estado, String pais,\r\n\t\t\tint cep, int cnpj, String razaoSocial, String email, String nomeEmpresa, String senha) {\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic void updateEmployeEmailById(int empid, String email) {\n\t\t\n\t}",
"public void editarEmpresa (Empresa empresa) throws Exception{\r\n\t\tEmpresa emp = daoEmpresa.buscarEmpresa(empresa.getId());\r\n\t\t\r\n\t\tif(emp != null){\r\n\t\t\tdaoEmpresa.editarEmpresa(empresa);\r\n\t\t}else{\r\n\t\t\tthrow new ExcepcionNegocio(\"No hay empresa registrada con este ID\");\r\n\t\t}\r\n\t}",
"public ModificarEmpleado() {\n initComponents();\n con=dbConnection.conectDB();\n llenarpuesto();\n llenaridentificacion();\n try {\n con.close();\n } catch (SQLException ex) {\n Logger.getLogger(ModificarEmpleado.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"private void modi() { \n try {\n cvo.getId_cliente();\n cvo.setNombre_cliente(vista.txtNombre.getText());\n cvo.setApellido_cliente(vista.txtApellido.getText());\n cvo.setDireccion_cliente(vista.txtDireccion.getText());\n cvo.setCorreo_cliente(vista.txtCorreo.getText());\n cvo.setClave_cliente(vista.txtClave.getText());\n cdao.actualizar(cvo);\n vista.txtNombre.setText(\"\");\n vista.txtApellido.setText(\"\");\n vista.txtDireccion.setText(\"\");\n vista.txtCorreo.setText(\"\");\n vista.txtClave.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Registro Modificado\");\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Debe ingresar Datos para Modificar registro!\");\n }\n }",
"private Long modificarTelefono(Telefono telefono) {\n\t\ttry {\n\t\t\tgTelefono.modify(telefono);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn telefono.getIdTelefono();\n\t}",
"public void modificarUsuario(Usuario usuario) {\n this.usuarioFacade.edit(usuario);\n }",
"public void editar() {\n try {\n ClienteDao fdao = new ClienteDao();\n fdao.Atualizar(cliente);\n\n JSFUtil.AdicionarMensagemSucesso(\"Cliente editado com sucesso!\");\n\n } catch (RuntimeException e) {\n JSFUtil.AdicionarMensagemErro(\"ex.getMessage()\");\n e.printStackTrace();\n }\n }",
"public boolean ModificarUsuario(String user, UsuarioDTO u) {\n Conexion c = new Conexion();\n PreparedStatement ps = null;\n String sql = \"UPDATE usuario SET nombre = ?, apellido = ?, descripcion = ?,\"\n + \"telefono = ?, direccion = ? , usuario = ?, email = ?, \"\n + \"fecha_nacimiento = ?, sexo=? WHERE id =\" + conocerID(user);\n try {\n ps = c.getConexion().prepareStatement(sql);\n UsuarioDTO tmp = conocerUsuario(user);\n ps.setString(1, (u.getNombre() != null) ? u.getNombre() : tmp.getNombre());\n ps.setString(2, (u.getApellido() != null) ? u.getApellido() : tmp.getApellido());\n ps.setString(3, (u.getDescripcion() != null) ? u.getDescripcion() : tmp.getDescripcion());\n ps.setString(4, (u.getTelefono() != null) ? u.getTelefono() : tmp.getTelefono());\n ps.setString(5, (u.getDireccion() != null) ? u.getDireccion() : tmp.getDireccion());\n ps.setString(6, (u.getUsuario() != null) ? u.getUsuario() : tmp.getUsuario());\n ps.setString(7, (u.getEmail() != null) ? u.getEmail() : tmp.getEmail());\n ps.setDate(8, (u.getFecha_Nacimiento().length()>0) ? Date.valueOf(u.getFecha_Nacimiento()) : Date.valueOf(tmp.getFecha_Nacimiento()));\n ps.setString(9, (u.getSexo() != null) ? u.getSexo() : tmp.getSexo());\n ps.executeUpdate();\n return true;\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n } finally {\n try {\n ps.close();\n c.cerrarConexion();\n } catch (Exception ex) {\n }\n }\n return false;\n }",
"public void modificar() {\n try {\n if(!fecha.equals(null)){\n Dr_siseg_usuarioBean usuario = new Dr_siseg_usuarioBean();\n FacesContext facesContext = FacesContext.getCurrentInstance();\n usuario = (Dr_siseg_usuarioBean) facesContext.getExternalContext().getSessionMap().get(\"usuario\");\n \n calendar.setTime((Date) this.fecha);\n this.Selected.setApel_fecha_sesion(calendar.getTime());\n\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n apelacionesDao.IME_APELACIONES(2, Selected); \n\n BitacoraSolicitudDao bitacoraSolicitudDao = new BitacoraSolicitudDao();//INSERTA EL MOVIMIENTO EN LA BITACORA\n BitacoraSolicitudBean bitacoraSolicitudBean = new BitacoraSolicitudBean();\n bitacoraSolicitudBean.setBit_sol_id(this.Selected.getApel_sol_numero());\n bitacoraSolicitudBean.setUsuarioBean(usuario);\n bitacoraSolicitudBean.setBit_tipo_movimiento(\"1\");\n bitacoraSolicitudBean.setBit_detalle(\"Fue modificada la apelacion\");\n bitacoraSolicitudDao.dmlDr_regt_bitacora_solicitud(bitacoraSolicitudBean);\n\n this.Listar();\n this.Selected = new ApelacionesBean();\n addMessage(\"Guadado Exitosamente\", 1);\n }else\n {\n addMessage(\"Es requerida la fecha\",1 );\n }\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n addMessage(\"Se produjo un error al insertar el registro, contacte al administrador del sistema\", 1);\n }\n }",
"public void editarHospede() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Nao existe hospedes cadastrados\\n\");\n } else {\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//hospede\n System.err.println(\"O que deseja editar:\\n Nome(1)\\n\"\n + \"Cpf(2)\\nE-MAIL(3)\");\n int a = verifica();\n switch (a) {\n case 1:\n System.err.println(\"Digite o novo nome do hospede:\\n\");\n String nome = ler.next();\n hospedesCadastrados.get(i).setNome(nome);\n System.err.println(\"Atualzacao concluida!\\n\");\n break;\n case 2:\n System.err.println(\"Digite o novo CPF do hospede:\\n\");\n int cpf1 = verifica();\n hospedesCadastrados.get(i).setCpf(cpf1);\n System.err.println(\"Atualzacao concluida!\\n\");\n break;\n case 3:\n System.err.println(\"Digite o novo E-MAIL do hospede:\\n\");\n String email = ler.next();\n hospedesCadastrados.get(i).setEmail(email);\n System.err.println(\"Atualzacao concluida!\\n\");\n break;\n }\n\n } else if (hospedesCadastrados.size() == i) {\n System.err.println(\"Nao existem hospedes com esse cpf cadastrados!\\n\");\n }\n }\n }\n }",
"public void setEmail(String p) { this.idcorreo = p; }",
"public void saveEmpleado(){\n \n //validor los campos antes de generar algún cambio\n if(!camposValidos()) {\n mFrmMantenerEmpleado.messageBoxAlert(Constant.APP_NAME, \"los campos no deben estar vacíos\");\n return;\n }\n \n //empleado nuevo\n boolean isUpdate=true;\n if(mEmpleado==null){ \n isUpdate=false; \n mEmpleado= new Empleado(); \n }\n \n \n mEmpleado.setFullNamePer(mFrmMantenerEmpleado.txtName.getText());//persona\n mEmpleado.setRucDNI(mFrmMantenerEmpleado.txtDniRuc.getText());//persona \n mEmpleado.setEdad((int)mFrmMantenerEmpleado.spnEdad.getValue());//persona\n mEmpleado.setTelefono(mFrmMantenerEmpleado.txtPhone.getText());//persona\n mEmpleado.setCorreo(mFrmMantenerEmpleado.txtEmail.getText());//persona\n mEmpleado.setDireccion(mFrmMantenerEmpleado.txtAddress.getText());//persona\n mEmpleado.setTipoEmpleado(mTipoEmpleadoList.get(mFrmMantenerEmpleado.cmbEmployeeType.getSelectedIndex()));//empleado\n mEmpleado.setSueldo((float)mFrmMantenerEmpleado.spnPayment.getValue());//empleado\n mEmpleado.setHorarioLaboralEmp(mFrmMantenerEmpleado.txtHorarioLaboral.getText());//empleado\n mEmpleado.setEstadoEmp(mFrmMantenerEmpleado.txtEstate.getText());//empleado\n \n \n \n //guardar o actualizar\n mEmpleado.save();\n \n this.mFrmMantenerEmpleado.messageBox(Constant.APP_NAME, (isUpdate?\"Se ha actualizado el empleado\":\"Se ha agregado un nuevo empleado al sistema\") );\n clear();\n }",
"public void modificar() {\r\n if (vista.jTNombreempresa.getText().equals(\"\") || vista.jTTelefono.getText().equals(\"\") || vista.jTRFC.getText().equals(\"\") || vista.jTDireccion.getText().equals(\"\")) {\r\n JOptionPane.showMessageDialog(null, \"Faltan Datos: No puede dejar cuadros en blanco\");//C.P.M Verificamos que todas las casillas esten llenas de lo contrario lo notificamos a el usuario\r\n } else {//C.P.M de lo contrario todo esta bien y prosegimos\r\n modelo.setNombre(vista.jTNombreempresa.getText());//C.P.M mandamos al modelo la informacion\r\n modelo.setDireccion(vista.jTDireccion.getText());\r\n modelo.setRfc(vista.jTRFC.getText());\r\n modelo.setTelefono(vista.jTTelefono.getText());\r\n \r\n Error = modelo.modificar();//C.P.M ejecutamos la funcion modificar del modelo y esperamos algun error\r\n if (Error.equals(\"\")) {//C.P.M si el error viene vacio es que no ocurrio algun error \r\n JOptionPane.showMessageDialog(null, \"La configuracion se modifico correctamente\");\r\n } else {//C.P.M de lo contrario lo notificamos a el usuario\r\n JOptionPane.showMessageDialog(null, Error);\r\n }\r\n }\r\n }",
"void actualizarExpedienteReplicado(Long idExpediente) throws NSJPNegocioException;",
"public ResultadoDTO modificarUsuario(String id, String nombre, UsuarioDTO usuarioDTO)throws IllegalArgumentException;",
"public boolean ModificarUsuario(Usuario creador, int id, String nombreMostrar, boolean admin,int tipoPersonal,int tipodescuento, boolean notas, boolean habilitacion,boolean profesor, int ciProfesor){\r\n if (creador.isAdmin()){\r\n try {\r\n String sql= \"Update sistemasEM.usuarios set mostrar=?, admin=?, permisosPersonal=?, permisosDescuento=?, notas=?, habilitacion=?, profesor=?,ciProfesor=? where id=\"+id;\r\n PreparedStatement s= connection.prepareStatement(sql);\r\n int i=1;\r\n s.setString(i++, nombreMostrar);\r\n s.setBoolean(i++, admin);\r\n s.setInt(i++, tipoPersonal);\r\n s.setInt(i++, tipodescuento);\r\n s.setBoolean(i++, notas);\r\n s.setBoolean(i++, habilitacion);\r\n s.setBoolean(i++, profesor);\r\n s.setInt(i++, ciProfesor);\r\n int result = s.executeUpdate();\r\n if(result>0){\r\n return true;\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ManejadorCodigoBD.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n return false;\r\n }",
"public void actualizarUsuario(String cedula,String name ,String lastname , String city ,String phone ,String email,String password) throws BLException;",
"@Override\n\t/*Método que se utilizará en el momento de modificar los datos de un usuario desde su panel de usuario*/\n\tpublic String modificarUsuario(String nombreusuario, String nombre,String apellidos,String clave,String email,String premium) {\n\t\tDBConnection con = new DBConnection();\n\t\tString sqldatos=\"select * from usuarios where nombreusuario LIKE '\"+nombreusuario+\"'\"; //selecciono los datos actuales del usuario\n\t\t\n\t\ttry {\n\t\t\tStatement st = con.getConnection().createStatement();\n\t\t\tResultSet rs = st.executeQuery(sqldatos);\n\t\t\t//Las siguientes variables guardarán los datos del usuario que tienen en la base de datos \n\t\t\tString nombrebd=\"\";\n\t\t\tString apellidosbd=\"\"; \n\t\t\tString clavebd= \"\"; \n\t\t\tString emailbd= \"\";\n\t\t\tString premiumbd=\"\";\n\t\t\twhile(rs.next()) {\n\t\t\t\tnombrebd=rs.getString(\"nombre\");\n\t\t\t\tapellidosbd= rs.getString(\"apellidos\"); \n\t\t\t\tclavebd= rs.getString(\"clave\"); \n\t\t\t\temailbd=rs.getString(\"email\");\n\t\t\t\tpremiumbd=rs.getString(\"premium\");\n\t\t\t}\n\t\t\t\n\t\t\t//en caso de que algunos de los campos de ese formulario NO estén completos, se pondrán los datos que ya se tenían en la BD relacionados con el mismo\n\t\t\t//si esto no se hiciese así, quedarían datos en blanco\n\t\t\tif(nombre.equals(\"\")) {\n\t\t\t\tnombre=nombrebd;\n\t\t\t}\n\t\t\tif(apellidos.equals(\"\")) {\n\t\t\t\tapellidos=apellidosbd;\n\t\t\t}\n\t\t\tif(clave.equals(\"\")) {\n\t\t\t\tclave=clavebd;\n\t\t\t}\n\t\t\tif(email.equals(\"\")) {\n\t\t\t\temail=emailbd;\n\t\t\t}\n\t\t\tif(premium.equals(\"\")) {\n\t\t\t\tpremium=premiumbd;\n\t\t\t}\n\t\t\t\n\t\t\tString sqlmodificacion=\"Update usuarios SET nombre='\"+nombre+\"', apellidos='\"+apellidos+\"',clave='\"+clave+\"', email='\"+email+\"', premium='\"+premium+\"' where nombreusuario LIKE '\"+nombreusuario+\"'\";\n\t\t\tst.executeQuery(sqlmodificacion); //se modifica el usuario \n\t\t\tst.close();\n\t\t\treturn \"OK\"; //se devuelve para mostrarse en la web este mensaje\n\t\t}catch(Exception e){\n\t\t\treturn e.getMessage();\n\t\t}finally{\n\t\t\tcon.desconectar();\n\t\t}\n\t}",
"@Override\r\n public ExpedienteGSMDTO editarExpedienteOrdenServicio(ExpedienteGSMDTO expedienteDTO, String codigoTipoSupervisor, PersonalDTO personalDest, UsuarioDTO usuarioDTO) throws ExpedienteException {\r\n LOG.error(\"editarExpediente\");\r\n ExpedienteGSMDTO retorno= new ExpedienteGSMDTO();\r\n try {\r\n PghExpediente registro = crud.find(expedienteDTO.getIdExpediente(), PghExpediente.class);\r\n registro.setIdFlujoSiged(new PghFlujoSiged(expedienteDTO.getFlujoSiged().getIdFlujoSiged()));\r\n registro.setIdProceso(new PghProceso(expedienteDTO.getProceso().getIdProceso()));\r\n registro.setIdObligacionTipo(new PghObligacionTipo(expedienteDTO.getObligacionTipo().getIdObligacionTipo()));\r\n registro.setAsuntoSiged(expedienteDTO.getAsuntoSiged());\r\n registro.setIdUnidadSupervisada(new MdiUnidadSupervisada(expedienteDTO.getUnidadSupervisada().getIdUnidadSupervisada()));\r\n registro.setIdEmpresaSupervisada(new MdiEmpresaSupervisada(expedienteDTO.getEmpresaSupervisada().getIdEmpresaSupervisada()));\r\n registro.setDatosAuditoria(usuarioDTO);\r\n if(expedienteDTO.getObligacionSubTipo()!=null && expedienteDTO.getObligacionSubTipo().getIdObligacionSubTipo()!=null){\r\n registro.setIdObligacionSubTipo(new PghObligacionSubTipo(expedienteDTO.getObligacionSubTipo().getIdObligacionSubTipo()));\r\n }else{\r\n registro.setIdObligacionSubTipo(null);\r\n }\r\n crud.update(registro);\r\n retorno = ExpedienteGSMBuilder.toExpedienteDto(registro); \r\n \r\n Long idLocador=codigoTipoSupervisor.equals(Constantes.CODIGO_TIPO_SUPERVISOR_PERSONA_NATURAL)?expedienteDTO.getOrdenServicio().getLocador().getIdLocador():null;\r\n Long idSupervisoraEmpresa=codigoTipoSupervisor.equals(Constantes.CODIGO_TIPO_SUPERVISOR_PERSONA_JURIDICA)?expedienteDTO.getOrdenServicio().getSupervisoraEmpresa().getIdSupervisoraEmpresa():null;\r\n \r\n String flagConfirmaTipoAsignacion=(!StringUtil.isEmpty(expedienteDTO.getFlagEvaluaTipoAsignacion())?Constantes.ESTADO_ACTIVO:null);\r\n OrdenServicioDTO OrdenServicioDTO=ordenServicioDAO.editarExpedienteOrdenServicio(expedienteDTO.getOrdenServicio().getIdOrdenServicio(), expedienteDTO.getOrdenServicio().getIdTipoAsignacion(), codigoTipoSupervisor, idLocador, idSupervisoraEmpresa, usuarioDTO,flagConfirmaTipoAsignacion);\r\n \r\n EstadoProcesoDTO estadoProcesoDto=estadoProcesoDAO.find(new EstadoProcesoFilter(Constantes.IDENTIFICADOR_ESTADO_PROCESO_OS_REGISTRO)).get(0);\r\n MaestroColumnaDTO tipoHistoricoOS=maestroColumnaDAO.findMaestroColumna(Constantes.DOMINIO_TIPO_COMPONENTE, Constantes.APLICACION_INPS, Constantes.CODIGO_TIPO_COMPONENTE_ORDEN_SERVICIO).get(0);\r\n HistoricoEstadoDTO historicoEstadoOS=historicoEstadoDAO.registrar(null, OrdenServicioDTO.getIdOrdenServicio(), estadoProcesoDto.getIdEstadoProceso(), expedienteDTO.getPersonal().getIdPersonal(), personalDest.getIdPersonal(), tipoHistoricoOS.getIdMaestroColumna(),null,null, null, usuarioDTO); \r\n LOG.info(\"historicoEstadoOS:\"+historicoEstadoOS);\r\n \r\n retorno.setOrdenServicio(new OrdenServicioDTO(OrdenServicioDTO.getIdOrdenServicio(),OrdenServicioDTO.getNumeroOrdenServicio()));\r\n \r\n }catch(Exception e){\r\n LOG.error(\"error en editarExpediente\",e);\r\n throw new ExpedienteException(e.getMessage(), e);\r\n }\r\n return retorno;\r\n }",
"@Override\n\tpublic void updateInformation(String firstname, String lastname, String email, int id) {\t\t\n\t\ttry {\n\t\t\tString sql = \"update employees set first_name = '\"+firstname+\"', last_name='\"+lastname+\"',email = '\"+email+\"' where employee_id=\"+id; \n\t\t\tConnection connection = DBConnectionUtil.getConnection();\n\t\t\tStatement statement = connection.createStatement();\t\t\n\t\t\tstatement.executeUpdate(sql);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n public void changeContact(String id,String pass,String newno) throws IOException\n {\n \tNode<Admin> pos = adm_list.getFirst();\n \twhile(pos!=null)\n \t{\n \t\tif(pos.getData().employee_id.equals(id) && pos.getData().password.equals(pass))\n \t\t{\n \t\t\tpos.getData().contact = newno;\n \t\t}\n \t\tpos = pos.getNext();\n \t}\n \twrite_adm_file();\n }",
"public void editar(AplicacionOferta aplicacionOferta){\n try{\n aplicacionOfertaDao.edit(aplicacionOferta);\n }catch(Exception e){\n Logger.getLogger(AplicacionOfertaServicio.class.getName()).log(Level.SEVERE, null, e);\n }\n }",
"public static void editar(Pessoa p) throws Exception\n {\n PreparedStatement stmt = Banco.query(\"UPDATE pessoa SET nome = ?, telefone = ?, email = ? WHERE id = ?\");\n\n stmt.setString(1, p.getNome());\n stmt.setString(2, p.getTelefone());\n stmt.setString(3, p.getEmail());\n stmt.setInt(4, p.getId());\n Banco.executar(stmt);\n }",
"@POST\n @Path(\"Editar\")\n @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})\n public String Editar (@FormParam(\"codigo\") Integer codigo, @FormParam(\"nif\") String nif , @FormParam(\"nombre\") String nombre , \n @FormParam(\"apellido1\") String apellido1 , @FormParam(\"apellido2\") String apellido2){\n Empleado objeto = super.find(codigo);\n \n objeto.setNif(nif);\n objeto.setNombre(nombre);\n objeto.setApellido1(apellido1);\n objeto.setApellido2(apellido2);\n \n super.edit(objeto);\n return \"Se edito con exito\";\n \n }",
"private void modificarPersona(PersonaDTO persona, Set<TelefonoDTO> telefonos, Set<DireccionDTO> direcciones,\n\t\t\tSet<CorreoElectronicoDTO> correos) throws CustomValidationException, CustomErrorException, Exception {\n\t\t//Recuperamos la persona\n\t\t//Verificamos cambio de DNI\n\t\tif (persona.getIdPersona() == null) {throw new CustomErrorException(CustomErrorException.ID_INEXISTENTE_PARA_MODIFICAR,this.getClass().getSimpleName());}\n\t\t\n\t\tPersonaDTO personaPersistente = obtenerPersona(persona.getIdPersona());\n\t\tif (!personaPersistente.getNroDni().equals(persona.getNroDni())) {\n\t\t\tif (gPersona.existePersonaPorDNI(persona.getNroDni())) {\n\t\t\t\tthrow new CustomValidationException(CustomValidationException.DNI_REPETIDO);\n\t\t\t};\n\t\t}\n\t\t\n\t\tSet<TelefonoDTO> nuevosTelefonos = new HashSet<TelefonoDTO>();\n\t\teliminarBorrados(telefonos,personaPersistente.getTelefonos());\n\t\tnuevosTelefonos.addAll(agregarNuevos(telefonos));\n\t\t//vuelvo a setear la lista en persona\n\t\tpersona.setTelefonos(null);\n\t\tSet <TelefonoDTO> telefonosPersona = new HashSet<TelefonoDTO>();\n\t\ttelefonosPersona.addAll(nuevosTelefonos);\n\t\tpersona.setTelefonos(telefonosPersona);\n\t\t\n\t\tSet<DireccionDTO> nuevasDirecciones = new HashSet<DireccionDTO>();\n\t\teliminarBorrados(direcciones, personaPersistente.getDirecciones());\n\t\tnuevasDirecciones.addAll(agregarNuevos(direcciones));\n\t\tpersona.setDirecciones(null);\n\t\tSet<DireccionDTO> direccionesPersona = new HashSet<DireccionDTO>();\n\t\tdireccionesPersona.addAll(nuevasDirecciones);\n\t\tpersona.setDirecciones(direccionesPersona); \n\t\t\n\t\tSet<CorreoElectronicoDTO> nuevosCorreos = new HashSet<CorreoElectronicoDTO>();\n\t\teliminarBorrados(correos, personaPersistente.getCorreos());\n\t\tnuevosCorreos.addAll(agregarNuevos(correos));\n\t\t//vuelvo a setear la lista en persona\n\t\tpersona.setCorreos(null);\n\t\tSet<CorreoElectronicoDTO> correosPersona = new HashSet<CorreoElectronicoDTO>();\n\t\tcorreosPersona.addAll(nuevosCorreos);\n\t\tpersona.setCorreos(correosPersona); \n\t\t\n\t\t// Llamo a modify para cerrar la operación;\n\t\tfor (TelefonoDTO t: telefonos) {\n\t\t\tt.setIdTelefono(modificarTelefono(Converter.toEntity(t))); \n\t\t}\n\t\t\n\t\tfor (DireccionDTO d: direcciones) {\n\t\t\td.setIdDireccion(modificarDireccion(Converter.toEntity(d)));\n\t\t}\n\t\t\n\t\tfor (CorreoElectronicoDTO c: correos) {\n\t\t\tc.setIdCorreoElectronico(modificarCorreoElectronico(Converter.toEntity(c)));\n\t\t}\n\t\t\n\t\tgPersona.modify(Converter.toEntity(persona));\n\t\t\n\t}",
"@Override\n\tpublic int updateEmployeeMailById(int employeeId, String email) {\n\t\tif (getEmployeeById(employeeId) == null) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn template.update(\"update employee set email = ? where empid = ?\", email, employeeId);\n\n\t\t}\n\t}",
"public void editarProveedor() {\n try {\n proveedorFacadeLocal.edit(proTemporal);\n this.proveedor = new Proveedor();\n FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, \"Proveedor editado\", \"Proveedor editado\"));\n } catch (Exception e) {\n \n }\n\n }",
"@Override\r\n\tpublic void updateEmail(Integer id, String email) {\n\t\t\r\n\t}",
"@Override\n public boolean modificar(ModelCliente cliente) {\n strSql = \"UPDATE CLIENTE \" +\n \"SET \" +\n \"NOMBRE = '\" + cliente.getNombre() + \"', \" +\n \"APELLIDO = '\" + cliente.getApellido()+ \"', \" + \n \"NIT = '\" + cliente.getNit() + \"', \" + \n \"TELEFONO = '\" + cliente.getTelefono() + \"', \" +\n \"DIRECCION = '\" + cliente.getDireccion()+ \"' \" +\n \"WHERE ID_CLIENTE = \" + cliente.getIdCliente()+\n \" AND ID_EMPRESA = \" + cliente.getIdEmpresa();\n try {\n //se abre una conexión hacia la BD\n conexion.open();\n //Se ejecuta la instrucción y retorna si la ejecución fue satisfactoria\n respuesta = conexion.executeSql(strSql);\n //Se cierra la conexión hacia la BD\n conexion.close();\n \n } catch (ClassNotFoundException ex) {\n Logger.getLogger(DaoCliente.class.getName()).log(Level.SEVERE, null, ex); \n return false;\n } catch(Exception ex){\n Logger.getLogger(DaoCliente.class.getName()).log(Level.SEVERE, null, ex); \n }\n return respuesta;\n }",
"protected void edit(HttpServletRequest request, HttpServletResponse response, EcAnonymousPaymentInfoForm _EcAnonymousPaymentInfoForm, EcAnonymousPaymentInfo _EcAnonymousPaymentInfo) throws Exception{\n\r\n _EcAnonymousPaymentInfo.setAnonymousUserId(WebParamUtil.getLongValue(_EcAnonymousPaymentInfoForm.getAnonymousUserId()));\r\n _EcAnonymousPaymentInfo.setFirstName(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getFirstName()));\r\n _EcAnonymousPaymentInfo.setMiddleInitial(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getMiddleInitial()));\r\n _EcAnonymousPaymentInfo.setLastName(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getLastName()));\r\n _EcAnonymousPaymentInfo.setAddress1(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getAddress1()));\r\n _EcAnonymousPaymentInfo.setAddress2(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getAddress2()));\r\n _EcAnonymousPaymentInfo.setCity(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getCity()));\r\n _EcAnonymousPaymentInfo.setState(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getState()));\r\n _EcAnonymousPaymentInfo.setZip(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getZip()));\r\n _EcAnonymousPaymentInfo.setCountry(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getCountry()));\r\n _EcAnonymousPaymentInfo.setPaymentType(WebParamUtil.getIntValue(_EcAnonymousPaymentInfoForm.getPaymentType()));\r\n _EcAnonymousPaymentInfo.setPaymentNum(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getPaymentNum()));\r\n _EcAnonymousPaymentInfo.setPaymentExpireMonth(WebParamUtil.getIntValue(_EcAnonymousPaymentInfoForm.getPaymentExpireMonth()));\r\n _EcAnonymousPaymentInfo.setPaymentExpireYear(WebParamUtil.getIntValue(_EcAnonymousPaymentInfoForm.getPaymentExpireYear()));\r\n _EcAnonymousPaymentInfo.setPaymentExtraNum(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getPaymentExtraNum()));\r\n _EcAnonymousPaymentInfo.setTimeCreated(WebParamUtil.getDateValue(_EcAnonymousPaymentInfoForm.getTimeCreated()));\r\n\r\n m_actionExtent.beforeUpdate(request, response, _EcAnonymousPaymentInfo);\r\n m_ds.update(_EcAnonymousPaymentInfo);\r\n m_actionExtent.afterUpdate(request, response, _EcAnonymousPaymentInfo);\r\n }",
"public void updateDetalleNominaEmpleado(DetalleNominaEmpleado entity)\n throws Exception;",
"public static void update(int id, String nome, String cognome, String email, String citta, Date dataNascita, String username, String password, int ruolo, Date dataSignup ) {\r\n\t\tMap<String, Object> map = new HashMap<String, Object>();\r\n \r\n \tmap.put(\"nome\", nome);\r\n \tmap.put(\"cognome\", cognome);\r\n \tmap.put(\"email\", email);\r\n \tmap.put(\"citta\", citta);\r\n \tmap.put(\"dataNascita\", dataNascita);\r\n \tmap.put(\"username\", username);\r\n \tmap.put(\"password\", crypt(password));\r\n \tmap.put(\"ruolo\", ruolo); // ruolo dell'utente normale \r\n \tmap.put(\"dataSignup\", dataSignup);\r\n\t\ttry {\r\n\t\t\tDatabase.connect();\r\n \t\tDatabase.updateRecord(\"utente\", map, \"utente.id=\"+id);\r\n \t\tDatabase.close(); \t\t\r\n\t\t}catch(NamingException e) {\r\n \t\tSystem.out.println(e);\r\n }catch (SQLException e) {\r\n \tSystem.out.println(e);\r\n }catch (Exception e) {\r\n \tSystem.out.println(e); \r\n }\r\n\r\n\t}",
"public Empleado editarEmpleado(Empleado empleado) {\n\n try {\n empDAO.edit(empleado);\n return buscarEmpleado(empleado.getLegajo());\n } catch (NonexistentEntityException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return null;\n }",
"public void editar(Empleado empleado) {\n\t\tentityManager.getTransaction().begin();\n\t\tentityManager.merge(empleado);\n\t\tentityManager.getTransaction().commit();\n\t\t//JPAUtil.shutdown();\n\t}",
"@Override\n\tpublic Usuario modificar() {\n\t\tLOG.info(\"Se modifico el usuario de la bd\");\n\t\treturn usuario;\n\t}",
"private void actualizarUsuario() {\n\n\n if (!altura_et.getText().toString().isEmpty() && !peso_et.getText().toString().isEmpty() &&\n !email_et.getText().toString().isEmpty() && !nombreUO_et.getText().toString().isEmpty()) {\n\n user.setAltura(Integer.parseInt(altura_et.getText().toString()));\n user.setPeso(Integer.parseInt(peso_et.getText().toString()));\n user.setCorreo(email_et.getText().toString());\n user.setUserID(nombreUO_et.getText().toString());\n\n\n }else\n Toast.makeText(this,\"Comprueba los datos\", Toast.LENGTH_LONG).show();\n\n }",
"public String updateEmpregado() {\n this.empregadosFacade.edit(this.empregado);\n updateMB(empregado);\n\n return \"areaPessoal.xhtml?faces-redirect=true\";\n }",
"public String modificarUsuario() {\n\t\tString stringIdUsuario = session.getAttribute(\"id\").toString();\n\t\tInteger intIdUsuario = Integer.parseInt(stringIdUsuario);\n\t\t\n\t\tFacesContext con = FacesContext.getCurrentInstance();\n\t\tHttpServletRequest request = (HttpServletRequest) con.getExternalContext().getRequest();\n\t\tString cambioDeTexto = request.getParameter(\"myForm:texto\");\n\t\tString passwordViejo = request.getParameter(\"myForm:password\");\n\t\tString passwordNuevo = request.getParameter(\"myForm:passwordNuevo\");\n\t\tUsuario usuarioDb = usuarioService.buscarUsuarioPorId(intIdUsuario);\n\t\tif (usuarioDb != null) {\n\t\t\tif(usuarioService.validarNoCaracteresEspeciales(cambioDeTexto)==true) {\n\t\t\t\tString accion = \"Usuario \"+ usuarioDb.getEmail() + \" error al modificar texto.\";\n\t\t\t\tauditoriaService.registrarAuditoria(usuarioDb,accion);\n\t\t\t\terror =\"Campo texto no permitido\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror = usuarioService.usuarioModificaPasswordyTexto(cambioDeTexto, passwordViejo, passwordNuevo, intIdUsuario);\n\t\t\t}\n\t\t}\n\t\treturn \"home\";\n\t\t\n\t}",
"int updateContact(String email, String firstName, String lastName, String phone, String username);",
"public boolean ModificarProducto(int id,String nom,String fab,int cant,int precio,String desc,int sucursal) {\n boolean status=false;\n int res =0;\n try {\n conectar(); \n res=state.executeUpdate(\"update producto set nombreproducto='\"+nom+\"', fabricante='\"+fab+\"',cantidad=\"+cant+\",precio=\"+precio+\",descripcion='\"+desc+\"',idsucursal=\"+sucursal+\" where idproducto=\"+id+\";\");\n if(res>=1)\n {\n status=true;\n }\n con.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return status;\n }",
"@FXML\n\tvoid modificarPersona(ActionEvent event) {\n\t\tif (gestionando.equals(\"Empleado\")) {\n\t\t\tif (validarCampos()) {\n\t\t\t\tEmpleado empleado;\n\t\t\t\ttry {\n\t\t\t\t\templeado = administradorDelegado.modificarEmpleado(txtNombre.getText().trim(),\n\t\t\t\t\t\t\ttxtApellidos.getText().trim(), txtTelefono.getText().trim(), txtCorreo.getText().trim(),\n\t\t\t\t\t\t\ttxtDireccion.getText().trim(), txtCedula.getText().trim(), txtUsuario.getText().trim(),\n\t\t\t\t\t\t\ttxtContrasenia.getText().trim());\n\t\t\t\t\tif (empleado != null) {\n\t\t\t\t\t\tUtilidades.mostrarMensaje(\"Se ha cambiado la infarmacion correctamente\",\n\t\t\t\t\t\t\t\t\"Al empleado con el número de cedula \" + empleado.getCedula()\n\t\t\t\t\t\t\t\t\t\t+ \" se le ha cambiado la informacion correctamente.\");\n\t\t\t\t\t\tllenarTabla();\n\t\t\t\t\t\tvaciarCampos();\n\t\t\t\t\t}\n\t\t\t\t} catch (PersonaNoRegistradaException | TipoClaseException | ElementoNoEncontradoException\n\t\t\t\t\t\t| ElementoRepetidoException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\tUtilidades.mostrarMensaje(\"Error\", e.getMessage());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tUtilidades.mostrarMensaje(\"Error\", e.getMessage());\n\t\t\t\t}\n\n\t\t\t\t// TODO Auto-generated catch block\n\n\t\t\t}\n\t\t} else if (gestionando.equals(\"Recolector\")) {\n\t\t\tif (validarCampos()) {\n\t\t\t\ttry {\n\t\t\t\t\tRecolector recolector = administradorDelegado.modificarRecolector(txtNombre.getText().trim(),\n\t\t\t\t\t\t\ttxtApellidos.getText().trim(), txtTelefono.getText().trim(), txtCorreo.getText().trim(),\n\t\t\t\t\t\t\ttxtDireccion.getText().trim(), txtCedula.getText().trim(), txtUsuario.getText().trim(),\n\t\t\t\t\t\t\ttxtContrasenia.getText().trim());\n\t\t\t\t\tif (recolector != null) {\n\t\t\t\t\t\tUtilidades.mostrarMensaje(\"Se ha cambiado la infarmacion correctamente\",\n\t\t\t\t\t\t\t\t\"Al empleado con el número de cedula \" + recolector.getCedula()\n\t\t\t\t\t\t\t\t\t\t+ \" se le ha cambiado la informacion correctamente.\");\n\t\t\t\t\t\tllenarTabla();\n\t\t\t\t\t\tvaciarCampos();\n\t\t\t\t\t}\n\t\t\t\t} catch (PersonaNoRegistradaException | TipoClaseException | ElementoNoEncontradoException\n\t\t\t\t\t\t| ElementoRepetidoException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\tUtilidades.mostrarMensaje(\"Error\", e.getMessage());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tUtilidades.mostrarMensaje(\"Error\", e.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public boolean modifierCompte(int id, String nom, String prenom, String mdp, String email, String numrue, String codeP, String ville);",
"@Override\n\tpublic Usuario edit(Usuario obj) {\n\t\treturn null;\n\t}",
"public void ponerUsuarioInactivo(String idUsuario);",
"private void edit() {\r\n if (String.valueOf(txt_name.getText()).equals(\"\") || String.valueOf(txt_bagian.getText()).equals(\"\")|| String.valueOf(txt_address.getText()).equals(\"\")|| String.valueOf(txt_telp.getText()).equals(\"\")) {\r\n Toast.makeText(getApplicationContext(),\r\n \"Anda belum memasukan Nama atau ALamat ...\", Toast.LENGTH_SHORT).show();\r\n } else {\r\n SQLite.update(Integer.parseInt(txt_id.getText().toString().trim()),txt_name.getText().toString().trim(),\r\n txt_bagian.getText().toString().trim(),\r\n txt_address.getText().toString().trim(),\r\n txt_telp.getText().toString().trim());\r\n Toast.makeText(getApplicationContext(),\"Data berhasil di Ubah\",Toast.LENGTH_SHORT).show();\r\n blank();\r\n finish();\r\n }\r\n }",
"private void edit() {\n if (String.valueOf(tgl_pengobatanField.getText()).equals(null)\n || String.valueOf(waktu_pengobatanField.getText()).equals(null)) {\n Toast.makeText(getApplicationContext(),\n \"Ada Yang Belum Terisi\", Toast.LENGTH_SHORT).show();\n } else {\n SQLite.update(Integer.parseInt(idField.getText().toString().trim()),nama_pasien2,nama_dokter2, tgl_pengobatanField.getText().toString().trim(),waktu_pengobatanField.getText().toString(),\n keluhan_pasienField.getText().toString().trim(),hasil_diagnosaField.getText().toString().trim(),\n biayaField.getText().toString().trim());\n blank();\n finish();\n }\n }",
"public void editUser(int userId) {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"update t_user set nom=?,prenom=?,userName=?,pass=?,tel=?,type=? where=?\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setInt(7,userId);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().information(\"modification d'utilisateur fini avec succes\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec de modification d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public void zmienDaneUzytkownika() throws SQLException {\n String noweImie = userEdycjaNoweImie.getText().trim();\n String noweNazwisko = userEdycjaNoweNazwisko.getText().trim();\n String nowyEmail = userEdycjaNoweAdresEmail.getText().trim();\n String nowyNumerKontaktowy = userEdycjaNowyNumerKontaktowy.getText().trim();\n\n Driver.editUser(noweImie, noweNazwisko, nowyNumerKontaktowy, nowyEmail);\n }",
"private void recogerDatos() {\n\t\ttry {\n\t\t\tusuSelecc.setId(etId.getText().toString());\n\t\t\tusuSelecc.setName(etNombre.getText().toString());\n\t\t\tusuSelecc.setFirstName(etPApellido.getText().toString());\n\t\t\tusuSelecc.setLastName(etSApellido.getText().toString());\n\t\t\tusuSelecc.setEmail(etCorreo.getText().toString());\n\t\t\tusuSelecc.setCustomFields(etAuth.getText().toString());\n\t\t} catch (Exception e) {\n\t\t\t// Auto-generated catch block\n\t\t\tmostrarException(e.getMessage());\n\t\t}\n\t}",
"public void editarData(){\n\t\talunoTurmaService.inserirAlterar(alunoTurmaAltera);\n\t\t\n\t\t\n\t\tmovimentacao.setDataMovimentacao(alunoTurmaAltera.getDataMudanca());\n\t\tmovimentacaoService.inserirAlterar(movimentacao);\n\t\t\n\t\tFecharDialog.fecharDialogDATAAluno();\n\t\tExibirMensagem.exibirMensagem(Mensagem.SUCESSO);\n\t\talunoTurmaAltera = new AlunoTurma();\n\t\tmovimentacao = new Movimentacao();\n\t\t\n\t\tatualizarListas();\n\t}",
"@Override\n\tpublic Paciente modificar(Paciente t) {\n\t\treturn dao.save(t);\n\t}",
"public String editar()\r\n/* 59: */ {\r\n/* 60: 74 */ if ((getMotivoLlamadoAtencion() != null) && (getMotivoLlamadoAtencion().getIdMotivoLlamadoAtencion() != 0)) {\r\n/* 61: 75 */ setEditado(true);\r\n/* 62: */ } else {\r\n/* 63: 77 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_seleccionar\"));\r\n/* 64: */ }\r\n/* 65: 79 */ return \"\";\r\n/* 66: */ }",
"public static void actualizarRegistro(){\n int idActulizar = Integer.parseInt(JOptionPane.showInputDialog(\"Ingrese el ID a Actualizar\"));\n Scanner teclado = new Scanner(System.in); \n \n System.out.println(\"Actualizando.... \");\n //String anombre = teclado.nextLine();\n persona pa = new persona();\n pa.setNombre(teclado.nextLine());\n pa.setAp_paterno(teclado.nextLine());\n pa.setAp_materno(teclado.nextLine());\n pa.setDireccion(teclado.nextLine());\n pa.setSexo(teclado.nextLine());\n \n pd.actualizarPerosna(idActulizar, pa);\n // mostras los actualizados\n for (persona ps: pd.listaPersonas()){\n System.out.println(ps.getId()+ \" \"+\n ps.getNombre()+ \" \"+\n ps.getAp_paterno()+ \" \"+ \n ps.getAp_materno());\n }\n }",
"private void modificarProfesor(){\n \n System.out.println(\"-->> MODIFICAR PROFESOR\");\n int opcion;\n String nif=IO_ES.leerCadena(\"Inserte el nif del profesor\");\n if(ValidarCadenas.validarNIF(nif)){\n Profesor profesor=(Profesor) getPersona(LProfesorado, nif);\n if(profesor!=null){\n do{\n System.out.println(profesor);\n System.out.println(\"\\n1. Nombre\");\n System.out.println(\"2. Dirección\");\n System.out.println(\"3. Código Postal\");\n System.out.println(\"4. Teléfono\");\n System.out.println(\"5. Módulo\");\n System.out.println(\"0. Volver\");\n opcion=IO_ES.leerInteger(\"Inserte una opción: \", 0, 5);\n \n \n switch(opcion){\n \n case 1:\n actualizarNombre(profesor);\n break;\n case 2:\n actualizarDireccion(profesor);\n break;\n case 3:\n actualizarCodigoPostal(profesor);\n break;\n case 4:\n actualizarTelefono(profesor);\n break;\n case 5:\n actualizarModulo(profesor);\n break;\n \n \n }\n \n }while(opcion!=0);\n }\n else{\n System.out.println(\"El profesor no existe\");\n }\n \n }\n else {\n System.out.println(\"El nif no es válido\");\n }\n \n }",
"@Override\n\tpublic void editar(Cliente cliente) throws ExceptionUtil {\n\t\t\n\t}",
"@Transactional\n\t@Modifying(clearAutomatically = true)\n\t@Query(\"UPDATE Users t SET t.email =:newEmail WHERE t.id =:currentUser\")\n void editEmail(@Param(\"newEmail\") String newEmail, @Param(\"currentUser\") Integer currentUser);",
"@Test\n\t@Transactional(value = TransactionMode.ROLLBACK)\n\t@UsingDataSet({ \"persona.json\", \"registro.json\", \"administrador.json\", \"cuenta.json\", \"empleado.json\",\n\t\t\t\"familia.json\", \"genero.json\", \"recolector.json\", \"planta.json\" })\n\tpublic void modificarEmpleadoTest() {\n\t\tEmpleado ad = entityManager.find(Empleado.class, \"125\");\n\t\tAssert.assertNotNull(ad);\n\t\tad.setNombre(\"Alfredo\");\n\t\tentityManager.merge(ad);\n\t\tad = null;\n\t\tad = entityManager.find(Empleado.class, \"125\");\n\t\tAssert.assertEquals(\"Alfredo\", ad.getNombre());\n\t}",
"public int modificar(Connection conn, alertas objeto) {\r\n\t\ttry {\r\n\r\n\t\t\tPreparedStatement statement = conn\r\n\t\t\t\t\t.prepareStatement(\"update alertas set DESCRIPCION = ?, FECHA_INI = ?, FECHA_FIN = ?, ESTADO = ?, DESCRIPCION2 = ? where ID_ALERTA = ?\");\r\n\t\t\tstatement.setString(1, objeto.getDescripcion());\r\n\t\t\tstatement.setString(2, objeto.getFechaInicio());\r\n\t\t\tstatement.setString(3, objeto.getFechaDinalizacion());\r\n\t\t\tstatement.setString(4, objeto.getEstado());\r\n\t\t\tstatement.setString(5, objeto.getDescripcion2());\r\n\t\t\tstatement.setInt(6, objeto.getAlerta());\r\n\t\t\tstatement.execute();\r\n\t\t\tstatement.close();\r\n\t\t\tJOptionPane.showMessageDialog(null,\r\n\t\t\t\t\t\"Se ha Modificado un Registro! \", \"Aviso!\",\r\n\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn 1;\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t\tJOptionPane.showMessageDialog(null, \"No se Modificó Registro :\"\r\n\t\t\t\t\t+ e.getMessage(), \"Alerta!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t}",
"public void pesquisarEmail() {\n\t\tif (this.alunoDao.pesquisar(this.emailPesquisa) != null) {\n\t\t\tAluno alunoAtual = this.alunoDao.pesquisar(this.emailPesquisa);\n\t\t\tthis.alunos.clear();\n\t\t\tthis.alunos.add(alunoAtual);\n\t\t\tthis.quantPesquisada = this.alunos.size();\n\t\t} else {\n\t\t\tFacesContext.getCurrentInstance().addMessage(null,\n\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_ERROR, \"\", \" email inválido \"));\n\t\t}\n\t}",
"public boolean modificarOferta(String establecimieto, int id, java.util.Date fechaI, java.util.Date fechaF, String desc) {\n\t\tboolean resultado = false;\n\t\ttry {\n\t\t\tPreparedStatement sentencia = \n\t\t\t\tconexion.prepareStatement(\"update ofertas \"\n\t\t\t\t\t\t+ \"set fechaI = ?, fechaF = ?, descrip = ? \"\n\t\t\t\t\t\t+ \"where id = ? and establec = ?\");\n\t\t\tsentencia.setDate(1, new Date(fechaI.getTime()));\n\t\t\tsentencia.setDate(2, new Date(fechaF.getTime()));\n\t\t\tsentencia.setString(3, desc);\n\t\t\tsentencia.setInt(4, id);\n\t\t\tsentencia.setString(5, establecimieto);\n\t\t\tint r = sentencia.executeUpdate();\n\t\t\tif(r==1) {\n\t\t\t\tresultado = true;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn resultado;\n\t}",
"@Override\n public String modificarAlumno(Alumno alumno, String apellidos, String nombres, String cx) {\n\t\tif( alumno == null || ( apellidos == null && nombres == null && cx == null )){\n\t\t\treturn ERROR_MOD_ALUMNO;\n\t\t}\n\t\t\n\t\t//Si algun parametro es nulo no lo modificamos.\n\t\tif( apellidos != null && !apellidos.isEmpty()){\n\t\t\talumno.setApellidos(apellidos);\n\t\t}\n\n\t\tif( nombres != null && !nombres.isEmpty() ){\n\t\t\talumno.setNombres(nombres);\n\t\t}\n\t\t\n\t\tif( cx != null && !cx.isEmpty()){\n\t\t\talumno.setCx(cx);\n\t\t}\t\t\n\t\t\n\t\treturn SUCCESS_MOD_ALUMNO;\n\t}",
"private Long modificarCorreoElectronico(CorreoElectronico correo) {\n\t\ttry {\n\t\t\t gCorreoElectronico.modify(correo);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn correo.getIdCorreoElectronico();\n\t}",
"@FXML\r\n private void editar(ActionEvent event) {\n selecionado = tabelaCliente.getSelectionModel()\r\n .getSelectedItem();\r\n\r\n //Se tem algum cliente selecionado\r\n if (selecionado != null) { //tem clienteonado\r\n //Pegar os dados do cliente e jogar nos campos do\r\n //formulario\r\n textFieldNumeroCliente.setText(\r\n String.valueOf( selecionado.getIdCliente() ) );\r\n textfieldNome.setText( selecionado.getNome() ); \r\n textFieldEmail.setText(selecionado.getEmail());\r\n textFieldCpf.setText(selecionado.getCpf());\r\n textFieldRg.setText(selecionado.getRg());\r\n textFieldRua.setText(selecionado.getRua());\r\n textFieldCidade.setText(selecionado.getCidade());\r\n textFieldBairro.setText(selecionado.getBairro());\r\n textFieldNumeroCasa.setText(selecionado.getNumeroCasa());\r\n textFieldDataDeNascimento.setValue(selecionado.getDataNascimemto());\r\n textFieldTelefone1.setText(selecionado.getTelefone1());\r\n textFieldTelefone2.setText(selecionado.getTelefone2());\r\n textFieldCep.setText(selecionado.getCep());\r\n \r\n \r\n \r\n }else{ //não tem cliente selecionado na tabela\r\n mensagemErro(\"Selecione um cliente.\");\r\n }\r\n\r\n }",
"public int Editcomp(Long comp_id, String compname, String address, String city,\r\n\t\tString state, Long offno, Long faxno, String website, String e_mail) throws SQLException {\nint i =DbConnect.getStatement().executeUpdate(\"update company set address='\"+address+\"',city='\"+city+\"',state='\"+state+\"',offno=\"+offno+\",faxno=\"+faxno+\",website='\"+website+\"',email='\"+e_mail+\"'where comp_id=\"+comp_id+\" \");\r\n\treturn i;\r\n}",
"@Override\n\tpublic int editarCliente(ClienteBean cliente) throws Exception {\n\t\treturn 0;\n\t}",
"public void modificarPaciente(String idpac, String dni, String nom, String ape, String dir, String ubig, String tel1, String tel2, String edad)\n {\n try\n {\n PreparedStatement pstm=(PreparedStatement)\n con.getConnection().prepareStatement(\"UPDATE paciente SET DNI='\"+dni+\"' , nombres='\"+nom+\"', apellidos='\"+ape+\"', direccion='\"+dir+\"', ubigeo='\"+ubig+\"', telefono1='\"+tel1+\"', telefono2='\"+tel2+\"', edad='\"+edad+\"' WHERE IdPaciente='\"+idpac+\"'\");\n pstm.executeUpdate();\n pstm.close();\n }\n catch(SQLException e)\n {\n System.out.println(e);\n }\n }",
"private void verificaIdade() {\r\n\t\thasErroIdade(idade.getText());\r\n\t\tisCanSave();\r\n\t}",
"@Override\n\tpublic Cliente editarCliente(Integer idcliente) {\n\t\treturn clienteDao.editarCliente(idcliente);\n\t}",
"@Override\r\n public boolean ActualizarDatosCliente() {\r\n try {\r\n puente.executeUpdate(\"UPDATE `cliente` SET `Nombre` = '\"+Nombre+\"', `Apellido` = '\"+Apellido+\"', `Telefono` = '\"+Telefono+\"', `Fecha_Nacimiento` = '\"+Fecha_Nacimiento+\"', `Email` = '\"+Email+\"', `Direccion` = '\"+Direccion+\"', `Ciudad` = '\"+Ciudad+\"' WHERE `cliente`.`Cedula` = '\"+Cedula+\"';\");\r\n listo = true;\r\n } catch (Exception e) {\r\n Logger.getLogger(DaoCliente.class.getName()).log(Level.SEVERE, null, e);\r\n }\r\n return listo;\r\n }",
"public void peleaEn(int idPeleador,int idEmpresa){\n\t\t\n\t}",
"public int Edituser(Long userid, Long brokerId, String firstname,\r\n\t\tString lastname, String address, String city, String eMail, Long phone,\r\n\t\tLong pincode) throws SQLException {\n\tLong useridd=null;\r\n\trs=DbConnect.getStatement().executeQuery(\"select user_id from customer where login_id=\"+userid+\"\");\r\n\tif(rs.next())\r\n\t{\r\n\t\tuseridd=rs.getLong(1);\r\n\t}\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update customer set address='\"+address+\"',city='\"+city+\"',e_mail='\"+eMail+\"',phone=\"+phone+\",pincode=\"+pincode+\" where user_id=\"+useridd+\"\");\r\n\treturn i;\r\n}",
"@Modifying\n\t@Transactional\n\tInteger updateTipoUsuario(@Param(\"tipoUsuario\") TipoUsuario tipoUsuario, @Param(\"id\") Long id);",
"@PUT\n @Path(\"/{nom}/{login}\")\n public Response addUser(@PathParam(\"nom\") String nom, @PathParam(\"login\") String login){\n DataAccess dataAccess = DataAccess.begin();\n EvenementEntity ee = dataAccess.getAllEvents()\n .stream()\n .filter(e -> e.getNom().equals(nom))\n .collect(Collectors.toList())\n .get(0);\n if(ee.getReservations().size() == ee.getPlace()) return Response.status(Response.Status.LENGTH_REQUIRED).entity(\"Le cours est plein\\nj\").build();\n try {\n ee.getReservations().add(dataAccess.getUserByLogin(login));\n dataAccess.updateEvent(ee);\n String TO_EMAIL = dataAccess.getUserByLogin(login).getEmail();\n EvenementEntity evenementEntity = null;\n for (EvenementEntity evenementEntity1 : dataAccess.getEventsByLogin(login)) {\n if(evenementEntity1.getNom().equals(nom)) {\n evenementEntity = evenementEntity1;\n }\n }\n System.out.println(\"TO EMAIL: \" + TO_EMAIL);\n SendMail sendMail = new SendMail(new Email(FROM_EMAIL), \"Evenement à venir\", new Email(TO_EMAIL), new Content());\n if(sendMail.sendMail(\"Félicitations ! Vous venez de vous inscrire au cours \" + nom + \". Le \" + evenementEntity.getDate() + \" à \" + evenementEntity.getHeure() + \" jusque \" + evenementEntity.getHeureFin() + \", au prix de \" + evenementEntity.getPrix() + \". Je vous attendrai !\")) {\n System.out.println(\"MAIL IS SEND TO \" + TO_EMAIL);\n }\n else {\n System.out.println(\"MAIL NOT SEND\");\n }\n dataAccess.closeConnection(true);\n return Response.status(Response.Status.NO_CONTENT).build();\n } catch (Exception e) {\n dataAccess.closeConnection(false);\n return Response.status(Response.Status.NOT_FOUND).entity(\"User not found\\n\").build();\n }\n }",
"public int modificarPresidente(int idpresi,int idcam,int idequipo, String nombre, String paterno,String materno,String dni,String fecNac,String fechaDirect,String telefono){\n sql=\"UPDATE presidente set idCampeonato='\"+idcam+\"', idEquipo='\"+idequipo+\"',Nombre_pres='\"+nombre+\"',Ap_presidente='\"+paterno+\"',Am_presidente='\"+materno+\"',Dni='\"+dni+\"',Fec_Nac='\"+fecNac+\"',Fecha_presidente='\"+fechaDirect+\"',Telefono='\"+telefono+\"' WHERE idPresidente='\"+idpresi+\"'\";\r\n \r\n try {\r\n cx = Conexion.coneccion();\r\n st = cx.createStatement();\r\n res = st.executeUpdate(sql);\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, \"Error: \"+e);\r\n }\r\n return res;\r\n }",
"private void actualizaUsuario() {\n\t\t\n\t\tInteger edad=miCoordinador.validarEdad(campoEdad.getText().trim());\n\t\t\n\t\tif (edad!=null) {\n\t\t\t\n\t\t\tUsuarioVo miUsuarioVo=new UsuarioVo();\n\t\t\t//se asigna cada dato... el metodo trim() del final, permite eliminar espacios al inicio y al final, en caso de que se ingresen datos con espacio\n\t\t\tmiUsuarioVo.setDocumento(campoDocumento.getText().trim());\n\t\t\tmiUsuarioVo.setNombre(campoNombre.getText().trim());\n\t\t\tmiUsuarioVo.setEdad(Integer.parseInt(campoEdad.getText().trim()));\n\t\t\tmiUsuarioVo.setProfesion(campoProfesion.getText().trim());\n\t\t\tmiUsuarioVo.setTelefono(campoTelefono.getText().trim());\n\t\t\tmiUsuarioVo.setDireccion(campoDireccion.getText().trim());\n\t\t\t\n\t\t\tString actualiza=\"\";\n\t\t\t//se llama al metodo validarCampos(), este retorna true o false, dependiendo de eso ingresa a una de las opciones\n\t\t\tif (miCoordinador.validarCampos(miUsuarioVo)) {\n\t\t\t\t//si se retornó true es porque todo está correcto y se llama a actualizar\n\t\t\t\tactualiza=miCoordinador.actualizaUsuario(miUsuarioVo);//en registro se almacena ok o error, dependiendo de lo que retorne el metodo\n\t\t\t}else{\n\t\t\t\tactualiza=\"mas_datos\";//si validarCampos() retorna false, entonces se guarda la palabra mas_datos para indicar que hace falta diligenciar los campos obligatorios\n\t\t\t}\n\t\t\t\n\t\t\t//si el registro es exitoso muestra un mensaje en pantalla, sino, se valida si necesita mas datos o hay algun error\n\t\t\tif (actualiza.equals(\"ok\")) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \" Se ha Modificado Correctamente \",\"Confirmación\",JOptionPane.INFORMATION_MESSAGE);\t\t\t\n\t\t\t}else{\n\t\t\t\tif (actualiza.equals(\"mas_datos\")) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Debe Ingresar los campos obligatorios\",\"Faltan Datos\",JOptionPane.WARNING_MESSAGE);\t\t\t\n\t\t\t\t}else{\n\t\t JOptionPane.showMessageDialog(null, \"Error al Modificar\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}\t\t\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\tJOptionPane.showMessageDialog(null, \"Debe ingresar una edad Valida!!!\",\"Advertencia\",JOptionPane.ERROR_MESSAGE);\n\t\t}\n\n\t\t\t\t\n\t}",
"public String editEmploye(Employee emp){\n System.out.println(\"******* Edit employe ************\");\n System.out.println(emp.toString());\n employeeService.editEmployee(emp);\n sessionController.logInEmp();\n\n return \"/pages/childCareCenterDashboard.xhtml?faces-redirect=true\";\n }",
"public void updateName() {\n try {\n userFound = clientefacadelocal.find(this.idcliente);\n if (userFound != null) {\n userFound.setNombre(objcliente.getNombre());\n clientefacadelocal.edit(userFound);\n objcliente = new Cliente();\n mensaje = \"sia\";\n } else {\n mensaje = \"noa\";\n System.out.println(\"Usuario No Encontrado\");\n }\n } catch (Exception e) {\n mensaje = \"noa\";\n System.out.println(\"El error al actualizar el nombre es \" + e);\n }\n }",
"public Usuario actualizar(RegistroActForm usuario, long idUsuario) throws AbadiaException {\n String sSQL;\r\n PreparedStatement ps = null;\r\n ResultSet rs = null;\r\n try {\r\n // Añadir el usuario en la tabla\r\n sSQL = \"Update usuario set IDIOMAID = ?, CONTRASENA=? , NOMBRE=? , APELLIDO1=? , APELLIDO2=? ,EDAD=?, PAIS=?, SEXO=? \" +\r\n \"WHERE USUARIOID= ?\";\r\n ps = con.prepareStatement(sSQL);\r\n ps.setInt(1, usuario.getIdioma());\r\n ps.setString(2, usuario.getPwd());\r\n ps.setString(3, usuario.getNombre());\r\n ps.setString(4, usuario.getApellido1());\r\n ps.setString(5, usuario.getApellido2());\r\n ps.setInt(6, usuario.getEdad());\r\n ps.setInt(7, usuario.getPais());\r\n ps.setInt(8, usuario.getSexo());\r\n ps.setLong(9, idUsuario);\r\n // Ejecutarlo\r\n ps.execute();\r\n return validar(usuario.getNick(), usuario.getPwd());\r\n } catch (SQLException e) {\r\n throw new AbadiaSQLException(\"adUsuario. actualizar. SQLException.\", e, log);\r\n } finally {\r\n DBMSUtils.cerrarObjetoSQL(rs);\r\n DBMSUtils.cerrarObjetoSQL(ps);\r\n }\r\n\r\n }",
"public void adicionar() {\n String sql = \"insert into empresa(empresa, cnpj, endereco, telefone, email) values (?,?,?,?,?)\";\n try {\n pst = conexao.prepareStatement(sql);\n pst.setString(1, txtEmpNome.getText());\n pst.setString(2, txtEmpCNPJ.getText());\n pst.setString(3, txtEmpEnd.getText());\n pst.setString(4, txtEmpTel.getText());\n pst.setString(5, txtEmpEmail.getText());\n // validacao dos campos obrigatorios\n if ((txtEmpNome.getText().isEmpty()) || (txtEmpCNPJ.getText().isEmpty())) {\n JOptionPane.showMessageDialog(null, \"Preencha todos os campos obrigatórios\");\n } else {\n //a linha abaixo atualiza a tabela usuarios com os dados do formulario\n // a esttrutura abaixo confirma a inserção na tabela\n int adicionado = pst.executeUpdate();\n if (adicionado > 0) {\n JOptionPane.showMessageDialog(null, \"Empresa adicionada com sucesso\");\n txtEmpNome.setText(null);\n txtEmpEnd.setText(null);\n txtEmpTel.setText(null);\n txtEmpEmail.setText(null);\n txtEmpCNPJ.setText(null);\n }\n }\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }",
"@Override\n public void editar(EntidadeBase entidade) throws EditarEntidadeException, ValidacaoEntidadeException, Exception {\n setOperacao(OPERACAO_EDITAR);\n // validar se os campos vêm todos bem preenchidos\n boolean isValido = validarCampos(entidade);\n\n // se estiver bem preenchido,\n // avança para a edição\n if (isValido) {\n\n lista.put(entidade.getCodigo(), entidade);\n } else {\n // senão, retorna erro\n throw new EditarEntidadeException();\n }\n }",
"public String ValidarDatosUpdate(List<EEmpresa> listEmpr,Integer tipoReg) throws Exception {\n String result = \"\";\n result = odEmpresa.ValidarDatosUpdate(listEmpr,tipoReg);\n return result;\n }",
"@Test\r\n public void testModificar() {\r\n System.out.println(\"modificar\");\r\n Integer idUsuario = null;\r\n String nombre = \"\";\r\n String apellido = \"\";\r\n String usuario = \"\";\r\n String genero = \"\";\r\n String contrasenia = \"\";\r\n String direccion = \"\";\r\n Usuario instance = new Usuario();\r\n instance.modificar(idUsuario, nombre, apellido, usuario, genero, contrasenia, direccion);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }",
"@Override\n\tpublic void editar(Contato contato) {\n\t\tthis.dao.editar(contato);\n\t\t\n\t}",
"@Override\n\tpublic Integer updateEmp(Integer id, String name) {\n\t\treturn null;\n\t}",
"protected void editarContato(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tSystem.out.println(request.getParameter(\"id\"));\n\t\tSystem.out.println(request.getParameter(\"nome\"));\n\t\tSystem.out.println(request.getParameter(\"telefone\"));\n\t\tSystem.out.println(request.getParameter(\"email\"));\n\t\t\n\n\t\t// fim do teste//\n\n\t\tcontato.setId(request.getParameter(\"id\"));\n\t\tcontato.setNome(request.getParameter(\"nome\"));\n\t\tcontato.setFone(request.getParameter(\"telefone\"));\n\t\tcontato.setEmail(request.getParameter(\"email\"));\n\t\t// executar o metodo alterarContato - execute method alterarContato\n\t\tdao.alterarContato(contato);\n\t\t// redirecionar para agenda.jsp - redirect to agenda.jsp\n\t\tresponse.sendRedirect(\"main\");\n\n\t}",
"public void setMailId(int v) \n {\n \n if (this.mailId != v)\n {\n this.mailId = v;\n setModified(true);\n }\n \n \n }",
"public void createPersonalInfos(JFrame jFrame, ControllerAdmin controllerAdminPersonalInfos){\n JLabel jLabelAcount = new JLabel(\"Compte\");\n jLabelAcount.setBounds(20, 20, 100, 28);\n\n JLabel jLabelId = new JLabel(\"Identifiant :\");\n jLabelId.setBounds(40, 50, 300, 28);\n JTextField jTextFieldId = new JTextField(controllerAdminPersonalInfos.getUser().getId());\n jTextFieldId.setBounds(40, 80, 300, 28);\n\n JLabel jLabelLastName = new JLabel(\"Nom :\");\n jLabelLastName.setBounds(40, 110, 300, 28);\n JTextField jTextFieldLastName = new JTextField(controllerAdminPersonalInfos.getUser().getLastName());\n jTextFieldLastName.setBounds(40, 140, 300, 28);\n\n JLabel jLabelFirstName = new JLabel(\"Prenom :\");\n jLabelFirstName.setBounds(40, 170, 300, 28);\n JTextField jTextFieldFirstName = new JTextField(controllerAdminPersonalInfos.getUser().getFirstName());\n jTextFieldFirstName.setBounds(40, 200, 300, 28);\n\n JLabel jLabelEmail = new JLabel(\"Email :\");\n jLabelEmail.setBounds(40, 230, 300, 28);\n JTextField jTextFieldEmail = new JTextField(controllerAdminPersonalInfos.getUser().getEmail());\n jTextFieldEmail.setBounds(40, 260, 300, 28);\n\n JLabel jLabelPassword = new JLabel(\"Mot de passe :\");\n jLabelPassword.setBounds(40, 290, 300, 28);\n JPasswordField jPasswordFieldPassword = new JPasswordField(controllerAdminPersonalInfos.getUser().getPassword());\n jPasswordFieldPassword.setBounds(40, 320, 300, 28);\n\n JButton jButtonModifPassword = new JButton(\"Modifier le mot de passe\");\n jButtonModifPassword.setBounds(350, 320, 200, 28);\n\n //set editabilite\n jTextFieldId.setEditable(false);\n jTextFieldLastName.setEditable(false);\n jTextFieldFirstName.setEditable(false);\n jTextFieldEmail.setEditable(false);\n jPasswordFieldPassword.setEditable(false);\n\n // Ajout des element à la JFrame\n jFrame.add(jLabelAcount);\n jFrame.add(jLabelId);\n jFrame.add(jTextFieldId);\n jFrame.add(jLabelLastName);\n jFrame.add(jTextFieldLastName);\n jFrame.add(jLabelFirstName);\n jFrame.add(jTextFieldFirstName);\n jFrame.add(jLabelEmail);\n jFrame.add(jTextFieldEmail);\n jFrame.add(jLabelPassword);\n jFrame.add(jButtonModifPassword);\n jFrame.add(jPasswordFieldPassword);\n\n jButtonModifPassword.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n createModifPassword(jFrame, controllerAdminPersonalInfos);\n jFrame.repaint();\n }\n });\n\n jFrame.setLayout(null);\n jFrame.setVisible(true);\n }",
"private void jbtnAlterarActionPerformed(java.awt.event.ActionEvent evt) {\n ArrayList<Fornecedor> array = new ArrayList<>();\n ArrayList<Endereco> array2 = new ArrayList<>();\n \n for(int i = 0; i < jtblFornecedor.getRowCount(); i++){\n Fornecedor fornecedor = new Fornecedor();\n Endereco endereco = new Endereco();\n fornecedor.setCodigo(Integer.parseInt(jtblFornecedor.getValueAt(i, 0).toString()));\n fornecedor.setNomeFornecedor(jtblFornecedor.getValueAt(i, 1).toString());\n fornecedor.setCpfFornecedor(jtblFornecedor.getValueAt(i, 2).toString());\n fornecedor.setCnpjFornecedor(jtblFornecedor.getValueAt(i, 3).toString());\n fornecedor.setTelefone(jtblFornecedor.getValueAt(i, 4).toString());\n endereco.setRua(jtblFornecedor.getValueAt(i, 5).toString());\n endereco.setNumero(jtblFornecedor.getValueAt(i, 6).toString());\n endereco.setBairro(jtblFornecedor.getValueAt(i, 7).toString());\n endereco.setCidade(jtblFornecedor.getValueAt(i, 8).toString());\n array.add(fornecedor);\n array2.add(endereco); \n }\n FornecedorControle fornecedorControle = new FornecedorControle(); \n try {\n fornecedorControle.updateFornecedor(array,array2);\n } catch (SQLException ex) {\n Logger.getLogger(JfrmAlterarFornecedor.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n JOptionPane.showMessageDialog(null, \"Alterações salvas com sucesso!\"); \n \n }",
"private void modifyActionPerformed(ActionEvent evt) throws Exception {\n String teaID = this.teaIDText.getText();\n String teaCollege = this.teaCollegeText.getText();\n String teaDepartment = this.teaDepartmentText.getText();\n String teaType = this.teaTypeText.getText();\n String teaPhone = this.teaPhoneText.getText();\n String teaRemark = this.teaRemarkText.getText();\n if(StringUtil.isEmpty(teaID)){\n JOptionPane.showMessageDialog(null, \"请先选择一条老师信息!\");\n return;\n }\n if(StringUtil.isEmpty(teaCollege)){\n JOptionPane.showMessageDialog(null, \"学院不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaDepartment)){\n JOptionPane.showMessageDialog(null, \"系不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaType)){\n JOptionPane.showMessageDialog(null, \"类型不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaPhone)){\n JOptionPane.showMessageDialog(null, \"手机不能为空!\");\n return;\n }\n if(!StringUtil.isAllNumber(teaPhone)){\n JOptionPane.showMessageDialog(null, \"请输入合法的手机号!\");\n return;\n }\n if(teaPhone.length() != 11){\n JOptionPane.showMessageDialog(null, \"请输入11位的手机号!\");\n return;\n }\n int confirm = JOptionPane.showConfirmDialog(null, \"确认修改?\");\n if(confirm == 0){//确认修改\n Teacher tea = new Teacher(teaID,teaCollege,teaDepartment,teaType,teaPhone,teaRemark);\n Connection con = dbUtil.getConnection();\n int modify = teacherInfo.updateInfo(con, tea);\n if(modify == 1){\n JOptionPane.showMessageDialog(null, \"修改成功!\");\n resetValues();\n }\n else{\n JOptionPane.showMessageDialog(null, \"修改失败!\");\n return;\n }\n initTable(new Teacher());//初始化表格\n }\n }",
"public DatosNombre actualizarNombre(DatosNombre nombreEmpleado) throws SQLException{\n DatosNombre empleadoNombre = null;\n Connection conexion = null;\n JDBCUtilities conex = new JDBCUtilities();\n \n try{\n conexion= conex.getConnection();\n\n String consulta = \"UPDATE empleado SET nombre=? \"\n + \"WHERE usuario=? and contrasenia=?\";\n \n\n PreparedStatement statement = conexion.prepareStatement(consulta);\n \n statement.setString(1, nombreEmpleado.getNombreNuevo());\n statement.setString(2, nombreEmpleado.getUsuario());\n statement.setString(3, nombreEmpleado.getContrasenia());\n \n statement.executeUpdate();\n\n //Cerrar interacciones con BD \n statement.close();\n\n //Si el proceso fue exitoso cambiar el estado\n empleadoNombre = nombreEmpleado;\n\n }catch(SQLException e){\n System.err.println(\"Error actualizando nombre empleado! \"+e);\n }finally{\n //Cierre del controlador\n if(conexion != null){\n conexion.close();\n }\n }\n return empleadoNombre; \n }",
"public VentanaModificarEmpleado(ControladorEmpleado controladorEmpleado) {\n initComponents();\n this.controladorEmpleado = controladorEmpleado;\n }",
"public boolean modificar(DueñoMascota pro) {\n PreparedStatement ps = null;\n Connection con = getConexion();\n\n \n String sql = \"UPDATE datos SET nom_dueño=?, ap_dueño=?, tel=?,nom_mascota=?,observaciones=? WHERE id_datos=? \";\n\n try {\n ps = con.prepareStatement(sql);\n // ps.setInt(1, pro.getId()); //NÚMERe almacena\n ps.setString(1, pro.getNomDueño());\n ps.setString(2, pro.getApDueño());\n ps.setInt(3, pro.getTel());\n ps.setString(4, pro.getNomMascota());\n ps.setString(5, pro.getObservaciones());\n ps.setInt(6, pro.getId());\n ps.execute();\n ps.close();\n return true;\n } catch (SQLException e) {\n System.err.println(e);\n return false;\n } finally {\n try {\n con.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n }\n }",
"public void save() {\r\n\t\tString checkQuery = \"SELECT * FROM users WHERE id = \" + this.id;\r\n\t\tStatement stm;\r\n\t\tResultSet rs = null;\r\n\t\ttry {\r\n\t\t\tconnection = DBConnection.getConnection();\r\n\t\t\tstm = connection.createStatement();\r\n\t\t\trs = stm.executeQuery(checkQuery);\r\n\t\t\t// istnieje już ten obiekt - update\r\n\t\t\tif (rs.first()) {\r\n\t\t\t\tString query = \"UPDATE users SET name = \" + toStringOrNULL(name)\r\n\t\t\t\t\t\t+ \", password = \" + toStringOrNULL(password)\r\n\t\t\t\t\t\t+ \", is_admin = \" + isAdmin \r\n\t\t\t\t\t\t+ \", removed_at = \" + toStringOrNULL(removedAt) \r\n\t\t\t\t\t\t+ \" WHERE id = \" + getId();\r\n\t\t\t\texecuteNonReturningQuery(query);\r\n\t\t\t}\r\n\t\t\t// jeszcze go nie ma - zapis nowego\r\n\t\t\telse {\r\n\t\t\t\tString query = \"INSERT INTO users (name, password, removed_at, is_admin) VALUES (\"\r\n\t\t\t\t\t\t+ toStringOrNULL(name) + \", \"\r\n\t\t\t\t\t\t+ toStringOrNULL(password) + \", \"\r\n\t\t\t\t\t\t+ toStringOrNULL(removedAt) + \", \"\r\n\t\t\t\t\t\t+ isAdmin + \")\";\r\n\t\t\t\texecuteNonReturningQuery(query);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tconnection.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void modifica(DTOAcreditacionGafetes acreGafete) throws Exception ;",
"public void modificar(Long id, G entity, HttpServletRequest httpRequest) throws AppException;",
"@Override\n\tpublic void modificarUsuario(UsuarioEntity Usuario) {\n\t\treposUsuarios.save(Usuario);\n\t}"
] | [
"0.71661204",
"0.7155286",
"0.7141362",
"0.70250356",
"0.68421197",
"0.6797204",
"0.6736452",
"0.67085654",
"0.6699466",
"0.64790136",
"0.646468",
"0.6414772",
"0.6399838",
"0.6390589",
"0.63222617",
"0.6303946",
"0.6290585",
"0.6289802",
"0.6285684",
"0.62812287",
"0.62698257",
"0.62442374",
"0.6237504",
"0.62278736",
"0.62210023",
"0.62175584",
"0.6194956",
"0.61906123",
"0.61814463",
"0.6179876",
"0.6166016",
"0.6156872",
"0.6151939",
"0.61517423",
"0.61407715",
"0.61320525",
"0.6107395",
"0.60783654",
"0.60686255",
"0.60228866",
"0.60102874",
"0.59951454",
"0.5942774",
"0.59396327",
"0.5929645",
"0.59284306",
"0.59280014",
"0.5921861",
"0.5911559",
"0.5910771",
"0.5910399",
"0.5907607",
"0.5905335",
"0.59019846",
"0.58980834",
"0.58960736",
"0.5890796",
"0.58771944",
"0.5875666",
"0.5867296",
"0.58668953",
"0.5864749",
"0.58591276",
"0.58522815",
"0.58509177",
"0.5849064",
"0.5846206",
"0.5844805",
"0.5842141",
"0.5826119",
"0.57960683",
"0.5787486",
"0.57863855",
"0.5779826",
"0.5776262",
"0.57741463",
"0.5761923",
"0.57501173",
"0.57487893",
"0.57436556",
"0.57408714",
"0.573669",
"0.5735173",
"0.5716956",
"0.5713647",
"0.5712231",
"0.5711389",
"0.57060415",
"0.5705005",
"0.57028824",
"0.570193",
"0.56932694",
"0.569305",
"0.56920284",
"0.569154",
"0.5691273",
"0.5684415",
"0.56757593",
"0.5675394",
"0.5672065"
] | 0.60315704 | 39 |
Metodo para borrar empleado de la BD usando su id | public void borrarempleado(Empleado empleado)throws SQLException{
Connection conexion = null;
try{
conexion = GestionSQL.openConnection();
if(conexion.getAutoCommit()){
conexion.setAutoCommit(false);
}
EmpleadosDatos empleadodatos = new EmpleadosDatos();
empleadodatos.delete(empleado);
conexion.commit();
System.out.println("Empleado borrado");
}catch(SQLException e){
System.out.println("Error en borrado, entramos a rollback");
try{
conexion.rollback();
}catch(SQLException ex){
System.out.println("Error en rollback");
}
}finally{
if(conexion != null){
conexion.close();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void eliminarUsuario(Long idUsuario);",
"public void eliminar(){\n conexion = base.GetConnection();\n try{\n PreparedStatement borrar = conexion.prepareStatement(\"DELETE from usuarios where Cedula='\"+this.Cedula+\"'\" );\n \n borrar.executeUpdate();\n // JOptionPane.showMessageDialog(null,\"borrado\");\n }catch(SQLException ex){\n System.err.println(\"Ocurrió un error al borrar: \"+ex.getMessage());\n \n }\n }",
"@Override\r\n public void eliminar(final Empleat entitat) throws UtilitatPersistenciaException {\r\n JdbcPreparedDao jdbcDao = new JdbcPreparedDao() {\r\n\r\n @Override\r\n public void setParameter(PreparedStatement pstm) throws SQLException {\r\n int field=0;\r\n pstm.setInt(++field, entitat.getCodi());\r\n }\r\n\r\n @Override\r\n public String getStatement() {\r\n return \"delete from Empleat where codi = ?\";\r\n }\r\n };\r\n UtilitatJdbcPlus.executar(con, jdbcDao);\r\n }",
"public void eliminarUsuario(String id) throws BLException;",
"public static void borrarEntidadPorId(int id){\r\n\t\tString query = \"DELETE FROM Evento WHERE id ='\" + id + \"'\";\r\n\r\n\t\ttry {\r\n\t\t\tConnection connection = ConexionMySQL.getConnection();\r\n\t\t\tStatement stmt = connection.createStatement();\r\n\t\t\tstmt.executeUpdate(query);\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void eliminar(Long id) throws AppException;",
"public void borrar(Especialiadad espe,JTextField txtcodigo ){\r\n\t\tConnection con = null;\r\n\t\tStatement stmt = null;\r\n\t\tint result = 0;\r\n\t\t\r\n\t\tSystem.out.println(txtcodigo.getText());\r\n\t\tString sql = \"DELETE FROM Especialiadad \"\r\n\t\t\t\t+ \"WHERE codigo = \"+ txtcodigo.getText();\r\n\t\t\t\t\r\n\t\ttry {\r\n\t\t\tcon = ConexionBD.getConnection();\r\n\t\t stmt = con.createStatement();\r\n\t\t result = stmt.executeUpdate(sql);\r\n\t\t//\tPreparedStatement ps= con.prepareStatement(sql);\r\n\t\t // ps.setInt(1, espe.getCodigo());\r\n\t\t // ps.setString(2, espe.getNombre());\r\n\t\t \t\t \r\n\t\t \r\n\t\t// ps.executeUpdate();\r\n\t\t \r\n\t\t} catch (Exception e) {\r\n\t\t e.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tConexionBD.close(con);\r\n\t\t}\r\n\t\t}",
"public void eliminar(){\n SQLiteDatabase db = conn.getWritableDatabase();\n String[] parametros = {cajaId.getText().toString()};\n db.delete(\"personal\", \"id = ?\", parametros);\n Toast.makeText(getApplicationContext(), \"Se eliminó el personal\", Toast.LENGTH_SHORT).show();\n db.close();\n }",
"@Override\n\tpublic void delete(int codigo) {\n\t\tSystem.out.println(\"Borra el empleado con \" + codigo + \" en la BBDD.\");\n\t}",
"public void deleteUsuario (int id);",
"public void deleteCita(int id){\n try {\n PreparedStatement preparedStatement = con.prepareStatement(\"DELETE FROM paciente WHERE id_paciente=?;\");\n preparedStatement.setInt(1,id);\n preparedStatement.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public void eliminar(String sentencia){\n try {\n Statement stmt = Conexion.getInstancia().createStatement();\n stmt.executeUpdate(sentencia);\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n }",
"private void remover() {\n int confirma = JOptionPane.showConfirmDialog(null, \"Tem certeza que deseja remover este cliente\", \"Atenção\", JOptionPane.YES_NO_OPTION);\n if (confirma == JOptionPane.YES_OPTION) {\n String sql = \"delete from empresa where id=?\";\n try {\n pst = conexao.prepareStatement(sql);\n pst.setString(1, txtEmpId.getText());\n int apagado = pst.executeUpdate();\n if (apagado > 0) {\n JOptionPane.showMessageDialog(null, \"Empresa removida com sucesso!\");\n txtEmpId.setText(null);\n txtEmpNome.setText(null);\n txtEmpTel.setText(null);\n txtEmpEmail.setText(null);\n txtEmpCNPJ.setText(null);\n }\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }\n }",
"@Override\r\n\tpublic void eliminar(Long idRegistro) {\n\t\t\r\n\t}",
"public static void eliminarEstudiante(String Nro_de_ID) {\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n Connection conexion = DriverManager.getConnection(\"jdbc:mysql://localhost/registrolaboratorios\", \"root\", \"admin\");\r\n System.out.print(\"Conexion Establecida\");\r\n Statement sentencia = conexion.createStatement();\r\n int insert = sentencia.executeUpdate(\"delete from estudiante where Nro_de_ID = '\" + Nro_de_ID + \"'\");\r\n\r\n sentencia.close();\r\n conexion.close();\r\n } catch (Exception ex) {\r\n System.out.print(\"Error en la conexion\" + ex);\r\n }\r\n }",
"void eliminar(PK id);",
"public void daoEliminar(int id) throws SQLException {\r\n\t\t\r\n\t\tPreparedStatement ps = con.prepareStatement(\"DELETE FROM miembros WHERE id=?\");\r\n\t\tps.setInt(1, id);\t\r\n\t\tps.executeUpdate();\r\n\t\tps.close();\r\n\t\t\r\n\t}",
"@Override\n\tpublic void DeleteLid(int id) throws Exception {\n try {\n \tConnection connect = getConnection();\n\n\n preparedStatement = connect.prepareStatement(\"DELETE FROM LEDEN WHERE Lid_id = ?;\");\n preparedStatement.setInt(1, id);\n\n preparedStatement.executeUpdate();\n System.out.println(\"Gelukt!\");\n connect.close();\n\n\n } catch (Exception e) {\n throw e;\n } finally {\n \tif (resultSet != null) {\n resultSet.close();\n }\n\n if (statement != null) {\n statement.close();\n }\n }\n\n }",
"public void delete(Employee employee) {\r\n\r\n String sql = \"delete from db.emp where id= ?\";\r\n try {\r\n Connection connection = ConnectDB();\r\n PreparedStatement preparedStatement = connection.prepareStatement(sql);\r\n preparedStatement.setInt(1,employee.getId());\r\n\r\n int rows=preparedStatement.executeUpdate();\r\n String message=rows==1 ? \"A fost sters cu succes\": \"Nu este nimic de sters\";\r\n\r\n System.out.println(message);\r\n\r\n } catch (SQLException Ex) {\r\n System.out.println(Ex.getMessage());\r\n System.out.println(\"Eroare la stergere\"+ Ex.getMessage());\r\n\r\n }\r\n }",
"@Override\n\t/**\n\t * Elimino un empleado.\n\t */\n\tpublic boolean delete(Object Id) {\n\t\treturn false;\n\t}",
"public void borrarcliente(ClienteHabitual cliente)throws SQLException{\n Connection conexion = null;\n \n try{\n conexion = GestionSQL.openConnection();\n if(conexion.getAutoCommit()){\n conexion.setAutoCommit(false);\n }\n ClientesHabitualesDatos clientesdatos = new ClientesHabitualesDatos();\n clientesdatos.delete(cliente);\n conexion.commit();\n System.out.println(\"Cliente borrado con exito\");\n }catch(SQLException e){\n e.printStackTrace();\n System.out.println(\"Error en borrado\");\n try{\n conexion.rollback();\n }catch(SQLException ex){\n System.out.println(\"Error en rollback\");\n }\n }finally{\n if(conexion != null){\n conexion.close();\n }\n }\n }",
"@Override\n public void excluir(Pessoa pessoa) {\n String sql = \"DELETE FROM pessoa WHERE uuid=?\";\n try {\n this.conexao = Conexao.abrirConexao();\n PreparedStatement statement = conexao.prepareStatement(sql);\n statement.setLong(1, pessoa.getId());\n statement.executeUpdate();\n } catch (SQLException ex) {\n Logger.getLogger(PessoasJDBC.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n Conexao.fecharConexao(conexao);\n }\n\n }",
"int deleteByPrimaryKey(String idTipoComprobante) throws SQLException;",
"public void borrarRegistro(int id) {\r\n\t\tSession ss = Util.getSessionFactory().openSession();\r\n\t\tTransaction tr = null;\r\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\r\n\t\tBufferedReader br = new BufferedReader(isr);\r\n\t\ttry {\r\n\t\t\ttr = ss.beginTransaction();\r\n\t\t\tPersona p = (Persona) ss.get(Persona.class, id);\r\n\t\t\tif (p != null) {\r\n\t\t\t\tSystem.out.println(\"Va a borrar \" + p.getId() + \" \"\r\n\t\t\t\t\t\t+ p.getNombre() + \" \" + p.getApellidos() + \" \"\r\n\t\t\t\t\t\t+ p.getDni());\r\n\t\t\t\tSystem.out.println(\"Está seguro si/no\");\r\n\t\t\t\tString respuesta = br.readLine();\r\n\t\t\t\tif (respuesta.equals(\"si\")) {\r\n\t\t\t\t\tss.delete(p);\r\n\t\t\t\t\ttr.commit();\r\n\t\t\t\t\tSystem.out.println(\"Registro borrado satisfactoriamente\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.println(\"No se ha borrado nada\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"No existe ese registro\");\r\n\t\t\t}\r\n\t\t} catch (HibernateException e) {\r\n\t\t\ttr.rollback();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tss.close();\r\n\t\t}\r\n\t}",
"private void eliminar() {\n\n int row = vista.tblClientes.getSelectedRow();\n cvo.setId_cliente(Integer.parseInt(vista.tblClientes.getValueAt(row, 0).toString()));\n int men = JOptionPane.showConfirmDialog(null, \"Estas seguro que deceas eliminar el registro?\", \"pregunta\", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);\n\n if (men == JOptionPane.YES_OPTION) {\n try {\n cdao.eliminar(cvo);\n cvo.setId_cliente(row);\n } catch (Exception e) {\n System.out.println(\"Mensaje eliminar\" + e.getMessage());\n }\n }\n }",
"@Override\n\tpublic void deletarEmpregado(long id) {\n\t\tempregadoRepository.deleteById(id);\n\t}",
"public static int delete(Periode p){ \n int status=0; \n try{ \n //membuka koneksi\n Connection con=Koneksi.openConnection(); \n //melakukan query database untuk menghapus data berdasarkan id atau primary key\n PreparedStatement ps=con.prepareStatement(\"delete from periode where id=?\"); \n ps.setInt(1,p.getId()); \n status=ps.executeUpdate(); \n }catch(Exception e){System.out.println(e);} \n\n return status; \n }",
"public static int delete(User u){ \n int status=0; \n try{ \n //membuka koneksi\n Connection con=Koneksi.openConnection(); \n //melakukan query database untuk menghapus data berdasarkan id atau primary key\n PreparedStatement ps=con.prepareStatement(\"delete from t_user where id=?\"); \n ps.setInt(1,u.getId()); \n status=ps.executeUpdate(); \n }catch(Exception e){System.out.println(e);} \n\n return status; \n }",
"void DeleteCompteUser(int id);",
"@Override\n\tpublic void deleteEmp(int id) {\n\t\tConnection con=null;\n\t\tPreparedStatement stmt=null;\n\t\t\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\n\t\tcon=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/ems?user=root&password=root\");\n\t\tString query=\"delete from employee where id=?\";\n\t\tstmt=con.prepareStatement(query);\n\t\tstmt.setInt(1, id);\n\t\tstmt.execute();\n\t\t\n\t\t\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"@Override\r\n public void elminarVehiculo(String placa) {\n Connection conn = null;\r\n try{\r\n conn = Conexion.getConnection();\r\n String sql = \"delete from vehiculo where veh_placa=?\";\r\n PreparedStatement statement = conn.prepareStatement(sql);\r\n statement.setString(1, placa);\r\n int rowsDelete = statement.executeUpdate();\r\n if(rowsDelete > 0){\r\n JOptionPane.showMessageDialog(null, \"Registro eliminado de manera correcta\");\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(VehiculoDAOJDBCImpl.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"public void eliminar() {\n try {\n Dr_siseg_usuarioBean usuario = new Dr_siseg_usuarioBean();\n FacesContext facesContext = FacesContext.getCurrentInstance();\n usuario = (Dr_siseg_usuarioBean) facesContext.getExternalContext().getSessionMap().get(\"usuario\");\n\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n apelacionesDao.IME_APELACIONES(3, this.Selected);\n\n BitacoraSolicitudDao bitacoraSolicitudDao = new BitacoraSolicitudDao();//INSERTA EL MOVIMIENTO EN LA BITACORA\n BitacoraSolicitudBean bitacoraSolicitudBean = new BitacoraSolicitudBean();\n bitacoraSolicitudBean.setBit_sol_id(this.Selected.getApel_sol_numero());\n bitacoraSolicitudBean.setUsuarioBean(usuario);\n bitacoraSolicitudBean.setBit_tipo_movimiento(\"2\");\n bitacoraSolicitudBean.setBit_detalle(\"Fue eliminada la apelacion\");\n bitacoraSolicitudDao.dmlDr_regt_bitacora_solicitud(bitacoraSolicitudBean);\n\n this.Listar();\n addMessage(\"Eliminado Exitosamente\", 1);\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n addMessage(\"Se produjo un error al eliminar el registro, contacte al administrador del sistema\", 2);\n }\n }",
"public void eliminarPaciente(String codigo)\n {\n try\n {\n int rows_update=0;\n PreparedStatement pstm=con.conexion.prepareStatement(\"DELETE paciente.* FROM paciente WHERE IdPaciente='\"+codigo+\"'\");\n rows_update=pstm.executeUpdate();\n \n if (rows_update==1)\n {\n JOptionPane.showMessageDialog(null,\"Registro eliminado exitosamente\");\n }\n else\n {\n JOptionPane.showMessageDialog(null,\"No se pudo eliminar el registro, verifique datos\");\n con.desconectar();\n }\n }\n catch (SQLException e)\n {\n JOptionPane.showMessageDialog(null,\"Error \"+e.getMessage()); \n }\n }",
"public int Rejuser(Long id) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from login where login_id=\"+id+\"\");\r\n\treturn i;\r\n\t\r\n}",
"public static void delete(int id) {\r\n\t\ttry {\r\n\t\t\tDatabase.connect();\r\n\t\t\tDatabase.deleteRecord(\"utente\", \"utente.id=\"+id);\r\n\t\t\tDatabase.close();\r\n\t\t}catch(NamingException e) {\r\n \t\tSystem.out.println(\"namingException \" +e);\r\n }catch (SQLException e) {\r\n \tSystem.out.println(\"sqlException \" +e);\r\n }catch (Exception ex) {\r\n \tSystem.out.println(\"Exception \" + ex);\r\n }\r\n\t}",
"public void delUtente(int id);",
"public void deleteUsuario(int id){\r\n try{\r\n PreparedStatement ps = bd.prepareStatement(SQLD);\r\n ps.setInt(1, id);\r\n ps.executeUpdate();\r\n \r\n ps.close();\r\n ConexaoBD.fechar(bd);\r\n } catch(SQLException sqle){\r\n System.out.println(\"Erro no deletedUsuario no DAO: \" + sqle.getMessage());\r\n }\r\n }",
"public void eliminarTripulante(Long id);",
"@Override\n\tpublic void eliminar() {\n\t\tLOG.info(\"Se elimino el usuario de la bd\");\n\t}",
"public static String delete(int id){\n String query=\"UPDATE empleado SET activo=0 WHERE idEmpleado=\"+id;\n return query;\n}",
"public void eliminar(Short idEmpleado) {\n\t\tEmpleado empleado;\n\t\templeado = entityManager.find(Empleado.class, idEmpleado);\n\t\tentityManager.getTransaction().begin();\n\t\tentityManager.remove(empleado);\n\t\tentityManager.getTransaction().commit();\n\t\tJPAUtil.shutdown();\n\t}",
"@Override\r\n\tpublic void delete() {\n\t\tString delete=\"DELETE FROM members WHERE id =?\";\r\n\t\t try(Connection connection=db.getConnection();) {\r\n\t\t\t\t\r\n\t\t\t\tpreparedStatement=connection.prepareStatement(delete);\r\n\t\t\t\tpreparedStatement.setString(1, super.getIdString());\r\n\t\t \tpreparedStatement.executeUpdate();\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Transaction successful\");\r\n\t\t\t\t\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Something went wrong\");\r\n\t\t\t}\r\n\t}",
"public void elimina(Long id) {\n\n final EntityManager em = getEntityManager();\n\n try {\n\n final EntityTransaction tx = em.getTransaction();\n\n tx.begin();\n\n // Busca un conocido usando su llave primaria.\n\n final Conocido modelo = em.find(Conocido.class, id);\n\n if (modelo != null) {\n\n /* Si la referencia no es nula, significa que el modelo se encontró la\n\n * referencia no es nula y se elimina. */\n\n em.remove(modelo);\n\n }\n\n tx.commit();\n\n } finally {\n\n em.close();\n\n }\n\n }",
"public void EliminarPrestamo(Integer idPrestamo) {\n this.conexion.ConectarBD();\n String consulta = \"delete from prestamos where IdPrestamo = ?\";\n try {\n this.pstm = this.conexion.getConexion().prepareStatement(consulta);\n //Indicamos los parametros del delete\n this.pstm.setInt(1, idPrestamo);\n //Ejecutamos la consulta\n int res = pstm.executeUpdate();\n } catch (SQLException e) { \n throw new MisException(\"Error al eliminar un Prestamo.\\n\"+e.toString());\n //System.out.println(\"Error al eliminar un Libro.\");\n } catch (Exception e) {\n throw new MisException(\"Error.\\n\"+e.toString());\n //e.printStackTrace();\n }\n \n //Desconectamos de la BD\n this.conexion.DesconectarBD();\n }",
"private void eliminar(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n Connection con = null;//Objeto para la conexion\r\n Statement sentencia = null;//Objeto para definir y ejecutar las consultas sql\r\n int resultado = 0;//resultado de las filas borradas sql\r\n String sql = \"\";\r\n try {\r\n\r\n //ESTABLECER CONEXION\r\n con = conBD.getCConexion();\r\n System.out.println(\"Conectado a BD...\");\r\n\r\n //OBTENER EL DATO A ELIMINAR\r\n String emailUsuario = request.getParameter(\"ID\");\r\n\r\n //Definición de Sentencia SQL\r\n sql = \"DELETE FROM USUARIOS WHERE semail='\" + emailUsuario + \"'\";\r\n\r\n //Ejecutar sentencia\r\n sentencia = con.createStatement();\r\n resultado = sentencia.executeUpdate(sql);\r\n System.out.println(\"Borrado exitoso !\");\r\n request.setAttribute(\"mensaje\", \"Registro borrado exitosamente !\");\r\n //cerrar la conexion\r\n //con.close();\r\n\r\n //listar de nuevo los datos\r\n todos(request, response);\r\n\r\n } catch (SQLException ex) {\r\n System.out.println(\"No se ha podido establecer la conexión, o el SQL esta mal formado \" + sql);\r\n request.getRequestDispatcher(\"/Error.jsp\").forward(request, response);\r\n }\r\n }",
"@Override\r\n\tpublic void insertar() {\n\t\ttab_cuenta.eliminar();\r\n\t\t\r\n\t\t\r\n\t}",
"int deleteByPrimaryKey(String idTipoPersona) throws SQLException;",
"@Transactional\n\tpublic void delete(Long id_interesado) {\n\t\tinteresadoDao.deleteById(id_interesado);\n\t\t\n\t}",
"@Override\n\tpublic int delete(int id) {\n\t\tString SQL=\" update user set estado = 0 where idUsuario = ?\";\n\t\treturn jdbc.update(SQL, id);\n\t}",
"@Override\n public void remove(Integer id) {\n Connection c = null;\n PreparedStatement pstmt = null;\n\n try {\n c = DBUtils.getConnection();\n pstmt = c.prepareStatement(\"DELETE FROM curso WHERE idcurso = ?\");\n\n pstmt.setInt(1, id);\n\n pstmt.executeUpdate();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (pstmt != null) {\n pstmt.close();\n }\n DBUtils.closeConnection(c);\n } catch (SQLException ex) {\n Logger.getLogger(JdbcCursoRepository.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }",
"@Override\n\tpublic MensajeBean elimina(Tramite_informesem nuevo) {\n\t\treturn tramite_informesemDao.elimina(nuevo);\n\t}",
"@Override\n\tpublic boolean delete() {\n\t\tString sql=\"DELETE FROM tc_student where id=\"+id;\n\t\t//`\n\t\t\n\t\tSystem.out.println(sql);\n\t\treturn mysql.execute(sql);\n\t}",
"@Override\n\tpublic void eliminar(Object T) {\n\t\tSeccion seccionE= (Seccion)T;\n\t\tif(seccionE!=null){\n\t\t\ttry{\n\t\t\tString insertTableSQL = \"update seccion set estatus=?\" +\"where codigo=? and estatus='A'\";\n\t\t\tPreparedStatement preparedStatement = conexion.prepareStatement(insertTableSQL);\n\t\t\tpreparedStatement.setString(1, \"I\");\n\t\t\tpreparedStatement.setString(2, seccionE.getCodigo());\n\t\t\tpreparedStatement.executeUpdate();\n\t\t}catch(SQLException e){\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"No se elimino el registro\");\n\t\t}\n\t\tSystem.out.println(\"Eliminacion exitosa\");\n\t}\n\n\t}",
"public int delete( Integer idConge ) ;",
"@Override\n public void doDelete(FasciaOrariaBean bean) throws SQLException {\n Connection con = null;\n PreparedStatement statement = null;\n String sql = \"DELETE FROM fasciaoraria WHERE id=?\";\n try {\n con = DriverManagerConnectionPool.getConnection();\n statement = con.prepareStatement(sql);\n statement.setInt(1, bean.getId());\n System.out.println(\"doUpdate=\" + statement);\n statement.executeUpdate();\n con.commit();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n\n try {\n\n statement.close();\n DriverManagerConnectionPool.releaseConnection(con);\n\n } catch (SQLException e) {\n\n e.printStackTrace();\n }\n }\n }",
"@Override\n\tpublic void eliminar(int id) {\n\t\tdao.deleteById(id);;\n\t}",
"@Override\r\n\tpublic void eliminar() {\n\t\ttab_cuenta.eliminar();\r\n\t}",
"public String eliminarComentario(int id){\r\n\t\tcomDao.borrar(id);\r\n\t\tinit();\r\n\t\treturn null;\r\n\t}",
"@GetMapping(\"/borrar/{id}\")\n public String borrar(@PathVariable(\"id\") Integer id, Model model) throws ParseException {\n this.usuarioService.remove(id);\n return \"redirect:/inicioAdmin\";\n }",
"public static void deleteTorre(int id) {\n Connection conn = Menu_Principal.conn;\n PreparedStatement pstmt = null;\n\n String q_DeTorre = \"DELETE\\n\"\n + \"FROM\\n\"\n + \" tor_torre\\n\"\n + \"WHERE\\n\"\n + \" id_torre = ?\";\n try {\n pstmt = conn.prepareStatement(q_DeTorre);\n pstmt.setInt(1, id);\n pstmt.executeUpdate();\n conn.commit();\n// JOptionPane.showMessageDialog(null, \"El registro se elimino correctamente\", \"Información\", JOptionPane.INFORMATION_MESSAGE);\n } catch (SQLException e) {\n JOptionPane.showMessageDialog(null, \"No se pudo completar la operación.\", \"Error\", JOptionPane.ERROR_MESSAGE);\n// System.err.println(\"Fallo DELETE Torre: \" + e.getClass().getName() + \": \" + e.getMessage());\n } // Fin de try...catch\n }",
"@Override\n\tpublic void CRUD(Integer pid) {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\tString query =\"delete from pmohan_prescription where pid = ?;\";\n\t\ttry(PreparedStatement statement = connection.prepareStatement(query))\n\t\t{\n\t\t\tstatement.setInt(1,pid);\n\t\t\tstatement.executeUpdate();\n\t\t} catch(SQLException e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\t\t\t\n\t}",
"void deleteEditorData(int id){\n dbConnection();\n try{\n stmt = con.prepareStatement(\"DELETE FROM editorData WHERE id = ?\");\n stmt.setInt(1,id);\n stmt.executeUpdate();\n }\n catch(Exception e){\n e.printStackTrace();\n }\n finally{\n closeConnection();\n }\n }",
"void deleteAveria(Long idAveria) throws BusinessException;",
"@Override\n\tpublic void remover(int idServico) throws SQLException {\n\t\t\n\t}",
"void eliminarPedidosUsuario(String idUsuario);",
"public static void delete(int id) {\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"DELETE FROM polovni WHERE id = ?\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ps.setInt(1, id);\n ps.execute();\n System.out.println(\"Uspesno brisanje iz baze.\");\n }\n } catch (SQLException ex) {\n Logger.getLogger(PolovniFunctions.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void effacerProduit(String id, Connection myConn) throws SQLException {\n PreparedStatement myStmt = null;\n\n String sqlExecute = \"DELETE FROM enseignant WHERE id_enseignant ='\" + id + \"'\";\n try {\n myStmt = myConn.prepareStatement(sqlExecute);\n myStmt.executeUpdate();\n\n } catch (SQLException ex) {\n ex.printStackTrace();\n } finally {\n myConn.close();\n myStmt.close();\n }\n }",
"@Override\r\npublic int delete(int id) {\n\treturn detalle_pedidoDao.delete(id);\r\n}",
"@Query(\"delete from Asignatura \")\n void borrarAsignaturas();",
"public RespuestaBD eliminarRegistro(int codigoFlujo, int secuencia) {\n/* 296 */ RespuestaBD rta = new RespuestaBD();\n/* */ \n/* */ try {\n/* 299 */ String s = \"delete from wkf_detalle where codigo_flujo=\" + codigoFlujo + \" and secuencia=\" + secuencia + \"\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* 304 */ rta = this.dat.executeUpdate2(s);\n/* */ }\n/* 306 */ catch (Exception e) {\n/* 307 */ e.printStackTrace();\n/* 308 */ Utilidades.writeError(\"FlujoDetalleDAO:eliminarRegistro \", e);\n/* 309 */ rta.setMensaje(e.getMessage());\n/* */ } \n/* 311 */ return rta;\n/* */ }",
"public void vaciarCarrito() {\r\n String sentSQL = \"DELETE from carrito\";\r\n try {\r\n Statement st = conexion.createStatement();\r\n st.executeUpdate(sentSQL);\r\n st.close();\r\n LOG.log(Level.INFO,\"Carrito vaciado\");\r\n } catch (SQLException e) {\r\n // TODO Auto-generated catch block\r\n \tLOG.log(Level.WARNING,e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }",
"@Override\r\n\tpublic void deleteFamille (Long idFamilleComp) {\n\t\tSession session=HibernateUtil.getSessionFactory().getCurrentSession();\r\n \t\tsession.beginTransaction();\r\n \t\tObject C=session.get(Famille.class, idFamilleComp);\r\n \t\tif(C==null) throw new RuntimeException(\"FamilleComp non crées\");\r\n \t session.delete(C);\r\n \t session.getTransaction().commit();\r\n\t}",
"@Override\n\tpublic void delete(Integer id) throws SQLException {\n\t\t\n\t}",
"public void eliminar() throws SQLException {\r\n\t\tConexion conexion = new Conexion();\r\n\t\tConnection cn = conexion.conectar();\r\n\t\tStatement stm = cn.createStatement();\r\n\t\t//Delete en users del usuariop con el que iniciaste sesion para borrar el usuario\r\n\t\tString query=\"delete from users where USR=\"+InicioUsuario.correo;\r\n\t\tstm.executeUpdate(query);\r\n\t\t\r\n\t}",
"public int deletar(int id) {\n\n\t\tConnection conn = null;\n\t\tconn = getConnection();\n\t\tint excluidos = 0;\n\t\tPreparedStatement stmt = null;\n\t\ttry {\n\t\t\tstmt = conn\n\t\t\t\t\t.prepareStatement(\"DELETE FROM INGREDIENTE WHERE IDRESTAURANTE = ?\");\n\t\t\tstmt.setInt(1, id);\n\t\t\texcluidos = stmt.executeUpdate();\n\n\t\t\tif (excluidos > 0) {\n\t\t\t\tSystem.out.println(\"INGREDIENTE REMOVIDO!\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"INGREDIENTE NÃO EXISTE!\");\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"ERRO AO DELETAR INGREDIENTE!\");\n\t\t} finally {\n\t\t\tcloseConnection(conn, stmt);\n\t\t}\n\t\treturn excluidos;\n\t}",
"@Override\r\n public boolean delete(String id) {\r\n try {\r\n String query = \"DELETE FROM Anggota Where kd_anggota=?\";\r\n PreparedStatement preparedStatement = connection.prepareStatement(query);\r\n preparedStatement.setString(1, id);\r\n preparedStatement.executeUpdate();\r\n return true;\r\n } catch (SQLException ex) {\r\n Logger.getLogger(AnggotaDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return false;\r\n }",
"@Override\r\n\tpublic void remover(Tipo tipo) {\n String sql = \"delete from tipos_servicos where id = ?\";\r\n try {\r\n stmt = conn.prepareStatement(sql);\r\n stmt.setInt(1, tipo.getId());\r\n \r\n stmt.execute();\r\n } catch (SQLException ex) {\r\n ex.printStackTrace();\r\n }\r\n\t}",
"@Override\n public void delete(Integer key) throws SQLException {\n //Ei toteutettu\n }",
"@Override\r\n\tpublic int delete(int id) {\n\t\treturn jdbcTemplate.update(\"call PKG_ESTADO_CIVIL.PR_DEL_ESTADO_CIVIL(?)\", id);\r\n\t}",
"void eliminar(Long id);",
"void deleteMataKuliah (int id);",
"@Override\r\n\tpublic void delete(Usuario t) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void del(Integer id) {\n\t\t\r\n\t}",
"public int BorrarAnuncioDestinatarios(int id){\n int status=0;\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is); \n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"borrar.Destinatario\"));\n ps.setInt(1, id);\n status=ps.executeUpdate();\n }catch(Exception e){\n e.printStackTrace();\n }\n return status;\n }",
"public void deletar(int codigo) throws SQLException{\r\n conecta = FabricaConexao.conexaoBanco();\r\n sql = \"delete from conserto where concodigo =? \";\r\n pstm = conecta.prepareStatement(sql);\r\n pstm.setInt(1, codigo);\r\n pstm.execute();\r\n FabricaConexao.fecharConexao();\r\n \r\n }",
"@Override\r\n\tpublic void deleteEmployee(int id) {\n\t\ttry {\r\n\t DirectlyDatabase.update(PropertyManager.getProperty(\"db_employee_delete\"), id +\"\"); \r\n\t\t} catch (SQLException ex) {\r\n System.out.println(ex.toString());\r\n }\t\r\n\t}",
"public void deleteIscrizione() throws SQLException {\r\n\r\n\t\tPreparedStatement pstmt = null;\r\n\r\n\t\ttry {\r\n\t\t\tpstmt = con.prepareStatement(STATEMENTDEL);\r\n\t\t\t\r\n\t\t\tpstmt.setString(1, i.getGiocatore());\r\n\t\t\tpstmt.setInt(2, i.getTorneo());\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\tpstmt.execute();\r\n\r\n\t\t} finally {\r\n\t\t\tif (pstmt != null) {\r\n\t\t\t\tpstmt.close();\r\n\t\t\t}\r\n\r\n\t\t\tcon.close();\r\n\t\t}\r\n\r\n\t}",
"public void delEmployee(String person){\n System.out.println(\"Attempt to delete \" + person);\n try {\n String delete =\"DELETE FROM JEREMY.EMPLOYEE WHERE NAME='\" + person+\"'\"; \n stmt.executeUpdate(delete);\n \n \n } catch (Exception e) {\n System.out.println(person +\" may not exist\" + e);\n }\n \n }",
"private void deleteActionPerformed(ActionEvent evt) throws Exception {\n String teaID = this.teaIDText.getText();\n if(StringUtil.isEmpty(teaID)){\n JOptionPane.showMessageDialog(null, \"请先选择一条老师信息!\");\n return;\n }\n int confirm = JOptionPane.showConfirmDialog(null, \"确认删除?\");\n if(confirm == 0){//确认删除\n Connection con = dbUtil.getConnection();\n int delete = teacherInfo.deleteInfo(con, teaID);\n if(delete == 1){\n JOptionPane.showMessageDialog(null, \"删除成功!\");\n resetValues();\n }\n else{\n JOptionPane.showMessageDialog(null, \"删除失败!\");\n return;\n }\n initTable(new Teacher());//初始化表格\n }\n }",
"public void delete(Ausschreibung as) {\r\n\r\n\t\t// DB-Verbindung herstellen\r\n\t\tConnection con = DBConnection.connection();\r\n\r\n\t\ttry {\r\n\t\t\t// Leeres SQL-Statement (JDBC) anlegen\r\n\t\t\tStatement stmt = con.createStatement();\r\n\r\n\t\t\t// Jetzt erst erfolgt die tatsaechliche Einfuegeoperation.\r\n\t\t\tstmt.executeUpdate(\"DELETE FROM ausschreibung WHERE ID=\" + as.getId());\r\n\t\t} catch (SQLException e3) {\r\n\t\t\te3.printStackTrace();\r\n\t\t}\r\n\t}",
"public void deleteEmp(int empno) {\n\t\t\n\t}",
"@Override\n\tpublic int eliminarCliente(int id) throws Exception {\n\t\treturn 0;\n\t}",
"public int Rejectcomp(Long id) throws SQLException {\n\tLong idd=null;\r\n\trs=DbConnect.getStatement().executeQuery(\"select login_id from company where comp_id=\"+id+\"\");\r\n\tif(rs.next())\r\n\t{\r\n\t\tidd=rs.getLong(1);\r\n\t}\r\n\tSystem.out.println(idd);\r\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from login where login_id=\"+idd+\"\");\r\n\treturn i;\r\n}",
"public void borrarTodo()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\tStatement st = conexion.createStatement();\r\n\t\tst.execute(\"DROP TABLE usuarios\");\r\n\t\tst.execute(\"DROP TABLE prestamos\");\r\n\t\tst.execute(\"DROP TABLE libros\");\r\n\t\t}\r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void eliminar(Dia dia) {\n Session session = sessionFactory.openSession();\n //la transaccion a relizar\n Transaction tx = null;\n try {\n tx = session.beginTransaction();\n //eliminamos el Dia\n session.delete(dia);\n \n tx.commit();\n }\n catch (Exception e) {\n //Se regresa a un estado consistente \n if (tx!=null){ \n tx.rollback();\n }\n e.printStackTrace(); \n }\n finally {\n //cerramos siempre la sesion\n session.close();\n }\n }",
"@Override\r\n\tpublic int deleteEmployee(int empId) {\n\t\tint added = 0;\r\n\t\tString insertData = \"delete from employee where empId=?\";\r\n\r\n\t\ttry {\r\n\t\t\tPreparedStatement ps = dataSource.getConnection().prepareStatement(insertData);\r\n\t\t\tps.setInt(1, empId);\r\n\t\t\tadded = ps.executeUpdate();\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn added;\r\n\r\n\t}",
"public VistaBorrar() throws SQLException {\n initComponents();\n Conexion.getInstance();\n \n llenarTabla();\n \n //jTable1.setModel(defaultTableModel);\n //controladorListar = new ControladorListar();\n //ArrayList<Pelicula> listPelicula=controladorListar.getListadoPeliculaEliminar();\n //Object[] fila=new Object[2];\n //for(int x=0; x<listPelicula.size(); x++){\n // fila[0]=listPelicula.get(x).getCodigo();\n // fila[1]=listPelicula.get(x).getNombre();\n // defaultTableModel.addRow(fila);\n \n }",
"Integer delete(int id);",
"public int eliminar(Connection conn, alertas objeto) {\r\n\t\ttry {\r\n\r\n\t\t\tPreparedStatement statement = conn\r\n\t\t\t\t\t.prepareStatement(\"delete from alertas where ID_ALERTA = ?\");\r\n\t\t\tstatement.setInt(1, objeto.getAlerta());\r\n\t\t\tstatement.execute();\r\n\t\t\tstatement.close();\r\n\t\t\tJOptionPane.showMessageDialog(null,\r\n\t\t\t\t\t\"Se ha Eliminado un Registro! \", \"Aviso!\",\r\n\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn 1;\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t\tJOptionPane.showMessageDialog(null, \"No se Eliminó Registro :\"\r\n\t\t\t\t\t+ e.getMessage(), \"Alerta!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t}",
"public void delete(TipologiaStrutturaPk pk) throws TipologiaStrutturaDaoException;"
] | [
"0.72643286",
"0.7218365",
"0.71670735",
"0.71446216",
"0.7084288",
"0.70727557",
"0.7053698",
"0.70194817",
"0.6998552",
"0.69452214",
"0.6896681",
"0.68701524",
"0.686308",
"0.685931",
"0.68549883",
"0.68129885",
"0.6803724",
"0.68029565",
"0.68021643",
"0.67923844",
"0.6780567",
"0.67728305",
"0.67724824",
"0.6772394",
"0.67717344",
"0.6768598",
"0.67588913",
"0.6750253",
"0.6748885",
"0.67393154",
"0.6729772",
"0.6723161",
"0.67108357",
"0.66967463",
"0.6692472",
"0.66884935",
"0.66835624",
"0.66731167",
"0.66708976",
"0.6650874",
"0.6643114",
"0.6642776",
"0.66302115",
"0.66276276",
"0.66195315",
"0.6611843",
"0.6600334",
"0.6599845",
"0.65991163",
"0.6592975",
"0.6565313",
"0.6564056",
"0.6562327",
"0.65598845",
"0.6554853",
"0.65516007",
"0.6551101",
"0.6522771",
"0.6514087",
"0.6508719",
"0.6503607",
"0.6491066",
"0.6485595",
"0.6480986",
"0.64776415",
"0.6477344",
"0.6470109",
"0.645741",
"0.64569724",
"0.64562565",
"0.6455184",
"0.64538467",
"0.6453531",
"0.6445961",
"0.64399356",
"0.64396137",
"0.6436312",
"0.643064",
"0.6420858",
"0.6420414",
"0.64147466",
"0.6407235",
"0.6384999",
"0.6375776",
"0.6372913",
"0.6371696",
"0.63635707",
"0.6361881",
"0.6358972",
"0.63571393",
"0.63504165",
"0.6348044",
"0.6347832",
"0.63439023",
"0.6340038",
"0.63384926",
"0.633719",
"0.6333563",
"0.6332311",
"0.63307613"
] | 0.7192038 | 2 |
Default constructor (Does nothing) | public ImageConverter() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }",
"void DefaultConstructor(){}",
"defaultConstructor(){}",
"private Default()\n {}",
"public Generic(){\n\t\tthis(null);\n\t}",
"ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}",
"public Constructor(){\n\t\t\n\t}",
"private Instantiation(){}",
"Constructor() {\r\n\t\t \r\n\t }",
"public Basic() {}",
"public None()\n {\n \n }",
"O() { super(null); }",
"public AllDifferent()\n {\n this(0);\n }",
"public Parser()\n {\n //nothing to do\n }",
"public GTFTranslator()\r\n {\r\n // do nothing - no variables to instantiate\r\n }",
"public Orbiter() {\n }",
"public no() {}",
"public Node() {\n\t}",
"public Method() {\n }",
"public Node() {\r\n\t}",
"public Node() {\r\n\t}",
"public Node() {\n }",
"private SingleObject()\r\n {\r\n }",
"private Node() {\n\n }",
"@Test\n public void constructorDefault() {\n final CourseType courseType = new CourseType();\n\n assertNull(courseType.getId());\n assertNull(courseType.getName());\n assertNull(courseType.getPicture());\n assertNull(courseType.getPosition());\n assertNull(courseType.getStatus());\n assertNull(courseType.getCourses());\n assertNull(courseType.getAllowedDishes());\n }",
"public SgaexpedbultoImpl()\n {\n }",
"public Curso() {\r\n }",
"public lo() {}",
"public Pitonyak_09_02() {\r\n }",
"public Pasien() {\r\n }",
"public Chick() {\n\t}",
"private SingleObject(){}",
"public CyanSus() {\n\n }",
"public God() {}",
"public TennisCoach () {\n\t\tSystem.out.println(\">> inside default constructor.\");\n\t}",
"public CSSTidier() {\n\t}",
"public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}",
"public D() {}",
"public Data() {}",
"public Model() {\n\t}",
"public Model() {\n\t}",
"private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}",
"public Car() {\r\n this(\"\", \"\", \"\", 0, Category.EMPTY, 0.00, \"\", 0, \"\", 0.00, \"\", DriveTrain.EMPTY,\r\n Aspiration.EMPTY, 0.00, 0.00, 0.00, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n }",
"public Demo() {\n\t\t\n\t}",
"DefaultConstructor(int a){}",
"public Person() {\n\t\t\n\t}",
"@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}",
"public BasicLineParser() {\n/* 99 */ this(null);\n/* */ }",
"private Sequence() {\n this(\"<Sequence>\", null, null);\n }",
"public Counter()\n {\n this(0);\n }",
"public Mouse() {\n\t\tthis(null);\n\t}",
"public SpeakerSerivceImpl() {\n\t\tSystem.out.println(\"No args in constructor\");\n\t}",
"public Aanbieder() {\r\n\t\t}",
"public Anschrift() {\r\n }",
"public Person() {}",
"public Instance() {\n }",
"public Person()\n {\n //intentionally left empty\n }",
"public Lanceur() {\n\t}",
"public Student()\r\n {\r\n //This is intended to be empty\r\n }",
"public Clade() {}",
"private Rekenhulp()\n\t{\n\t}",
"public DefaultNashRequestImpl() {\n\t\t\n\t}",
"public Parser()\n{\n //nothing to do\n}",
"public PSRelation()\n {\n }",
"public Cache() {\n this(null);\n }",
"public Node(){}",
"public SimOI() {\n super();\n }",
"@SuppressWarnings(\"unused\")\n public Item() {\n }",
"public Mitarbeit() {\r\n }",
"public Soil()\n\t{\n\n\t}",
"private Model(){}",
"public Demo3() {}",
"public Node() {}",
"public Node() {}",
"public Node() {}",
"public Node() {}",
"protected GraphNode() {\n }",
"protected GraphNode() {\n }",
"public Node(){\n }",
"public Stat()\n {\n // empty constructor\n }",
"public Ruby() {}",
"public Data() {\n }",
"public Data() {\n }",
"public Book() {\n\t\t// Default constructor\n\t}",
"public Account() {\n // special case of the word \"this\"\n this(\"01234\", 0.00, \"Default Name\", \"Default Email\", \"Default Phone\");\n System.out.println(\"Empty constructor called\"); // only called once when instantiated.\n }",
"private UI()\n {\n this(null, null);\n }",
"protected SimpleMatrix() {}",
"TypesOfConstructor(){\n System.out.println(\"This is default constructor\");\n }",
"public CLElenco() {\n /** rimanda al costruttore di questa classe */\n this(null);\n }",
"public TTau() {}",
"protected AST_Node() {\r\n\t}",
"public MyInteger( )\n {\n this( 0 );\n }",
"public Implementor(){}",
"public Vector() {\n construct();\n }",
"public Chauffeur() {\r\n\t}",
"public Dog() {\n // Default constructor\n }",
"public Student() {\n//\t\tname = \"\";\n//\t\tage = 0;\n\t\t\n\t\t\n\t\t//call constructors inside of other constructors\n\t\tthis(999,0);\n\t}",
"public Data() {\n \n }",
"public Member() {}",
"public Tbdtokhaihq3() {\n super();\n }",
"public Complex() {\n this(0);\n }"
] | [
"0.8369692",
"0.82552683",
"0.8208076",
"0.78901327",
"0.7505341",
"0.7494133",
"0.7429229",
"0.7421201",
"0.740558",
"0.736747",
"0.7292775",
"0.72145694",
"0.7188558",
"0.7131721",
"0.7120169",
"0.70707107",
"0.70570374",
"0.7055906",
"0.7048026",
"0.7043545",
"0.7043545",
"0.7019723",
"0.701235",
"0.70114034",
"0.7003555",
"0.6997712",
"0.6997563",
"0.6990541",
"0.6985735",
"0.6984499",
"0.6981576",
"0.6937319",
"0.69358146",
"0.6935134",
"0.6927725",
"0.6927109",
"0.6920029",
"0.69123095",
"0.69003373",
"0.68981564",
"0.68981564",
"0.6896182",
"0.68931246",
"0.6888907",
"0.6883479",
"0.6867839",
"0.68651044",
"0.68632823",
"0.685816",
"0.68564105",
"0.6854549",
"0.6853596",
"0.68508774",
"0.6846423",
"0.6844684",
"0.68443364",
"0.6841636",
"0.6833281",
"0.68297124",
"0.6827827",
"0.6825375",
"0.682226",
"0.6822027",
"0.6819607",
"0.68152106",
"0.6814855",
"0.6805481",
"0.68049586",
"0.6804745",
"0.68038476",
"0.6801474",
"0.68009764",
"0.6796546",
"0.6796546",
"0.6796546",
"0.6796546",
"0.6791353",
"0.6791353",
"0.67908",
"0.67893517",
"0.6788029",
"0.67813486",
"0.67813486",
"0.6777427",
"0.67763996",
"0.67761594",
"0.6773616",
"0.6772504",
"0.6771121",
"0.6770044",
"0.67692333",
"0.6768951",
"0.67674947",
"0.6766026",
"0.67654943",
"0.67597497",
"0.6759304",
"0.6754275",
"0.6751818",
"0.6748362",
"0.6747241"
] | 0.0 | -1 |
Converts an Image to a GrayImage | public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,
ColorModelUnknownException {
if (img instanceof GrayImage) {
return toGray((GrayImage) img);
} else if (img instanceof RealGrayImage) {
return toGray((RealGrayImage) img);
} else if (img instanceof ColorImage) {
return toGray((ColorImage) img);
} else if (img instanceof RealColorImage) {
return toGray((RealColorImage) img);
} else {
return toGray((ComplexImage) img);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public native boolean isGrayImage() throws MagickException;",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"void greyscale();",
"void greyscale();",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public static Try<byte[]> imageToPng(BufferedImage image) {\n return Try.of(() -> Imaging.writeImageToBytes(image, ImageFormats.PNG, null))\n .logIfFailure(TAG, err -> \"failed to convert image to bytes\");\n }",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"private native int grayToRgb(byte src[],int dst[]);",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public static BufferedImage convertToJpg(BufferedImage image) {\r\n\t\tint w = image.getWidth();\r\n\t\tint h = image.getHeight();\r\n\t\tBufferedImage image2 = new BufferedImage(w, h,\r\n\t\t\t\tBufferedImage.TYPE_INT_RGB);\r\n\t\tGraphics2D g = image2.createGraphics();\r\n\t\tg.setColor(Color.WHITE);\r\n\t\tg.fillRect(0, 0, w, h);\r\n\t\tg.drawRenderedImage(image, null);\r\n\t\tg.dispose();\r\n\t\treturn image2;\r\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"BufferedImage getImage();",
"BufferedImage getImage();",
"BufferedImage getImage();",
"public BufferedImage convertByteToImage(byte[] imageByteArr) throws IOException {\r\n return ImageIO.read(new ByteArrayInputStream(imageByteArr));\r\n }",
"public static BufferedImage toImage(VImage vImage) {\n BufferedImage image = new BufferedImage(vImage.getWidth(), vImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n System.arraycopy(vImage.getData(), 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0,\n vImage.getWidth() * vImage.getHeight() * 3);\n return image;\n }",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"BufferedImage outputImage();",
"public static Image toImage(BufferedImage bufferedImage) {\r\n return Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());\r\n }",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public static BufferedImage toBufferedImage(Image image) {\r\n if (image instanceof BufferedImage) {\r\n return (BufferedImage) image;\r\n }\r\n\r\n // This code ensures that all the pixels in the image are loaded\r\n image = new ImageIcon(image).getImage();\r\n\r\n // Determine if the image has transparent pixels; for this method's\r\n // implementation, see Determining If an Image Has Transparent Pixels\r\n boolean hasAlpha = true;\r\n\r\n // Create a buffered image with a format that's compatible with the screen\r\n BufferedImage bimage = null;\r\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\r\n try {\r\n // Determine the type of transparency of the new buffered image\r\n int transparency = Transparency.OPAQUE;\r\n if (hasAlpha) {\r\n transparency = Transparency.BITMASK;\r\n }\r\n\r\n // Create the buffered image\r\n GraphicsDevice gs = ge.getDefaultScreenDevice();\r\n GraphicsConfiguration gc = gs.getDefaultConfiguration();\r\n bimage = gc.createCompatibleImage(\r\n image.getWidth(null), image.getHeight(null), transparency);\r\n } catch (HeadlessException e) {\r\n // The system does not have a screen\r\n }\r\n\r\n if (bimage == null) {\r\n // Create a buffered image using the default color model\r\n int type = BufferedImage.TYPE_INT_RGB;\r\n if (hasAlpha) {\r\n type = BufferedImage.TYPE_INT_ARGB;\r\n }\r\n bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);\r\n }\r\n\r\n // Copy image to buffered image\r\n Graphics g = bimage.createGraphics();\r\n\r\n // Paint the image onto the buffered image\r\n g.drawImage(image, 0, 0, null);\r\n g.dispose();\r\n\r\n return bimage;\r\n }",
"public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public static BufferedImage toBufferedImage(Image image) {\n\t\tif (image instanceof BufferedImage) {\n\t\t\treturn (BufferedImage) image;\n\t\t}\n\n\t\t// This code ensures that all the pixels in the image are loaded\n\t\timage = new ImageIcon(image).getImage();\n\n\t\t// Determine if the image has transparent pixels; for this method's\n\t\t// implementation, see Determining If an Image Has Transparent Pixels\n\t\tboolean hasAlpha = false; // hasAlpha(image);\n\n\t\t// Create a buffered image with a format that's compatible with the\n\t\t// screen\n\t\tBufferedImage bimage = null;\n\t\tGraphicsEnvironment ge = GraphicsEnvironment\n\t\t\t\t.getLocalGraphicsEnvironment();\n\t\ttry {\n\t\t\t// Determine the type of transparency of the new buffered image\n\t\t\tint transparency = Transparency.OPAQUE;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttransparency = Transparency.BITMASK;\n\t\t\t}\n\n\t\t\t// Create the buffered image\n\t\t\tGraphicsDevice gs = ge.getDefaultScreenDevice();\n\t\t\tGraphicsConfiguration gc = gs.getDefaultConfiguration();\n\t\t\tbimage = gc.createCompatibleImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), transparency);\n\t\t} catch (HeadlessException e) {\n\t\t\t// The system does not have a screen\n\t\t}\n\n\t\tif (bimage == null) {\n\t\t\t// Create a buffered image using the default color model\n\t\t\tint type = BufferedImage.TYPE_INT_RGB;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttype = BufferedImage.TYPE_INT_ARGB;\n\t\t\t}\n\t\t\tbimage = new BufferedImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), type);\n\t\t}\n\n\t\t// Copy image to buffered image\n\t\tGraphics g = bimage.createGraphics();\n\n\t\t// Paint the image onto the buffered image\n\t\tg.drawImage(image, 0, 0, null);\n\t\tg.dispose();\n\n\t\treturn bimage;\n\t}",
"public Image showChanelG(Image image) {\n MyGreenFilter filter = new MyGreenFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n }",
"public static Mat rapidConvertRGBAToGRAY(Mat rgba) {\n Mat gray = new Mat(rgba.rows(), rgba.cols(), CvType.CV_8UC1);\n Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);\n return gray;\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }",
"public static byte[] imageToByteArray(BufferedImage image) {\n if (image != null) {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try {\n ImageIO.write(image, \"png\", baos);\n baos.flush();\n byte[] imageInByte = baos.toByteArray();\n baos.close();\n return imageInByte;\n } catch (IOException ex) {\n log.error(\"error while converting to byte array\", ex);\n }\n WritableRaster raster = image.getRaster();\n DataBufferByte data = (DataBufferByte) raster.getDataBuffer();\n return data.getData();\n }\n return new byte[0];\n }",
"public Mat convertToEdges(Mat img) {\n\n return img;\n }",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"@Test\n public void testGrayFilter() {\n System.out.println(\"grayFilter\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.grayFilter();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public BufferedImage byteArrayToBufferedImage(byte[] byteImage) {\n BufferedImage image = null;\n InputStream in = new ByteArrayInputStream(byteImage);\n try {\n image = ImageIO.read(in);\n\n } catch (IOException ex) {\n Logger.getLogger(ProcessImage.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return image;\n }",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"BufferedImage getImage(Mat mat){\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR);\n\n //Hue Saturation Lighting to Blue Green Red values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR);\n\n //Re-reverses Blue and Red color values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB);\n\n //Sets colors to grayscale\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY);\n\n\n getSpace(mat);\n WritableRaster raster = img.getRaster();\n DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer();\n byte[] data = dataBuffer.getData();\n mat.get(0, 0, data);\n return img;\n }",
"public byte[] convertImage(Image image) {\n BufferedImage bytesImage = SwingFXUtils.fromFXImage(image, null);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n byte[] bytesArray = null;\n try {\n ImageIO.write(bytesImage, \"png\", baos);\n //coloca los bytes de la imagen en un arreglo de bytes\n bytesArray = baos.toByteArray();\n baos.close();\n return bytesArray;\n } catch (IOException ex) {\n Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"public static int grayToBinary(int num) {\r\n\t\tint k = (INTEGER_SIZE >>> 1);\r\n\t\tint temp = num;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp ^= (temp >>> k);\r\n\t\t\tk >>>= 1;\r\n\t\t}\r\n\t\treturn temp;\r\n\t}",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"public native MagickImage enhanceImage() throws MagickException;",
"public native boolean negateImage(int grayscale) throws MagickException;",
"public static int[][][] greyScale(int[][][] source) {\n\n\t\t// Creating the new matrix\n\t\tint[][][] gray = new int[source.length][source[0].length][3]; \n\n\t\t// Creating a loop to print\n\t\tfor (int i = 0; i < source.length; i++) { \n\t\t\tfor (int j = 0; j < source[0].length; j++) { \n\t\t\t\tint[] klum = new int[3];\n\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\tklum[k] = source[i][j][k]; // Creating a pixel\n\t\t\t\t}\n\t\t\t\t// Put the grey pixel in the new Matrix\n\t\t\t\tgray[i][j] = luminance(klum); \n\t\t\t}\n\t\t}\n\t\treturn gray;\n\t}"
] | [
"0.7833978",
"0.7623466",
"0.76065904",
"0.74408877",
"0.73783726",
"0.7283563",
"0.72810656",
"0.7190784",
"0.7122525",
"0.70247376",
"0.69810075",
"0.6890209",
"0.6876261",
"0.6863352",
"0.67848253",
"0.6700197",
"0.6510964",
"0.6505058",
"0.64585286",
"0.64092654",
"0.6363956",
"0.63404846",
"0.63335633",
"0.6299606",
"0.62580466",
"0.6241527",
"0.62225825",
"0.61437315",
"0.61190885",
"0.6100004",
"0.6063601",
"0.6063601",
"0.60408425",
"0.60353976",
"0.5959549",
"0.5924012",
"0.59233516",
"0.59171677",
"0.59112865",
"0.5883973",
"0.5845576",
"0.58194447",
"0.580655",
"0.57988745",
"0.57681626",
"0.57676905",
"0.57174283",
"0.56992465",
"0.56979114",
"0.56898534",
"0.56807053",
"0.5667116",
"0.56477356",
"0.561575",
"0.5594085",
"0.5515888",
"0.5515709",
"0.55066645",
"0.55066645",
"0.55066645",
"0.54689866",
"0.5466064",
"0.54642195",
"0.5449551",
"0.5443393",
"0.5401715",
"0.5394549",
"0.5359847",
"0.5334962",
"0.53186077",
"0.52951145",
"0.5260549",
"0.5233063",
"0.5213299",
"0.52042913",
"0.52033687",
"0.515428",
"0.5143571",
"0.5134836",
"0.51288253",
"0.5125781",
"0.51063925",
"0.51049244",
"0.50991637",
"0.50964636",
"0.50955737",
"0.5083949",
"0.5065844",
"0.5051171",
"0.5048713",
"0.50409836",
"0.50401664",
"0.5037834",
"0.50316226",
"0.50205916",
"0.49896795",
"0.49782994",
"0.49667233",
"0.49616736",
"0.49616468"
] | 0.7263846 | 7 |
Converts an Image to a RealGrayImage | public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,
ColorModelUnknownException {
if (img instanceof GrayImage) {
return toRealGray((GrayImage) img);
} else if (img instanceof RealGrayImage) {
return toRealGray((RealGrayImage) img);
} else if (img instanceof ColorImage) {
return toRealGray((ColorImage) img);
} else if (img instanceof RealColorImage) {
return toRealGray((RealColorImage) img);
} else {
return toRealGray((ComplexImage) img);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"void greyscale();",
"void greyscale();",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public native boolean isGrayImage() throws MagickException;",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public BufferedImage rescaleImage(BufferedImage image, float scale) {\r\n int[][][] arr = convertToArray(image);\r\n return convertToBimage(rescaleImage(arr, scale));//return array\r\n }",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"@Test\n public void testGrayFilter() {\n System.out.println(\"grayFilter\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.grayFilter();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"BufferedImage getImage();",
"BufferedImage getImage();",
"BufferedImage getImage();",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image toImage(BufferedImage bufferedImage) {\r\n return Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());\r\n }",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"public static Mat rapidConvertRGBAToGRAY(Mat rgba) {\n Mat gray = new Mat(rgba.rows(), rgba.cols(), CvType.CV_8UC1);\n Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);\n return gray;\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toImage(VImage vImage) {\n BufferedImage image = new BufferedImage(vImage.getWidth(), vImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n System.arraycopy(vImage.getData(), 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0,\n vImage.getWidth() * vImage.getHeight() * 3);\n return image;\n }",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"@Override\r\n\tpublic BufferedImage transform(BufferedImage image){\n\t\tMat mat = Mat2BufImg.BufImg2Mat(image, BufferedImage.TYPE_3BYTE_BGR, CvType.CV_8UC3);\r\n\t\t//人脸识别\r\n\t\ttry {\r\n\t\t\t//mat --> bufferimage\r\n\t\t\treturn Mat2BufImg.Mat2BufImg(detectFace(mat),\".png\");\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn image;\r\n\t}",
"@SuppressWarnings( \"unchecked\" )\n\t@Test\n\tpublic void testMatToImgConversion() throws IOException {\n\t\tMat mat = imread( input, opencv_imgcodecs.IMREAD_GRAYSCALE );\n\t\tif ( mat.empty() )\n\t\t\tfail( \"Couldn't load image: \" + input );\n\t\tRandomAccessibleInterval< ByteType > convertedMat = ( RandomAccessibleInterval< ByteType > ) new MatToImgConverter().convert( mat, RandomAccessibleInterval.class );\n\t\tsaveImg( convertedMat, mat2img );\n\n\t\t//Read image with ImageJ\n\t\tDataset dataset = getScifio().datasetIO().open( input );\n\t\tRandomAccessibleInterval< ByteType > ijImage =\n\t\t\t\tRealTypeConverters.convert( ( RandomAccessibleInterval< ? extends RealType< ? > > ) dataset.getImgPlus().getImg(), new ByteType() );\n\n\t\t//Compare data\n\t\tcheckData( convertedMat, ijImage );\n\t}",
"public RawImage(BufferedImage img, int res) {\n boolean[] alpha = new boolean[1];\n m_img = ImageHelper.convertToRGB(img, alpha);\n m_hasAlpha = alpha[0];\n m_height = m_img.length;\n m_width = m_height > 0 ? m_img[0].length : 0;\n m_res = res;\n }",
"public static Image aplicarLienzoAoriginal(Image imagenOriginal, int nxn) {\n BufferedImage biNegro = new BufferedImage(nxn, nxn, BufferedImage.TYPE_INT_RGB);\r\n for (int n = 0; n < biNegro.getHeight(); n++) {\r\n for (int n1 = 0; n1 < biNegro.getWidth(); n1++) {\r\n Color color = new Color(0, 0, 0);\r\n biNegro.setRGB(n, n, color.getRGB());\r\n }\r\n }\r\n\r\n BufferedImage bi = herramientas.HerramientasImagen.toBufferedImage(imagenOriginal);\r\n Color color;\r\n\r\n int x, y, aux;\r\n for (y = 0; y < bi.getHeight(); y++) {\r\n for (x = 0; x < bi.getWidth(); x++) {\r\n color = new Color(bi.getRGB(x, y));\r\n\r\n try {\r\n biNegro.setRGB(x, y, color.getRGB());\r\n } catch (Exception e) {\r\n }\r\n\r\n }\r\n }\r\n return herramientas.HerramientasImagen.toImage(biNegro);\r\n\r\n }",
"public Mat convertToEdges(Mat img) {\n\n return img;\n }",
"static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public static BufferedImage toBufferedImage(Image image) {\r\n if (image instanceof BufferedImage) {\r\n return (BufferedImage) image;\r\n }\r\n\r\n // This code ensures that all the pixels in the image are loaded\r\n image = new ImageIcon(image).getImage();\r\n\r\n // Determine if the image has transparent pixels; for this method's\r\n // implementation, see Determining If an Image Has Transparent Pixels\r\n boolean hasAlpha = true;\r\n\r\n // Create a buffered image with a format that's compatible with the screen\r\n BufferedImage bimage = null;\r\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\r\n try {\r\n // Determine the type of transparency of the new buffered image\r\n int transparency = Transparency.OPAQUE;\r\n if (hasAlpha) {\r\n transparency = Transparency.BITMASK;\r\n }\r\n\r\n // Create the buffered image\r\n GraphicsDevice gs = ge.getDefaultScreenDevice();\r\n GraphicsConfiguration gc = gs.getDefaultConfiguration();\r\n bimage = gc.createCompatibleImage(\r\n image.getWidth(null), image.getHeight(null), transparency);\r\n } catch (HeadlessException e) {\r\n // The system does not have a screen\r\n }\r\n\r\n if (bimage == null) {\r\n // Create a buffered image using the default color model\r\n int type = BufferedImage.TYPE_INT_RGB;\r\n if (hasAlpha) {\r\n type = BufferedImage.TYPE_INT_ARGB;\r\n }\r\n bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);\r\n }\r\n\r\n // Copy image to buffered image\r\n Graphics g = bimage.createGraphics();\r\n\r\n // Paint the image onto the buffered image\r\n g.drawImage(image, 0, 0, null);\r\n g.dispose();\r\n\r\n return bimage;\r\n }",
"BufferedImage outputImage();",
"private RealMatrix retrieveImageIntensities(String filename) {\n\t\tBufferedImage img = null;\n\t\tdouble matrixData[][] = null; \n\t\ttry {\n\t\t\t\n\t\t\t// Read in the image.\n\t\t\timg = ImageIO.read(new File(filename));\n\t\t\tmatrixData = new double[img.getWidth()][img.getHeight()];\n\n\t\t\t// Transform the image into a grayscale image.\n\t\t\tRaster raster = img.getData();\n\t\t\tfor (int i=0; i < img.getWidth(); i++) {\n\t\t\t\tfor (int j=0; j < img.getHeight(); j++) {\n\t\t\t\t\tint gray = raster.getPixel(i, j, new int[raster.getNumBands()])[0];\n\t\t\t\t\tdouble convertedGray = (double) gray / 255;\n\t\t\t\t\tif (convertedGray > 255) {\n\t\t\t\t\t\tSystem.out.println(\"wrong2\");\n\t\t\t\t\t}\n\t\t\t\t\tmatrixData[i][j] = convertedGray;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error reading \" + filename);\n\t\t}\n\t\treturn MatrixUtils.createRealMatrix(matrixData);\n\t}",
"public RecognitionResult recognize(Mat inputImage){\n return recoApp.recognition(inputImage);\n }",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"public native MagickImage enhanceImage() throws MagickException;",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public int[][][] rescaleImage(int[][][] image, float scale) {\r\n int height = image[0].length;\r\n int width = image.length;\r\n BufferedImage result = new BufferedImage(width, height, 1);\r\n //loop through all pixels.\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n int a = image[x][y][0];\r\n int r = image[x][y][1];\r\n int g = image[x][y][2];\r\n int b = image[x][y][3];\r\n\r\n r = (int) (r * scale);\r\n g = (int) (g * scale);\r\n b = (int) (b * scale);\r\n\r\n image[x][y][0] = a;\r\n image[x][y][1] = r;\r\n image[x][y][2] = g;\r\n image[x][y][3] = b;\r\n }\r\n }\r\n return image; //return array\r\n }",
"public void setOutput8BitGray(boolean output8BitGray) {\n/* 158 */ this.output8BitGray = output8BitGray;\n/* */ }",
"public static BufferedImage toBufferedImage(Image image) {\n\t\tif (image instanceof BufferedImage) {\n\t\t\treturn (BufferedImage) image;\n\t\t}\n\n\t\t// This code ensures that all the pixels in the image are loaded\n\t\timage = new ImageIcon(image).getImage();\n\n\t\t// Determine if the image has transparent pixels; for this method's\n\t\t// implementation, see Determining If an Image Has Transparent Pixels\n\t\tboolean hasAlpha = false; // hasAlpha(image);\n\n\t\t// Create a buffered image with a format that's compatible with the\n\t\t// screen\n\t\tBufferedImage bimage = null;\n\t\tGraphicsEnvironment ge = GraphicsEnvironment\n\t\t\t\t.getLocalGraphicsEnvironment();\n\t\ttry {\n\t\t\t// Determine the type of transparency of the new buffered image\n\t\t\tint transparency = Transparency.OPAQUE;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttransparency = Transparency.BITMASK;\n\t\t\t}\n\n\t\t\t// Create the buffered image\n\t\t\tGraphicsDevice gs = ge.getDefaultScreenDevice();\n\t\t\tGraphicsConfiguration gc = gs.getDefaultConfiguration();\n\t\t\tbimage = gc.createCompatibleImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), transparency);\n\t\t} catch (HeadlessException e) {\n\t\t\t// The system does not have a screen\n\t\t}\n\n\t\tif (bimage == null) {\n\t\t\t// Create a buffered image using the default color model\n\t\t\tint type = BufferedImage.TYPE_INT_RGB;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttype = BufferedImage.TYPE_INT_ARGB;\n\t\t\t}\n\t\t\tbimage = new BufferedImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), type);\n\t\t}\n\n\t\t// Copy image to buffered image\n\t\tGraphics g = bimage.createGraphics();\n\n\t\t// Paint the image onto the buffered image\n\t\tg.drawImage(image, 0, 0, null);\n\t\tg.dispose();\n\n\t\treturn bimage;\n\t}",
"public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }",
"BufferedImage getImage(Mat mat){\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR);\n\n //Hue Saturation Lighting to Blue Green Red values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR);\n\n //Re-reverses Blue and Red color values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB);\n\n //Sets colors to grayscale\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY);\n\n\n getSpace(mat);\n WritableRaster raster = img.getRaster();\n DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer();\n byte[] data = dataBuffer.getData();\n mat.get(0, 0, data);\n return img;\n }",
"public static BufferedImage scaleImage(BufferedImage image, double scale){\n\t\tWritableRaster inRaster = image.getRaster();\n\t\t\n\t\tint w = (int)Math.round(image.getWidth() * scale);\n\t\tint h = (int)Math.round(image.getHeight() * scale);\n\t\tWritableRaster outRaster = inRaster.createCompatibleWritableRaster(w, h);\n\t\t\n\t\tObject outData = null;\n\t\tfor(int j=0; j<h; j++){\n\t\t\tfor(int i=0; i<w; i++){\n\t\t\t\toutData = inRaster.getDataElements((int)(i/scale), (int)(j/scale), outData);\n\t\t\t\toutRaster.setDataElements(i, j, outData);\n\t\t\t}\n\t\t}\n\t\t\n\t\tBufferedImage outImage = new BufferedImage(image.getColorModel(), outRaster, image.isAlphaPremultiplied(), null);\n\t\treturn outImage;\n\t}",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }"
] | [
"0.8336501",
"0.82492745",
"0.78515035",
"0.7851327",
"0.7771355",
"0.7738514",
"0.7716189",
"0.7669337",
"0.7228532",
"0.712789",
"0.6923764",
"0.6878685",
"0.683901",
"0.680184",
"0.6788546",
"0.67771477",
"0.6729309",
"0.6717705",
"0.66157866",
"0.6585706",
"0.6585147",
"0.64418525",
"0.63801",
"0.6321902",
"0.63068825",
"0.6284364",
"0.6245352",
"0.60904217",
"0.60904217",
"0.60900015",
"0.6062402",
"0.6060898",
"0.60531336",
"0.59293914",
"0.5928547",
"0.583561",
"0.57700694",
"0.5732456",
"0.5667263",
"0.5637159",
"0.5621808",
"0.5617813",
"0.5566005",
"0.5513725",
"0.5509553",
"0.55054176",
"0.5499848",
"0.5466607",
"0.5428688",
"0.5421535",
"0.541437",
"0.5357547",
"0.5344663",
"0.53327173",
"0.52782875",
"0.5277187",
"0.5257498",
"0.5234707",
"0.5226909",
"0.5217719",
"0.5193081",
"0.51844496",
"0.51676726",
"0.5091067",
"0.5086507",
"0.50812644",
"0.50812644",
"0.50812644",
"0.5076616",
"0.50753206",
"0.5058021",
"0.5057102",
"0.4978698",
"0.4946909",
"0.49414408",
"0.49240845",
"0.4914807",
"0.4914651",
"0.48937643",
"0.48886135",
"0.48837304",
"0.48771024",
"0.48685214",
"0.48675042",
"0.48533908",
"0.48472273",
"0.48311907",
"0.4830375",
"0.48198014",
"0.4818245",
"0.4802727",
"0.48012727",
"0.478882",
"0.4785618",
"0.47803512",
"0.47784942",
"0.4778068",
"0.47766033",
"0.47671416",
"0.47113425"
] | 0.80098665 | 2 |
Converts an Image to a ColorImage | public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,
ColorModelUnknownException {
if (img instanceof GrayImage) {
return toColor((GrayImage) img);
} else if (img instanceof RealGrayImage) {
return toColor((RealGrayImage) img);
} else if (img instanceof ColorImage) {
return toColor((ColorImage) img);
} else if (img instanceof RealColorImage) {
return toColor((RealColorImage) img);
} else {
return toColor((ComplexImage) img);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"Picture colourComponentImage() throws Exception;",
"public abstract RGBIColor toRGBColor();",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public abstract RGBFColor toRGBFColor();",
"public void updateImage(ColorImage newImage) {\n currentImage.push(newImage);\n }",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public HTColorImage(BufferedImage bImage)\n\t{\n\t\tif (bImage == null)\n\t\t{\n\t\t\tthrow new HTException(\"Image is null\");\n\t\t}\t\n\t\timg = HTUtil.getCopy(bImage);\n\t}",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"public static BufferedImage convertToBufferedImage(Image in)\n throws Exception {\n\n Image argb32Image;\n if (in.getFormat() == Format.ARGB32) {\n argb32Image = in;\n } else {\n argb32Image = convert(in, Format.ARGB32);\n }\n\n ConvertorToBufferedImage convertor = Conversion\n .getConvertorToBufferedImage(Format.ARGB32);\n if (convertor == null) {\n throw new UnsupportedFormatException(\"Cannot convert from \"\n + Format.ARGB32 + \" to BufferedImage\");\n }\n return convertor.convert(argb32Image);\n }",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public HTColorImage(HTImage sourceImage) {\n\t\tthis(sourceImage.getImage());\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"private BufferedImage initImg() throws IOException {\n\t\tint h = 256, w = 256;\n\t\tBufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB);\n\t\t\n\t\t//int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000;\n\t\tshort max = 0, min = 255, c = max;\n\t\tint color = SimpleImageViewer.getIntPixel(c, c, c);\n\t\t\n\t\tfor (int y = 0; y < h; y++) {\n\t\t\tfor (int x = 0; x < w; x++) {\n\t\t\t\timg.setRGB(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn img;\n\t}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"private void greenGradient(BufferedImage myBufferedImage,\n ImageView myImage) {\n gradientPainter.setGradientColor(Color.GREEN);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"BufferedImage getImage();",
"BufferedImage getImage();",
"BufferedImage getImage();",
"public static BufferedImage toImage(VImage vImage) {\n BufferedImage image = new BufferedImage(vImage.getWidth(), vImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n System.arraycopy(vImage.getData(), 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0,\n vImage.getWidth() * vImage.getHeight() * 3);\n return image;\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public HTColorImage(HTColorImage htImage)\n\t{\n\t\timg = HTUtil.getCopy(htImage.getImage());\n\t}",
"public static WritableImage copyImage(Image image) {\n int height=(int)image.getHeight();\n int width=(int)image.getWidth();\n PixelReader pixelReader=image.getPixelReader();\n WritableImage writableImage = new WritableImage(width,height);\n PixelWriter pixelWriter = writableImage.getPixelWriter();\n\n for (int y = 0; y < height; y++){\n for (int x = 0; x < width; x++){\n Color color = pixelReader.getColor(x, y);\n pixelWriter.setColor(x, y, color);\n }\n }\n return writableImage;\n }",
"public ColorImage getImagem(){\n\t\treturn copiaFoto(this.fotografia);\n\t}",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }",
"void greyscale();",
"void greyscale();",
"private void redGradient(BufferedImage myBufferedImage, ImageView myImage) {\n gradientPainter.setGradientColor(Color.RED);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"public Image readImage() throws IOException\n {\n int width = readInt();\n int height = readInt();\n int[] rgbData = new int[width*height];\n for (int ii = 0; ii < rgbData.length; ii++)\n {\n rgbData[ii] = readInt();\n }\n return Image.createRGBImage(rgbData, width, height, true);\n }",
"private static Image Transform1ColorToTransparency2ToColors(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor1,\n\t\t\tfinal Color c5, final Color c6, final int otherColor2){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\t\tfinal int r5 = c5.getRed();\n\t\tfinal int g5 = c5.getGreen();\n\t\tfinal int b5 = c5.getBlue();\n\t\tfinal int r6 = c6.getRed();\n\t\tfinal int g6 = c6.getGreen();\n\t\tfinal int b6 = c6.getBlue();\n\n\t\tfinal ImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor1;\n\t\t}\n\t\tif (r >= r5 && r <= r6 &&\n\t\t\t\tg >= g5 && g <= g6 &&\n\t\t\t\tb >= b5 && b <= b6){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor2;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"public native MagickImage colorizeImage(String opacity, PixelPacket target)\n\t\t\tthrows MagickException;",
"public static Try<byte[]> imageToPng(BufferedImage image) {\n return Try.of(() -> Imaging.writeImageToBytes(image, ImageFormats.PNG, null))\n .logIfFailure(TAG, err -> \"failed to convert image to bytes\");\n }",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"BufferedImage getImage(Mat mat){\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR);\n\n //Hue Saturation Lighting to Blue Green Red values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR);\n\n //Re-reverses Blue and Red color values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB);\n\n //Sets colors to grayscale\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY);\n\n\n getSpace(mat);\n WritableRaster raster = img.getRaster();\n DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer();\n byte[] data = dataBuffer.getData();\n mat.get(0, 0, data);\n return img;\n }",
"public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }",
"public void apply(OFImage image)\n {\n int height = image.getHeight();\n int width = image.getWidth();\n OFImage original = new OFImage(image);\n \n for(int y = 0; y < height; y++) {\n for(int x = 0; x < width; x++) {\n Color currentPixel = original.getPixel(x,y);\n int grn,blu,red;\n grn = 255 - currentPixel.getGreen();\n red = 255 - currentPixel.getRed();\n blu = 255 - currentPixel.getBlue();\n image.setPixel(x, y, new Color(red,blu,grn));\n }\n }\n }",
"public static BufferedImage toBufferedImage(Image image) {\r\n if (image instanceof BufferedImage) {\r\n return (BufferedImage) image;\r\n }\r\n\r\n // This code ensures that all the pixels in the image are loaded\r\n image = new ImageIcon(image).getImage();\r\n\r\n // Determine if the image has transparent pixels; for this method's\r\n // implementation, see Determining If an Image Has Transparent Pixels\r\n boolean hasAlpha = true;\r\n\r\n // Create a buffered image with a format that's compatible with the screen\r\n BufferedImage bimage = null;\r\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\r\n try {\r\n // Determine the type of transparency of the new buffered image\r\n int transparency = Transparency.OPAQUE;\r\n if (hasAlpha) {\r\n transparency = Transparency.BITMASK;\r\n }\r\n\r\n // Create the buffered image\r\n GraphicsDevice gs = ge.getDefaultScreenDevice();\r\n GraphicsConfiguration gc = gs.getDefaultConfiguration();\r\n bimage = gc.createCompatibleImage(\r\n image.getWidth(null), image.getHeight(null), transparency);\r\n } catch (HeadlessException e) {\r\n // The system does not have a screen\r\n }\r\n\r\n if (bimage == null) {\r\n // Create a buffered image using the default color model\r\n int type = BufferedImage.TYPE_INT_RGB;\r\n if (hasAlpha) {\r\n type = BufferedImage.TYPE_INT_ARGB;\r\n }\r\n bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);\r\n }\r\n\r\n // Copy image to buffered image\r\n Graphics g = bimage.createGraphics();\r\n\r\n // Paint the image onto the buffered image\r\n g.drawImage(image, 0, 0, null);\r\n g.dispose();\r\n\r\n return bimage;\r\n }",
"public static BufferedImage createImage(GBAGraphic graphic, GBAPalette palette){\n Objects.requireNonNull(graphic);\n Objects.requireNonNull(palette);\n BufferedImage img = new BufferedImage( graphic.getWidth(), graphic.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);\n //TODO: Convert this into a proper Indexed image?\n int[] pixels1D = Arrays.stream(graphic.to1DArray()).map(i -> palette.get(i).getColor().getRGB()).toArray();\n img.setRGB(0, 0, graphic.getWidth(), graphic.getHeight(), pixels1D, 0, graphic.getWidth());\n return img;\n }",
"java.awt.Color getColor();",
"protected abstract PixelAsColors applyToPixel(Node n) throws IllegalArgumentException;",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public native boolean transformRgbImage(int colorspace)\n\t\t\tthrows MagickException;",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static BufferedImage toBufferedImage(Image image) {\n\t\tif (image instanceof BufferedImage) {\n\t\t\treturn (BufferedImage) image;\n\t\t}\n\n\t\t// This code ensures that all the pixels in the image are loaded\n\t\timage = new ImageIcon(image).getImage();\n\n\t\t// Determine if the image has transparent pixels; for this method's\n\t\t// implementation, see Determining If an Image Has Transparent Pixels\n\t\tboolean hasAlpha = false; // hasAlpha(image);\n\n\t\t// Create a buffered image with a format that's compatible with the\n\t\t// screen\n\t\tBufferedImage bimage = null;\n\t\tGraphicsEnvironment ge = GraphicsEnvironment\n\t\t\t\t.getLocalGraphicsEnvironment();\n\t\ttry {\n\t\t\t// Determine the type of transparency of the new buffered image\n\t\t\tint transparency = Transparency.OPAQUE;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttransparency = Transparency.BITMASK;\n\t\t\t}\n\n\t\t\t// Create the buffered image\n\t\t\tGraphicsDevice gs = ge.getDefaultScreenDevice();\n\t\t\tGraphicsConfiguration gc = gs.getDefaultConfiguration();\n\t\t\tbimage = gc.createCompatibleImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), transparency);\n\t\t} catch (HeadlessException e) {\n\t\t\t// The system does not have a screen\n\t\t}\n\n\t\tif (bimage == null) {\n\t\t\t// Create a buffered image using the default color model\n\t\t\tint type = BufferedImage.TYPE_INT_RGB;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttype = BufferedImage.TYPE_INT_ARGB;\n\t\t\t}\n\t\t\tbimage = new BufferedImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), type);\n\t\t}\n\n\t\t// Copy image to buffered image\n\t\tGraphics g = bimage.createGraphics();\n\n\t\t// Paint the image onto the buffered image\n\t\tg.drawImage(image, 0, 0, null);\n\t\tg.dispose();\n\n\t\treturn bimage;\n\t}",
"public BufferedImage convertByteToImage(byte[] imageByteArr) throws IOException {\r\n return ImageIO.read(new ByteArrayInputStream(imageByteArr));\r\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public Image showChanelG(Image image) {\n MyGreenFilter filter = new MyGreenFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n }",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"@Override\n public native Color getPixelColor(int x, int y);",
"void colorize(ObservableValue<? extends Number> ov, Number old_val,\n Number new_val, Color color, BufferedImage myBufferedImage,\n ImageView myImage) {\n double coefColor = (new_val.doubleValue() / 100 + 0.5)\n / (old_val.doubleValue() / 100 + 0.5);\n this.colorizer.setChangeColor(color);\n this.colorizer.setRatio(coefColor);\n myBufferedImage = Utils.clone(this.colorizer.process(myBufferedImage));\n myImage.setImage(SwingFXUtils.toFXImage(myBufferedImage, null));\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public static int[] getPixelColor(final BufferedImage img, final int x, final int y){\n int rgb = img.getRGB(x, y);\n int r = (rgb >> 16) & 0xFF;\n int g = (rgb >> 8) & 0xFF;\n int b = (rgb & 0xFF);\n\t\n return new int[]{r,g,b};\n }",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"BufferedImage outputImage();",
"Image createImage(List<List<Pixel>> pixelArray);",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"void imageData(int width, int height, int[] rgba);",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public static int[] getPixelColor(BufferedImage image,int x,int y) {\n int colors[] = new int[3];\n int clr = 0;\n\n try{\n clr = image.getRGB(x,y); \n }catch(Exception e){\n System.out.println(e);\n System.out.println(x + \" \" + y);\n }\n\n int red = (clr & 0x00ff0000) >> 16;\n int green = (clr & 0x0000ff00) >> 8;\n int blue = clr & 0x000000ff;\n colors[0] = red;\n colors[1] = green;\n colors[2] = blue;\n return colors;\n }",
"Color getColor();"
] | [
"0.7942161",
"0.75422615",
"0.7368646",
"0.73220706",
"0.7195428",
"0.69078726",
"0.67145014",
"0.64546657",
"0.62388337",
"0.6212763",
"0.6197345",
"0.6189294",
"0.60952663",
"0.6084977",
"0.6067005",
"0.6041156",
"0.6011418",
"0.5989035",
"0.5965543",
"0.59522766",
"0.588939",
"0.5870471",
"0.5841971",
"0.58025163",
"0.57981384",
"0.5784258",
"0.5701633",
"0.56984067",
"0.56632936",
"0.56413555",
"0.56046486",
"0.55999964",
"0.55990624",
"0.5593291",
"0.5585613",
"0.5582396",
"0.5565942",
"0.5543488",
"0.5542969",
"0.5535607",
"0.5518665",
"0.55170095",
"0.5503118",
"0.54818964",
"0.541314",
"0.54021794",
"0.5395603",
"0.5395603",
"0.5395603",
"0.5374614",
"0.5370793",
"0.53480023",
"0.5345407",
"0.5337635",
"0.5320667",
"0.5313383",
"0.5309609",
"0.5300758",
"0.5300758",
"0.52946126",
"0.5286363",
"0.5282099",
"0.5281015",
"0.5279542",
"0.52717924",
"0.5226031",
"0.52247685",
"0.52158034",
"0.52072644",
"0.5201878",
"0.519823",
"0.5196024",
"0.51799476",
"0.5170637",
"0.51576746",
"0.5155805",
"0.5151861",
"0.5145318",
"0.5142487",
"0.51346046",
"0.51140857",
"0.51026934",
"0.5100338",
"0.51001143",
"0.50999594",
"0.50876904",
"0.50866884",
"0.50789636",
"0.50703007",
"0.50533754",
"0.5042662",
"0.5023322",
"0.5016882",
"0.49702182",
"0.4940686",
"0.4929227",
"0.49212578",
"0.49132913",
"0.4899068",
"0.48926124"
] | 0.74004304 | 2 |
Converts an Image to a RealColorImage | public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,
ColorModelUnknownException {
if (img instanceof GrayImage) {
return toRealColor((GrayImage) img);
} else if (img instanceof RealGrayImage) {
return toRealColor((RealGrayImage) img);
} else if (img instanceof ColorImage) {
return toRealColor((ColorImage) img);
} else if (img instanceof RealColorImage) {
return toRealColor((RealColorImage) img);
} else {
return toRealColor((ComplexImage) img);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public abstract RGBFColor toRGBFColor();",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"BufferedImage getImage();",
"BufferedImage getImage();",
"BufferedImage getImage();",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private BufferedImage initImg() throws IOException {\n\t\tint h = 256, w = 256;\n\t\tBufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB);\n\t\t\n\t\t//int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000;\n\t\tshort max = 0, min = 255, c = max;\n\t\tint color = SimpleImageViewer.getIntPixel(c, c, c);\n\t\t\n\t\tfor (int y = 0; y < h; y++) {\n\t\t\tfor (int x = 0; x < w; x++) {\n\t\t\t\timg.setRGB(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn img;\n\t}",
"Picture colourComponentImage() throws Exception;",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public static BufferedImage convertToBufferedImage(Image in)\n throws Exception {\n\n Image argb32Image;\n if (in.getFormat() == Format.ARGB32) {\n argb32Image = in;\n } else {\n argb32Image = convert(in, Format.ARGB32);\n }\n\n ConvertorToBufferedImage convertor = Conversion\n .getConvertorToBufferedImage(Format.ARGB32);\n if (convertor == null) {\n throw new UnsupportedFormatException(\"Cannot convert from \"\n + Format.ARGB32 + \" to BufferedImage\");\n }\n return convertor.convert(argb32Image);\n }",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"void greyscale();",
"void greyscale();",
"public abstract RGBIColor toRGBColor();",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static BufferedImage toBufferedImage(Image image) {\r\n if (image instanceof BufferedImage) {\r\n return (BufferedImage) image;\r\n }\r\n\r\n // This code ensures that all the pixels in the image are loaded\r\n image = new ImageIcon(image).getImage();\r\n\r\n // Determine if the image has transparent pixels; for this method's\r\n // implementation, see Determining If an Image Has Transparent Pixels\r\n boolean hasAlpha = true;\r\n\r\n // Create a buffered image with a format that's compatible with the screen\r\n BufferedImage bimage = null;\r\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\r\n try {\r\n // Determine the type of transparency of the new buffered image\r\n int transparency = Transparency.OPAQUE;\r\n if (hasAlpha) {\r\n transparency = Transparency.BITMASK;\r\n }\r\n\r\n // Create the buffered image\r\n GraphicsDevice gs = ge.getDefaultScreenDevice();\r\n GraphicsConfiguration gc = gs.getDefaultConfiguration();\r\n bimage = gc.createCompatibleImage(\r\n image.getWidth(null), image.getHeight(null), transparency);\r\n } catch (HeadlessException e) {\r\n // The system does not have a screen\r\n }\r\n\r\n if (bimage == null) {\r\n // Create a buffered image using the default color model\r\n int type = BufferedImage.TYPE_INT_RGB;\r\n if (hasAlpha) {\r\n type = BufferedImage.TYPE_INT_ARGB;\r\n }\r\n bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);\r\n }\r\n\r\n // Copy image to buffered image\r\n Graphics g = bimage.createGraphics();\r\n\r\n // Paint the image onto the buffered image\r\n g.drawImage(image, 0, 0, null);\r\n g.dispose();\r\n\r\n return bimage;\r\n }",
"public static BufferedImage toBufferedImage(Image image) {\n\t\tif (image instanceof BufferedImage) {\n\t\t\treturn (BufferedImage) image;\n\t\t}\n\n\t\t// This code ensures that all the pixels in the image are loaded\n\t\timage = new ImageIcon(image).getImage();\n\n\t\t// Determine if the image has transparent pixels; for this method's\n\t\t// implementation, see Determining If an Image Has Transparent Pixels\n\t\tboolean hasAlpha = false; // hasAlpha(image);\n\n\t\t// Create a buffered image with a format that's compatible with the\n\t\t// screen\n\t\tBufferedImage bimage = null;\n\t\tGraphicsEnvironment ge = GraphicsEnvironment\n\t\t\t\t.getLocalGraphicsEnvironment();\n\t\ttry {\n\t\t\t// Determine the type of transparency of the new buffered image\n\t\t\tint transparency = Transparency.OPAQUE;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttransparency = Transparency.BITMASK;\n\t\t\t}\n\n\t\t\t// Create the buffered image\n\t\t\tGraphicsDevice gs = ge.getDefaultScreenDevice();\n\t\t\tGraphicsConfiguration gc = gs.getDefaultConfiguration();\n\t\t\tbimage = gc.createCompatibleImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), transparency);\n\t\t} catch (HeadlessException e) {\n\t\t\t// The system does not have a screen\n\t\t}\n\n\t\tif (bimage == null) {\n\t\t\t// Create a buffered image using the default color model\n\t\t\tint type = BufferedImage.TYPE_INT_RGB;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttype = BufferedImage.TYPE_INT_ARGB;\n\t\t\t}\n\t\t\tbimage = new BufferedImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), type);\n\t\t}\n\n\t\t// Copy image to buffered image\n\t\tGraphics g = bimage.createGraphics();\n\n\t\t// Paint the image onto the buffered image\n\t\tg.drawImage(image, 0, 0, null);\n\t\tg.dispose();\n\n\t\treturn bimage;\n\t}",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static BufferedImage toImage(VImage vImage) {\n BufferedImage image = new BufferedImage(vImage.getWidth(), vImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n System.arraycopy(vImage.getData(), 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0,\n vImage.getWidth() * vImage.getHeight() * 3);\n return image;\n }",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public HTColorImage(BufferedImage bImage)\n\t{\n\t\tif (bImage == null)\n\t\t{\n\t\t\tthrow new HTException(\"Image is null\");\n\t\t}\t\n\t\timg = HTUtil.getCopy(bImage);\n\t}",
"public Image readImage() throws IOException\n {\n int width = readInt();\n int height = readInt();\n int[] rgbData = new int[width*height];\n for (int ii = 0; ii < rgbData.length; ii++)\n {\n rgbData[ii] = readInt();\n }\n return Image.createRGBImage(rgbData, width, height, true);\n }",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"BufferedImage getImage(Mat mat){\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR);\n\n //Hue Saturation Lighting to Blue Green Red values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR);\n\n //Re-reverses Blue and Red color values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB);\n\n //Sets colors to grayscale\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY);\n\n\n getSpace(mat);\n WritableRaster raster = img.getRaster();\n DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer();\n byte[] data = dataBuffer.getData();\n mat.get(0, 0, data);\n return img;\n }",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public void updateImage(ColorImage newImage) {\n currentImage.push(newImage);\n }",
"private void redGradient(BufferedImage myBufferedImage, ImageView myImage) {\n gradientPainter.setGradientColor(Color.RED);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"public RawImage(BufferedImage img, int res) {\n boolean[] alpha = new boolean[1];\n m_img = ImageHelper.convertToRGB(img, alpha);\n m_hasAlpha = alpha[0];\n m_height = m_img.length;\n m_width = m_height > 0 ? m_img[0].length : 0;\n m_res = res;\n }",
"public void toRed(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"BufferedImage outputImage();",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}",
"public static Image toImage(BufferedImage bufferedImage) {\r\n return Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());\r\n }",
"public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"Image createImage();",
"static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"private BufferedImage user_space(BufferedImage image) {\n // create new_img with the attributes of image\n BufferedImage new_img = new BufferedImage(image.getWidth(),\n image.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n Graphics2D graphics = new_img.createGraphics();\n graphics.drawRenderedImage(image, null);\n graphics.dispose(); // release all allocated memory for this image\n return new_img;\n }",
"public static Try<byte[]> imageToPng(BufferedImage image) {\n return Try.of(() -> Imaging.writeImageToBytes(image, ImageFormats.PNG, null))\n .logIfFailure(TAG, err -> \"failed to convert image to bytes\");\n }",
"public BufferedImage convertByteToImage(byte[] imageByteArr) throws IOException {\r\n return ImageIO.read(new ByteArrayInputStream(imageByteArr));\r\n }",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"public ColorImage getImagem(){\n\t\treturn copiaFoto(this.fotografia);\n\t}",
"public native void textureImage(MagickImage image) throws MagickException;",
"protected abstract float[] getRgbLut();"
] | [
"0.8310089",
"0.8149541",
"0.7959516",
"0.7857532",
"0.78256834",
"0.78108466",
"0.74595106",
"0.72936684",
"0.69709605",
"0.67350185",
"0.672775",
"0.6714298",
"0.6704838",
"0.6647896",
"0.6627138",
"0.6528281",
"0.6482928",
"0.63335985",
"0.62970614",
"0.6294165",
"0.62939256",
"0.6231585",
"0.61607945",
"0.61443657",
"0.6136356",
"0.61303544",
"0.6116166",
"0.6069926",
"0.6049068",
"0.6011888",
"0.5997181",
"0.5997181",
"0.5997181",
"0.59894764",
"0.5982202",
"0.59807605",
"0.5980323",
"0.5951655",
"0.5938661",
"0.59067225",
"0.58993524",
"0.5860602",
"0.5860602",
"0.5840574",
"0.5795985",
"0.57645255",
"0.5723933",
"0.57223415",
"0.5722157",
"0.57195324",
"0.57191443",
"0.5710942",
"0.5710653",
"0.57006854",
"0.5690797",
"0.5666144",
"0.5657726",
"0.56551707",
"0.5640953",
"0.56291324",
"0.56270385",
"0.562311",
"0.56044483",
"0.5586177",
"0.5581778",
"0.55813944",
"0.55811757",
"0.5565669",
"0.55634224",
"0.5554942",
"0.5543709",
"0.5519232",
"0.54972506",
"0.5486894",
"0.54833245",
"0.5472338",
"0.5462874",
"0.5458427",
"0.5409657",
"0.5406436",
"0.5389933",
"0.53857607",
"0.53702545",
"0.5360232",
"0.53472257",
"0.5336197",
"0.5334886",
"0.5297609",
"0.52949154",
"0.5278003",
"0.5275836",
"0.5272003",
"0.52630395",
"0.52611095",
"0.5260116",
"0.5215265",
"0.52118963",
"0.52068317",
"0.52017576",
"0.5199203"
] | 0.7564904 | 6 |
Converts an Image to a ComplexImage | public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,
ColorModelUnknownException {
if (img instanceof GrayImage) {
return toComplex((GrayImage) img);
} else if (img instanceof RealGrayImage) {
return toComplex((RealGrayImage) img);
} else if (img instanceof ColorImage) {
return toComplex((ColorImage) img);
} else if (img instanceof RealColorImage) {
return toComplex((RealColorImage) img);
} else {
return toComplex((ComplexImage) img);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public IImage createImage(IImage image, int x, int y, int width, int height, int transform) {\n return null;\r\n }",
"public abstract BufferedImage transform();",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public MagickImage(ImageInfo imageInfo, byte[] blob) throws MagickException {\n\t\tblobToImage(imageInfo, blob);\n\t}",
"Builder addImage(ImageObject value);",
"Image createImage();",
"public PlainImage(Image image) {\r\n\t\tthis.image = image;\r\n\t}",
"public native void blobToImage(ImageInfo imageInfo, byte[] blob)\n\t\t\tthrows MagickException;",
"public native MagickImage enhanceImage() throws MagickException;",
"@Override\r\n\t\tpublic MyImage createMyImage(MyImage myimage) {\r\n\t\t\t\r\n\t\t\treturn myimg.createMyImage(myimage);\r\n\t\t}",
"BufferedImage outputImage();",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Object getCompositeImage(Object baseImage, Object overlayImage) {\n\t\tList<Object> images = new ArrayList<Object>(2);\n\t\timages.add(baseImage);\n\t\timages.add(overlayImage);\n\t\t\n\t\tObject image = new ComposedImage(images);\n\t\treturn image;\n\t}",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"private Image getScaledImage(Image image, float x, float y) {\n AffineTransform transform = new AffineTransform();\n transform.scale(x, y);\n transform.translate(\n (x-1) * image.getWidth(null) / 2,\n (y-1) * image.getHeight(null) / 2);\n\n // create a transparent (not translucent) image\n Image newImage = gc.createCompatibleImage(\n image.getWidth(null),\n image.getHeight(null),\n Transparency.BITMASK);\n\n // draw the transformed image\n Graphics2D g = (Graphics2D)newImage.getGraphics();\n g.drawImage(image, transform, null);\n g.dispose();\n\n return newImage;\n }",
"BufferedImage getImage();",
"BufferedImage getImage();",
"BufferedImage getImage();",
"private Bitmap getScaledImage(Bitmap imageBitmap) {\n\t\tBitmap scaledBitmap = null;\n\t\ttry {\n\n\t\t\tMatrix matrix = new Matrix();\n\t\t\tmatrix.postRotate(90);\n\n\t\t\tBitmap rotatedBitmap = Bitmap.createScaledBitmap(imageBitmap, PHOTO_W, PHOTO_H, false);\n\t\t\tscaledBitmap = Bitmap.createBitmap(rotatedBitmap , 0, 0, rotatedBitmap.getWidth(), rotatedBitmap.getHeight(), matrix, true);\n\n\t\t} catch (Throwable e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn scaledBitmap;\n\t}",
"private Image getScaledImage(Image sourceImage)\n {\n //create storage for the new image\n BufferedImage resizedImage = new BufferedImage(50, 50,\n BufferedImage.TYPE_INT_ARGB);\n\n //create a graphic from the image\n Graphics2D g2 = resizedImage.createGraphics();\n\n //sets the rendering options\n g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,\n RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\n //copies the source image into the new image\n g2.drawImage(sourceImage, 0, 0, 50, 50, null);\n\n //clean up\n g2.dispose();\n\n //return 50 x 50 image\n return resizedImage;\n }",
"public native MagickImage magnifyImage() throws MagickException;",
"public Image getImagen() {\n\t\tRectangle rootFigureBounds = this.getBounds();\n\t\tGC figureCanvasGC = new GC(this.canvas);\n\n\t\tImage image = new Image(this.canvas.getDisplay(), rootFigureBounds.width,\n\t\t\t\trootFigureBounds.height);\n\t\tGC imageGC = new GC(image);\n\n\t\timageGC.setBackground(figureCanvasGC.getBackground());\n\t\timageGC.setForeground(figureCanvasGC.getForeground());\n\t\timageGC.setFont(figureCanvasGC.getFont());\n\t\timageGC.setLineStyle(figureCanvasGC.getLineStyle());\n\t\timageGC.setLineWidth(figureCanvasGC.getLineWidth());\n\t\t// imageGC.setXORMode(figureCanvasGC.getXORMode());\n\n\t\tGraphics imgGraphics = new SWTGraphics(imageGC);\n\t\tthis.paint(imgGraphics);\n\n\t\treturn image;\n\t}",
"Picture binaryComponentImage() throws Exception;",
"public native byte[] imageToBlob(ImageInfo imageInfo);",
"List<List<Pixel>> transform(Image img, String operation);",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Coloca_imagen(){\n \n \n }",
"public Mat getConvertedImage() {\n return this.convertedImage;\n }",
"public static Bitmap convertSingleBitmap (PicObject picOb){\n Bitmap bitmap = decodeBase64(picOb.getImage());\n captionListNews.add(picOb.getCaption());\n return bitmap;\n }",
"private void enhanceImage(){\n }",
"public static Object getCompositeImage(Object baseImage, Object overlayImage, final int moveX,\n\t\t\tfinal int moveY) {\n\t\tList<Object> images = new ArrayList<Object>(2);\n\t\timages.add(baseImage);\n\t\timages.add(overlayImage);\n\t\t\n\t\tObject image = new ComposedImage(images) {\n\t\t\t@Override\n\t\t\tpublic List<Point> getDrawPoints(Size size) {\n\t\t\t\tList<ComposedImage.Point> result = super.getDrawPoints(size);\n\t\t\t\tresult.get(1).x = moveX;\n\t\t\t\tresult.get(1).y = moveY;\n\t\t\t\treturn result;\n\t\t\t}// getDrawPoints\n\t\t};\n\t\treturn image;\n\t}",
"IMG createIMG();",
"public Image createImage(String part, Image image) throws IOException {\n\t\t\t craeteFolder(part);\n\t\t\t File outputFile = new File(part+image.getId()+\".\"+image.getType());\n\t\t\t FileOutputStream outputStream = new FileOutputStream(outputFile);\n\t\t byte[] base64Decoded = DatatypeConverter.parseBase64Binary(image.getByteOrpart());\t\t\t\t\t \t\t\t\t\n\t\t outputStream.write(base64Decoded);\n\t\t image.setByteOrpart(part+image.getId()+\".\"+image.getType());\n\t\t \t\n\t\treturn image;\n\t}",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public static WritableImage copyImage(Image image) {\n int height=(int)image.getHeight();\n int width=(int)image.getWidth();\n PixelReader pixelReader=image.getPixelReader();\n WritableImage writableImage = new WritableImage(width,height);\n PixelWriter pixelWriter = writableImage.getPixelWriter();\n\n for (int y = 0; y < height; y++){\n for (int x = 0; x < width; x++){\n Color color = pixelReader.getColor(x, y);\n pixelWriter.setColor(x, y, color);\n }\n }\n return writableImage;\n }",
"public Image creerImage() {\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n\t\ttry {\r\n\t\t\t// Transfert de l image dans le buffer de bytes\r\n\t\t\tImageIO.write(monImage.getImage(), \"png\", baos);\r\n\t\t\t\r\n\t\t\t// Creation d une instance d Image iText\r\n\t\t\tImage image = Image.getInstance(baos.toByteArray());\r\n\t\t\treturn image;\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (BadElementException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public abstract Image gen();",
"public native MagickImage minifyImage() throws MagickException;",
"private void ScaleImage(){\n\t\tBufferedImage resizedImage = new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);\n\t\tGraphics2D g2 = resizedImage.createGraphics();\n\t\tg2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\t\tg2.drawImage(image, 0, 0, this.getWidth(), this.getHeight(), null);\n\t\tg2.dispose();\n\t\tthis.image = resizedImage;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public MagickImage(ImageInfo imageInfo) throws MagickException {\n\t\treadImage(imageInfo);\n\t}",
"private Image scaleImage(Image image) { \n\t\treturn image.getScaledInstance(700, 500, Image.SCALE_SMOOTH); //Going to Scale the Image to the Size and Width Specified with the Highest Smoothness Possible \n\t}",
"private Complex2[][] imgWithOtherMagnitude(Complex2[][] img_1, Complex2[][] img_2) {\n Complex2[][] result = new Complex2[M][N];\n\n for(int x = 0; x < M; x++) {\n for (int y = 0; y < N; y++) {\n double img_1Magnitude = img_1[x][y].Betrag();\n double img_2Phase = img_2[x][y].Phase();\n\n double newReal = img_1Magnitude * Math.cos(img_2Phase);\n double newImag = img_1Magnitude * Math.sin(img_2Phase);\n\n result[x][y] = new Complex2(newReal, newImag);\n }\n }\n\n return result;\n }",
"public Picture(BufferedImage image)\n {\n super(image);\n }",
"public Picture(BufferedImage image)\n {\n super(image);\n }",
"public static BufferedImage scaleImage(BufferedImage image, double scale){\n\t\tWritableRaster inRaster = image.getRaster();\n\t\t\n\t\tint w = (int)Math.round(image.getWidth() * scale);\n\t\tint h = (int)Math.round(image.getHeight() * scale);\n\t\tWritableRaster outRaster = inRaster.createCompatibleWritableRaster(w, h);\n\t\t\n\t\tObject outData = null;\n\t\tfor(int j=0; j<h; j++){\n\t\t\tfor(int i=0; i<w; i++){\n\t\t\t\toutData = inRaster.getDataElements((int)(i/scale), (int)(j/scale), outData);\n\t\t\t\toutRaster.setDataElements(i, j, outData);\n\t\t\t}\n\t\t}\n\t\t\n\t\tBufferedImage outImage = new BufferedImage(image.getColorModel(), outRaster, image.isAlphaPremultiplied(), null);\n\t\treturn outImage;\n\t}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"private Image bitmap2JPEG(Bitmap bit) {\n\n Image baseImage = new Image();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bit.compress(Bitmap.CompressFormat.JPEG, 90, stream);\n byte[] imageBytes = stream.toByteArray();\n baseImage.encodeContent(imageBytes);\n\n return baseImage;\n }",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public ImageIcon scalePicture(ImageIcon image) {\n\t\tImage transImage = image.getImage();\n\t\tImage scaledImage = transImage.getScaledInstance(140, 190, Image.SCALE_SMOOTH);\t\t\n\t\timage = new ImageIcon(scaledImage);\n\t\treturn image;\n\t}",
"public abstract BufferedImage applyTo(BufferedImage image);",
"Builder addImage(ImageObject.Builder value);",
"Imagem getImagem();",
"public static Composition fromImage(BufferedImage img, File file, String name) {\n assert img != null;\n\n img = ImageUtils.toCompatibleImage(img);\n Canvas canvas = new Canvas(img.getWidth(), img.getHeight());\n Composition comp = new Composition(canvas);\n comp.addBaseLayer(img);\n\n if (file != null) {\n comp.setFile(file); // also sets the name based on the file name\n } else if (name != null) {\n comp.setName(name);\n } else {\n // of of the file and name arguments must be set to non-null\n throw new IllegalArgumentException(\"no name could be set\");\n }\n return comp;\n }",
"static BufferedImage doBuforowanegoObrazu(Image img)//Konwersja image do BufferedImage\n {\n //Twożenie bitmapy \n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Rysowanie na bitmapie\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n return bimage;\n }",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage createBufferedImageFromImage(Image image, int width, int height, boolean tran)\r\n { \r\n BufferedImage dest ;\r\n if(tran) \r\n dest = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\r\n else\r\n dest = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\r\n\r\n Graphics2D g2 = dest.createGraphics();\r\n g2.drawImage(image, 0, 0, null);\r\n g2.dispose();\r\n return dest;\r\n }",
"public Builder setImageByTransform(com.yahoo.xpathproto.TransformTestProtos.ContentImage value) {\n if (imageByTransformBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n imageByTransform_ = value;\n onChanged();\n } else {\n imageByTransformBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00001000;\n return this;\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"public ImageProcessor(Pic a) {\n image = a;\n }",
"ElementImage createElementImage();",
"public ModelImage getResultImage() {\r\n return resultImage;\r\n }",
"public ModelImage getResultImage() {\r\n return resultImage;\r\n }",
"public ModelImage getResultImage() {\r\n return resultImage;\r\n }",
"com.yahoo.xpathproto.TransformTestProtos.ContentImageOrBuilder getImageByTransformOrBuilder();",
"com.yahoo.xpathproto.TransformTestProtos.ContentImage getImageByTransform();",
"Image createImage(List<List<Pixel>> pixelArray);",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"@Override\n\tpublic boolean baseToImg() {\n\t\tList<Image> imgList = imageRepository.findAll();\n\t\tfor (Image img : imgList) {\n\t\t\tString base = img.getSource();\n\t\t\tFiles file = new Files(img.getSaegimId(), \"jpg\");\n\t\t\tfile = fileRepository.save(file);\n\t\t\tLong fileId = file.getId();\n\t\t\t\n\t\t\tBase64ToImgDecoder.decoder(base, dir + fileId + '.' + \"jpg\");\n\t\t}\n\t\treturn true;\n\t}",
"public Builder mergeImageByTransform(com.yahoo.xpathproto.TransformTestProtos.ContentImage value) {\n if (imageByTransformBuilder_ == null) {\n if (((bitField0_ & 0x00001000) == 0x00001000) &&\n imageByTransform_ != com.yahoo.xpathproto.TransformTestProtos.ContentImage.getDefaultInstance()) {\n imageByTransform_ =\n com.yahoo.xpathproto.TransformTestProtos.ContentImage.newBuilder(imageByTransform_).mergeFrom(value).buildPartial();\n } else {\n imageByTransform_ = value;\n }\n onChanged();\n } else {\n imageByTransformBuilder_.mergeFrom(value);\n }\n bitField0_ |= 0x00001000;\n return this;\n }",
"public IplImage toIplImage(BufferedImage bufferedImage){\n IplImage iplImage = new IplImage();\n iplImage = IplImage.createFrom(bufferedImage);\n return iplImage;\n }",
"public interface Image {\n public String getPath();\n\n public String getFormat();\n\n public String getWidth();\n\n public String getHeight();\n\n}",
"public Image getFlat();",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public Builder withImage(ImageInfo image) {\n assertNotInvalidated(getClass(),object);\n object.image = image;\n return this;\n }",
"public Mat2Image() {\n }",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"static Image bityNaObraz(String image) throws IOException\n {\n byte[] rysunek = DatatypeConverter.parseBase64Binary(image); \n BufferedImage img = ImageIO.read(new ByteArrayInputStream(rysunek));\n return img;\n }",
"public ImageConverter() {\n this.source = new Mat();\n this.convertedImage = new Mat();\n }",
"private Image ConvertirImagen(byte[] bytes) throws IOException {\n ByteArrayInputStream bis = new ByteArrayInputStream(bytes);\n Iterator readers = ImageIO.getImageReadersByFormatName(\"jpeg\");\n ImageReader reader = (ImageReader) readers.next();\n Object source = bis;\n ImageInputStream iis = ImageIO.createImageInputStream(source);\n reader.setInput(iis, true);\n ImageReadParam param = reader.getDefaultReadParam();\n return reader.read(0, param);\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public native void textureImage(MagickImage image) throws MagickException;",
"public static BufferedImage BToBI(Blob image) throws SQLException, IOException {\n\t\tInputStream in = image.getBinaryStream(); \n\t\tBufferedImage toReturn = ImageIO.read(in);\n\t\treturn toReturn;\n\t}",
"static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}",
"public abstract Image getImage();",
"public abstract Image getImage();",
"Picture identifyComponentImage() throws Exception;",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }"
] | [
"0.7897978",
"0.74313337",
"0.7207492",
"0.71376795",
"0.7095621",
"0.63902414",
"0.6260333",
"0.61534816",
"0.6106841",
"0.6094226",
"0.5782425",
"0.57786506",
"0.5566186",
"0.55481744",
"0.5526237",
"0.54961246",
"0.54747266",
"0.5453244",
"0.5421473",
"0.5384123",
"0.5368506",
"0.534046",
"0.53319275",
"0.5299703",
"0.52693",
"0.52616155",
"0.52616155",
"0.52616155",
"0.5233104",
"0.5219484",
"0.52168566",
"0.5201101",
"0.5195038",
"0.5191069",
"0.51759624",
"0.5173207",
"0.51704353",
"0.51604027",
"0.5158443",
"0.5156597",
"0.5154611",
"0.51469666",
"0.513434",
"0.51342916",
"0.51328784",
"0.5116906",
"0.5113485",
"0.5111641",
"0.5107166",
"0.5074422",
"0.50719166",
"0.50711465",
"0.5066009",
"0.5061715",
"0.5061715",
"0.5059438",
"0.5051056",
"0.5050316",
"0.5040392",
"0.504017",
"0.5040033",
"0.5014767",
"0.5013511",
"0.5012836",
"0.5000908",
"0.50005084",
"0.5000275",
"0.5000106",
"0.49998027",
"0.4988018",
"0.49868327",
"0.49837926",
"0.49836338",
"0.49831453",
"0.49831453",
"0.49831453",
"0.49820685",
"0.49752912",
"0.49672282",
"0.49645457",
"0.49590534",
"0.49498114",
"0.49494004",
"0.49419624",
"0.49276233",
"0.4925317",
"0.49208507",
"0.49164265",
"0.49034587",
"0.48985052",
"0.4898491",
"0.4885239",
"0.4875474",
"0.48754594",
"0.4874366",
"0.48720115",
"0.4867658",
"0.4867658",
"0.48518735",
"0.4844039"
] | 0.74905556 | 1 |
Copies a GrayImage to form a new GrayImage. | public static GrayImage toGray(GrayImage img) {
int X = img.X();
int Y = img.Y();
GrayImage newimg = new GrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
newimg.set(x, y, img.get(x, y));
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static Image cloneImage(Image image) {\n\t\tBufferedImage imageCopy = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\t\tGraphics g = imageCopy.createGraphics();\n\t\tg.drawImage(image, 0, 0, null);\n\t\tg.dispose();\n\t\t\n\t\treturn imageCopy;\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static WritableImage copyImage(Image image) {\n int height=(int)image.getHeight();\n int width=(int)image.getWidth();\n PixelReader pixelReader=image.getPixelReader();\n WritableImage writableImage = new WritableImage(width,height);\n PixelWriter pixelWriter = writableImage.getPixelWriter();\n\n for (int y = 0; y < height; y++){\n for (int x = 0; x < width; x++){\n Color color = pixelReader.getColor(x, y);\n pixelWriter.setColor(x, y, color);\n }\n }\n return writableImage;\n }",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public static BufferedImage deepCopy(BufferedImage bi) \n {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultip = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultip, null);\n }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static BufferedImage deepCopy(BufferedImage bi) {\n\t\tColorModel cm = bi.getColorModel();\n\t\tboolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n\t\tWritableRaster raster = bi.copyData(null);\n\t\treturn new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n\t}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"@SuppressWarnings(\"unused\")\n\tprivate void cloneImage() {\n//\t\tColorModel cm = offimg.getColorModel();\n//\t\t boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n//\t\t WritableRaster raster = offimg.copyData(null);\n//\t\t offimg2 = new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n//\t\t BufferedImage currentImage = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);\n\n\t//Fastest method to clone the image (DOES NOT WORK for MACOS)\n//\t\t int[] frame = ((DataBufferInt)offimg.getRaster().getDataBuffer()).getData();\n//\t\t int[] imgData = ((DataBufferInt)offimg2.getRaster().getDataBuffer()).getData();\n//\t\t System.arraycopy(frame,0,imgData,0,frame.length);\n\t}",
"public static BufferedImage copyImage(BufferedImage source) {\n return copyImage(source, null);\n }",
"protected BufferedImage getImageCopy(BufferedImage orig) {\n\t BufferedImage copy = new BufferedImage(this.getWidth(), this.getHeight(),\n\t orig.getType());\n\t Graphics g = copy.createGraphics();\n\t g.drawImage(orig, (this.getWidth() - orig.getWidth()) / 2, \n\t \t\tthis.getHeight() - orig.getHeight(), null);\n\t g.dispose();\n\t return copy;\n\t}",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public static BufferedImage copyImage(BufferedImage source, BufferedImage target) {\n if (target == null || target.getWidth() != source.getWidth() || target.getHeight() != source.getHeight() || target.getType() != source.getType())\n target = new BufferedImage(source.getWidth(), source.getHeight(), source.getType());\n Graphics g = target.getGraphics();\n g.drawImage(source, 0, 0, null);\n g.dispose();\n return target;\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public void copy(RasterImage src, RasterImage dst) {\n\t\t// TODO: just copy the image\n\n\t\tfor (int i = 0; i < dst.argb.length; i++) {\n\t\t\tdst.argb[i] = src.argb[i];\n\t\t}\n\t}",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static synchronized void copyGraph(Image image) {\n\t\tcopytoClipboard(image);\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"private Picture copy(Picture p) {\n\t\tif (p == null) {\n\t\t\tthrow new IllegalArgumentException(\"Cannot create a copy of a null Picture\");\n\t\t}\n\t\tPicture replica = new PictureImpl(p.getWidth(), p.getHeight());\n\n\t\tfor (int i = 0; i < p.getWidth(); i++) {\n\t\t\tfor (int j = 0; j < p.getHeight(); j++) {\n\t\t\t\treplica.setPixel(i, j, p.getPixel(i, j));\n\t\t\t}\n\t\t}\n\t\treturn replica;\n\t}",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public void updateImage(ColorImage newImage) {\n currentImage.push(newImage);\n }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"void greyscale();",
"void greyscale();",
"public HTColorImage(HTColorImage htImage)\n\t{\n\t\timg = HTUtil.getCopy(htImage.getImage());\n\t}",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"void setImage(BufferedImage valueImage, BufferedImage BackImage);",
"public Image clone() {\r\n\t\treturn new Image(renderer, texture, textureX, textureY, textureWidth, textureHeight, width, height);\r\n\t}",
"public void setImage(Image newImage)\n {\n if (newImage == null)\n {\n setFill(null);\n }\n else\n {\n setFill(new ImageFill(newImage));\n }\n }",
"public static BufferedImage reset (BufferedImage bi, BufferedImage originalCopy)\n {\n imageList.add(deepCopy(bi)); // add the image to the undo list\n return originalCopy; \n }",
"public native MagickImage cloneImage(int columns, int rows,\n\t\t\tboolean clonePixels) throws MagickException;",
"private native int grayToRgb(byte src[],int dst[]);",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static <T extends ImageGray<T>> T convert( ImageGray<?> src, T dst, Class<T> typeDst ) {\n\t\tif (dst == null) {\n\t\t\tdst = (T)GeneralizedImageOps.createSingleBand(typeDst, src.width, src.height);\n\t\t} else {\n\t\t\tInputSanityCheck.checkSameShape(src, dst);\n\t\t}\n\t\tconvert(src, dst);\n\n\t\treturn dst;\n\t}",
"@Test\n public void testGrayFilter() {\n System.out.println(\"grayFilter\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.grayFilter();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"void copy(ImageMetadata toCopy);",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public HTColorImage(BufferedImage bImage)\n\t{\n\t\tif (bImage == null)\n\t\t{\n\t\t\tthrow new HTException(\"Image is null\");\n\t\t}\t\n\t\timg = HTUtil.getCopy(bImage);\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"@Test\n public void testChangeGrey() {\n System.out.println(\"changeGrey\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.changeGrey();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public GeneNumberGray(GeneNumberGray other) {\n this(other.minValue, other.maxValue, other.alels.getNumberOfBits());\n alels.storeBitField(other.alels);\n }",
"public static BufferedImage createByteABGRCopy(Image img) {\n\t\tBufferedImage bi = new BufferedImage(img.getWidth(null),img.getHeight(null),BufferedImage.TYPE_4BYTE_ABGR);\n\t\tGraphics g = bi.createGraphics();\n\t\tg.drawImage(img,0,0,null);\n\t\tg.dispose();\n\t\treturn bi;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public final void replaceImage(final ImageProcessor newImage) {\r\n this.image = newImage;\r\n }",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public native boolean negateImage(int grayscale) throws MagickException;",
"public Pic blackAndWhite() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n if (average > 127) {\n current.setRed(255);\n current.setGreen(255);\n current.setBlue(255);\n } else {\n current.setRed(0);\n current.setGreen(0);\n current.setBlue(0);\n }\n }\n }\n return output;\n }",
"public TiledImage getNewImage() {\n return this.newImage;\n }",
"public Picture(Picture copyPicture)\n {\n // let the parent class do the copy\n super(copyPicture);\n }",
"public Picture(Picture copyPicture)\n {\n // let the parent class do the copy\n super(copyPicture);\n }",
"public ImageProcessor(ImageArray im) {\n originalIm= im;\n currentIm= originalIm.copy();\n }",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public abstract BufferedImage applyTo(BufferedImage image);",
"public Pic invert() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n current.setRed(255 - current.getRed());\n current.setGreen(255 - current.getGreen());\n current.setBlue(255 - current.getBlue());\n }\n }\n return output;\n }",
"public native boolean isGrayImage() throws MagickException;",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"protected void copy(){\n\t\tthis.model.copy(this.color.getBackground());\n\t}",
"public void setOutput8BitGray(boolean output8BitGray) {\n/* 158 */ this.output8BitGray = output8BitGray;\n/* */ }",
"public static BufferedImage toImage(VImage vImage) {\n BufferedImage image = new BufferedImage(vImage.getWidth(), vImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n System.arraycopy(vImage.getData(), 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0,\n vImage.getWidth() * vImage.getHeight() * 3);\n return image;\n }",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"public void fillNewImage(){\n newImage = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);\n\n // Fill the new image with the pixels\n for(int i = 0; i < imageHeight; i++)\n for(int j = 0; j < imageWidth; j++){\n //System.out.println(\"pixel[\" + i + \"][\" + j + \"]\");\n newImage.setRGB(j, i, kCenters[assignedCluster[i][j]].getRGB());\n //newImage.setRGB(j, i, kCenters[0].getRGB());\n }\n }",
"public native MagickImage enhanceImage() throws MagickException;",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"public void invertImage()\r\n {\r\n BufferedImage toInvert;\r\n if (isChanged || isBlured )\r\n {\r\n toInvert = cropedEdited;\r\n }\r\n else\r\n {\r\n toInvert = cropedPart;\r\n }\r\n for (int x = 0; x < toInvert.getWidth(); x++) {\r\n for (int y = 0; y < toInvert.getHeight(); y++) {\r\n int rgba = toInvert.getRGB(x, y);\r\n Color col = new Color(rgba, true);\r\n col = new Color(255 - col.getRed(),\r\n 255 - col.getGreen(),\r\n 255 - col.getBlue());\r\n toInvert.setRGB(x, y, col.getRGB());\r\n }\r\n }\r\n repaint();\r\n }",
"public void restore() {\n currentIm= originalIm.copy();\n }",
"void setSourceImage(BufferedImage mySourceImage);",
"public HSIImage(HSIImage otherImage)\r\n {\r\n\thue = MatrixTools.copy(otherImage.hue);\r\n\tsaturation = MatrixTools.copy(otherImage.saturation);\r\n\tintensity = MatrixTools.copy(otherImage.intensity);\r\n }",
"BufferedImage outputImage();",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public static Bitmap ChangeGrey(Bitmap src, int depth, double red, double green, double blue) {\n int width = src.getWidth();\n int height = src.getHeight();\n Bitmap finalBitmap = Bitmap.createBitmap(width, height, src.getConfig());\n final double grayScale_Red = 0.3;\n final double grayScale_Green = 0.59;\n final double grayScale_Blue = 0.11;\n\n int channel_aplha, channel_red, channel_green, channel_blue;\n int pixel;\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n pixel = src.getPixel(x, y);\n channel_aplha = Color.alpha(pixel);\n channel_red = Color.red(pixel);\n channel_green = Color.green(pixel);\n channel_blue = Color.blue(pixel);\n channel_blue = channel_green = channel_red = (int) (grayScale_Red * channel_red + grayScale_Green * channel_green + grayScale_Blue * channel_blue);\n channel_red += (depth * red);\n\n if (channel_red > 255) {\n channel_red = 255;\n }\n channel_green += (depth * green);\n if (channel_green > 255) {\n channel_green = 255;\n }\n channel_blue += (depth * blue);\n if (channel_blue > 255) {\n channel_blue = 255;\n }\n finalBitmap.setPixel(x, y, Color.argb(channel_aplha, channel_red, channel_green, channel_blue));\n }\n }\n return finalBitmap;\n }",
"@Test\n public void copyTest() {\n ImageLayout layout = new ImageLayout();\n int[] bitMask = new int[] { 0, 1 };\n SampleModel sampleModel = new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, 512, 512,\n bitMask);\n layout.setSampleModel(sampleModel);\n layout.setColorModel(null);\n\n // Creation of the RenderingHints\n RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);\n\n // create image with 2 bands\n RenderedImage twoBands = ConstantDescriptor.create(512f, 512f, new Byte[] { 1, 0 }, null);\n // Force the SampleModel to be th one defiend by the layout\n RenderedImage twoBandsPacked = new CopyOpImage(twoBands, hints, layout);\n\n // now select second band\n RenderedOp oneBand = BandSelectDescriptor.create(twoBandsPacked, new int[] { 1 }, hints);\n\n // make sure we got the right band\n Assert.assertEquals(1, oneBand.getSampleModel().getNumBands());\n Assert.assertEquals(0, oneBand.getData().getSample(0, 0, 0), 1E-11);\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"private void paintOriginalImage() {\r\n Graphics g = originalImage.getGraphics();\r\n // Erase to black\r\n g.setColor(Color.BLACK);\r\n g.fillRect(0, 0, FULL_SIZE, FULL_SIZE);\r\n \r\n // RGB quadrant\r\n for (int i = 0; i < QUAD_SIZE; i += 3) {\r\n int x = i;\r\n g.setColor(Color.RED);\r\n g.drawLine(x, 0, x, QUAD_SIZE);\r\n x++;\r\n g.setColor(Color.GREEN);\r\n g.drawLine(x, 0, x, QUAD_SIZE);\r\n x++;\r\n g.setColor(Color.BLUE);\r\n g.drawLine(x, 0, x, QUAD_SIZE);\r\n }\r\n \r\n // Picture quadrant\r\n try {\r\n URL url = getClass().getResource(\"images/BBGrayscale.png\");\r\n BufferedImage picture = ImageIO.read(url);\r\n // Center picture in quadrant area\r\n int xDiff = QUAD_SIZE - picture.getWidth();\r\n int yDiff = QUAD_SIZE - picture.getHeight();\r\n g.drawImage(picture, QUAD_SIZE + xDiff/2, yDiff/2, null);\r\n } catch (Exception e) {\r\n System.out.println(\"Problem reading image file: \" + e);\r\n }\r\n \r\n // Vector drawing quadrant\r\n g.setColor(Color.WHITE);\r\n g.fillRect(0, QUAD_SIZE, QUAD_SIZE, QUAD_SIZE);\r\n g.setColor(Color.BLACK);\r\n g.drawOval(2, QUAD_SIZE + 2, QUAD_SIZE-4, QUAD_SIZE-4);\r\n g.drawArc(20, QUAD_SIZE + 20, (QUAD_SIZE - 40), QUAD_SIZE - 40, \r\n 190, 160);\r\n int eyeSize = 7;\r\n int eyePos = 30 - (eyeSize / 2);\r\n g.fillOval(eyePos, QUAD_SIZE + eyePos, eyeSize, eyeSize);\r\n g.fillOval(QUAD_SIZE - eyePos - eyeSize, QUAD_SIZE + eyePos, \r\n eyeSize, eyeSize);\r\n \r\n // B&W grid\r\n g.setColor(Color.WHITE);\r\n g.fillRect(QUAD_SIZE + 1, QUAD_SIZE + 1, QUAD_SIZE, QUAD_SIZE);\r\n g.setColor(Color.BLACK);\r\n for (int i = 0; i < QUAD_SIZE; i += 4) {\r\n int pos = QUAD_SIZE + i;\r\n g.drawLine(pos, QUAD_SIZE + 1, pos, FULL_SIZE);\r\n g.drawLine(QUAD_SIZE + 1, pos, FULL_SIZE, pos);\r\n }\r\n \r\n originalImagePainted = true;\r\n }",
"public void duplicateOriginalArray() {\n for (int r=0; r<pixels.length; r++) {\n for (int c=0; c<pixels.length; c++) {\n if (pixels[r][c] == true)\n visited[r][c] = true;\n else\n visited[r][c]= false;\n }\n }\n }",
"public void setImage(Image image, boolean isNew)\r\n\t{\r\n\t\tif (isNew)\r\n\t\t{\r\n\t\t\tmRawImage = image;\r\n\t\t\tif (! mZoom)\r\n\t\t\t{\r\n\t\t\t\tint height = image.getHeight(null);\r\n\t\t\t\tint width = image.getWidth(null);\r\n\t\t\t\tif (mCurrentHeight != height) // assume different widths if different heights\r\n\t\t\t\t{\r\n\t\t\t\t\tsetTargetHeight(height);\r\n\t\t\t\t\tsetTargetWidth(width);\r\n\t\t\t\t\tnew ZoomAnimation().start();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// scale image to canvas as necessary\r\n\t\timage = new ImageIcon(image.getScaledInstance(getCurrentWidth(), getCurrentHeight(), Image.SCALE_FAST)).getImage();\r\n\r\n\t\t// check BufferedImage fit\r\n\t\tmImageBuffer = resizeBuffer(image);\r\n\r\n\t\t// paint incoming Image to BufferedImage\r\n\t\tGraphics2D g = mImageBuffer.createGraphics();\r\n\t\tg.drawImage(image, 0, 0, null);\r\n\t\tg.dispose();\r\n\r\n\t\tmCameraListener.newImage();\r\n\t}"
] | [
"0.66498464",
"0.6477378",
"0.64327246",
"0.6337437",
"0.6301257",
"0.6285824",
"0.6173975",
"0.61293215",
"0.6029274",
"0.5983422",
"0.5924325",
"0.5921727",
"0.5874179",
"0.5832716",
"0.58119893",
"0.5788399",
"0.5780165",
"0.57631594",
"0.57595986",
"0.57568777",
"0.57520187",
"0.57212406",
"0.5717138",
"0.5712141",
"0.5636818",
"0.5615674",
"0.56082517",
"0.55952173",
"0.5595183",
"0.55898905",
"0.55822307",
"0.55524063",
"0.55507904",
"0.5530514",
"0.55291426",
"0.5516759",
"0.54928905",
"0.5492254",
"0.5464337",
"0.54542804",
"0.5441725",
"0.5419797",
"0.54147893",
"0.54147893",
"0.5410388",
"0.537475",
"0.53410435",
"0.53002524",
"0.5290943",
"0.5241946",
"0.5228517",
"0.5228436",
"0.52124995",
"0.518275",
"0.5154918",
"0.5145881",
"0.51369536",
"0.5107148",
"0.51005656",
"0.5077793",
"0.5071222",
"0.50660497",
"0.50587523",
"0.5048901",
"0.49857795",
"0.49794543",
"0.49774808",
"0.49716818",
"0.49640372",
"0.49545857",
"0.49489874",
"0.4941252",
"0.49363136",
"0.49363136",
"0.49324352",
"0.49234357",
"0.49217248",
"0.49134627",
"0.49130023",
"0.48846793",
"0.48755923",
"0.48631397",
"0.48626557",
"0.4856214",
"0.48532736",
"0.4844463",
"0.48354098",
"0.48334885",
"0.48234195",
"0.48164505",
"0.48085198",
"0.47945672",
"0.47906518",
"0.47810847",
"0.47653928",
"0.47643104",
"0.47641894",
"0.47600022",
"0.4749527",
"0.47437093"
] | 0.69736874 | 0 |
Converts a BinaryImage to a GrayImage | public static GrayImage toGray(BinaryImage img) {
int X = img.X();
int Y = img.Y();
GrayImage newimg = new GrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
if ((int) img.get(x, y) == 0)
newimg.set(x, y, 0);
else
newimg.set(x, y, 255);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"private void getBinaryImage() {\n //apply gaussianfilter\n Imgproc.GaussianBlur(currentGray, currentGray, new Size(gauss,gauss), 0);\n\n // subtract backgroundGray from current image and store in currentGray\n Core.subtract(currentGray, backgroundGray, currentGray);\n\n //get Binary image using Otsu\n Imgproc.threshold(currentGray, binary, 0, 255, Imgproc.THRESH_BINARY + Imgproc.THRESH_OTSU);\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static int grayToBinary(int num) {\r\n\t\tint k = (INTEGER_SIZE >>> 1);\r\n\t\tint temp = num;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp ^= (temp >>> k);\r\n\t\t\tk >>>= 1;\r\n\t\t}\r\n\t\treturn temp;\r\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static byte[] grayToBin(byte g[]){\n byte bg[] = new byte[g.length];\n bg[0] = g[0];\n for(int i=1;i<g.length;i++){\n bg[i]=(byte) (bg[i-1] ^ g[i]);\n }\n return bg;\n }",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public native boolean isGrayImage() throws MagickException;",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"void greyscale();",
"void greyscale();",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"private native int grayToRgb(byte src[],int dst[]);",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public static BinaryMatrix fromImage(BufferedImage image){\n\t\tint height=image.getHeight();\n\t\tint width=image.getWidth();\n\t\t\n\t\tboolean[][] array=new boolean[height][width];\n\t\tfor(int h=0; h<height; h++){\n\t\t\tfor(int w=0; w<width; w++){\n\t\t\t\tif(image.getRGB(w, h)==Constants.COLOR_BLACK)\n\t\t\t\t\tarray[h][w]=true;\n\t\t\t\telse\n\t\t\t\t\tarray[h][w]=false;\n\t\t\t}\n\t\t}\n\t\treturn new BinaryMatrix(array);\n\t}",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage BToBI(Blob image) throws SQLException, IOException {\n\t\tInputStream in = image.getBinaryStream(); \n\t\tBufferedImage toReturn = ImageIO.read(in);\n\t\treturn toReturn;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"private Image bitmap2JPEG(Bitmap bit) {\n\n Image baseImage = new Image();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bit.compress(Bitmap.CompressFormat.JPEG, 90, stream);\n byte[] imageBytes = stream.toByteArray();\n baseImage.encodeContent(imageBytes);\n\n return baseImage;\n }",
"public BufferedImage byteArrayToBufferedImage(byte[] byteImage) {\n BufferedImage image = null;\n InputStream in = new ByteArrayInputStream(byteImage);\n try {\n image = ImageIO.read(in);\n\n } catch (IOException ex) {\n Logger.getLogger(ProcessImage.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return image;\n }",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"public static int NTSCRGBtoGray(int r, int g, int b) {\n return (int) (0.2126 * r + 0.7152 * g + 0.0722 * b);\n }",
"public void setOutput8BitGray(boolean output8BitGray) {\n/* 158 */ this.output8BitGray = output8BitGray;\n/* */ }",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public BufferedImage convertByteToImage(byte[] imageByteArr) throws IOException {\r\n return ImageIO.read(new ByteArrayInputStream(imageByteArr));\r\n }",
"public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}",
"private void bitToByte(Bitmap bmap) {\n\t\ttry {\n\t\t\tByteArrayOutputStream bos = new ByteArrayOutputStream();\n\t\t\tbmap.compress(Bitmap.CompressFormat.PNG, 100, bos);\n\t\t\tbytePhoto = bos.toByteArray();\n\t\t\tbos.close();\n\t\t} catch (IOException ioe) {\n\n\t\t}\n\t}",
"public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"BufferedImage outputImage();",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"Picture binaryComponentImage() throws Exception;",
"public List<Integer> grayCode2(int n) {\n // input validation\n List<Integer> res = new ArrayList();\n if (n < 0) {\n return res;\n }\n \n // use binary -> Gray conversion XOR rule\n for (int i = 0; i < (1 << n); i++) { // i < 2^n\n res.add(i ^ (i >> 1));\n }\n return res;\n }",
"@Test\n public void testGrayFilter() {\n System.out.println(\"grayFilter\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.grayFilter();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static GrayU8 convert( ImageGray input, double min, double max, int numValues, GrayU8 output ) {\n\t\t// see if it can use the faster straight forward convert\n\t\tif (min == 0 && max == 255 && numValues == 256) {\n\t\t\tif (output == null)\n\t\t\t\toutput = new GrayU8(input.width, input.height);\n\t\t\tconvert(input, output);\n\t\t\treturn output;\n\t\t}\n\n\t\tImageDataType type = input.getImageType().getDataType();\n\t\tif (type == ImageDataType.U8) {\n\t\t\treturn ConvertImage.convert((GrayU8)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S8) {\n\t\t\treturn ConvertImage.convert((GrayS8)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.U16) {\n\t\t\treturn ConvertImage.convert((GrayU16)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S16) {\n\t\t\treturn ConvertImage.convert((GrayS16)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S32) {\n\t\t\treturn ConvertImage.convert((GrayS32)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S64) {\n\t\t\treturn ConvertImage.convert((GrayS64)input, (long)min, (long)max, numValues, output);\n\t\t} else if (type == ImageDataType.F32) {\n\t\t\treturn ConvertImage.convert((GrayF32)input, (float)min, (float)max, numValues, output);\n\t\t} else if (type == ImageDataType.F64) {\n\t\t\treturn ConvertImage.convert((GrayF64)input, min, max, numValues, output);\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"Unknown image type: \" + type);\n\t\t}\n\t}",
"public static void convert( ImageBase input, ImageBase output ) {\n\n\t\tImageType typeIn = input.getImageType();\n\t\tImageType typeOut = output.getImageType();\n\n\t\tif (input instanceof ImageGray) {\n\t\t\tImageGray sb = (ImageGray)input;\n\t\t\tif (output instanceof ImageGray) {\n\t\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\t\toutput.setTo(input);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (output instanceof Planar) {\n\t\t\t\tPlanar ms = (Planar)output;\n\t\t\t\tfor (int i = 0; i < ms.getNumBands(); i++) {\n\t\t\t\t\tconvert(input, ms.getBand(i));\n\t\t\t\t}\n\t\t\t} else if (output instanceof ImageInterleaved) {\n\t\t\t\tImageInterleaved il = (ImageInterleaved)output;\n\t\t\t\tfor (int i = 0; i < il.getNumBands(); i++) {\n\t\t\t\t\tGImageMiscOps.insertBand(sb, i, il);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageInterleaved) {\n\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\toutput.setTo(input);\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageGray) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mi.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mi.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mi, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mi, so);\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageInterleaved) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof Planar) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tPlanar mo = (Planar)output;\n\n\t\t\tif (mi.getBandType() == mo.getBandType()) {\n\t\t\t\tmo.setTo(mi);\n\t\t\t} else {\n\t\t\t\tfor (int i = 0; i < mi.getNumBands(); i++) {\n\t\t\t\t\tconvert(mi.getBand(i), mo.getBand(i));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof Planar) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageGray) {\n\t\t\tImageInterleaved mb = (ImageInterleaved)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mb.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mb.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mb, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mb, so);\n\t\t\t}\n\t\t} else {\n\t\t\tString nameInput = input.getClass().getSimpleName();\n\t\t\tString nameOutput = output.getClass().getSimpleName();\n\t\t\tthrow new IllegalArgumentException(\"Don't know how to convert between input types. \" + nameInput + \" \" + nameOutput);\n\t\t}\n\t}",
"public static byte[] imageToByteArray(BufferedImage image) {\n if (image != null) {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try {\n ImageIO.write(image, \"png\", baos);\n baos.flush();\n byte[] imageInByte = baos.toByteArray();\n baos.close();\n return imageInByte;\n } catch (IOException ex) {\n log.error(\"error while converting to byte array\", ex);\n }\n WritableRaster raster = image.getRaster();\n DataBufferByte data = (DataBufferByte) raster.getDataBuffer();\n return data.getData();\n }\n return new byte[0];\n }",
"public native boolean negateImage(int grayscale) throws MagickException;",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static int[][][] greyScale(int[][][] source) {\n\n\t\t// Creating the new matrix\n\t\tint[][][] gray = new int[source.length][source[0].length][3]; \n\n\t\t// Creating a loop to print\n\t\tfor (int i = 0; i < source.length; i++) { \n\t\t\tfor (int j = 0; j < source[0].length; j++) { \n\t\t\t\tint[] klum = new int[3];\n\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\tklum[k] = source[i][j][k]; // Creating a pixel\n\t\t\t\t}\n\t\t\t\t// Put the grey pixel in the new Matrix\n\t\t\t\tgray[i][j] = luminance(klum); \n\t\t\t}\n\t\t}\n\t\treturn gray;\n\t}",
"public void image_toGrey(int my_id) {\n int y1;\n //int offset = size;\n int myInitRow = (int)(((float)my_id/(float)nThreads)*((float)height/2.0f));\n int nextThreadRow = (int)(((float)(my_id+1)/(float)nThreads)*((float)height/2.0f));\n int myEnd, myOff;\n myOff = 2*width*myInitRow;\n myEnd = 2*width*nextThreadRow;\n for(int i=myOff; i < myEnd;i++) {\n y1 = data[i]&0xff;\n image[i] = 0xff000000 | (y1<<16) | (y1<<8) | y1;\n }\n }",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public BufferedImage simpleThresholding(BufferedImage timg) {\n\n int[][][] ImageArray1 = convertToArray(timg);\n\n return convertToBimage(ImageArray1);\n }",
"private Bitmap convertToBitmap(byte[] b){\n\n return BitmapFactory.decodeByteArray(b, 0, b.length);\n\n }",
"public static BufferedImage loadMapBinary16(File source, int width, int height) throws IOException {\n //load binary into byte buffer\n RandomAccessFile raf = new RandomAccessFile(source, \"r\");\n byte[] buffer = new byte[(int) raf.length()];\n raf.readFully(buffer);\n raf.close();\n\n assert (buffer.length == width * height * 2);\n\n //create new gray scale image\n BufferedImage retVal = new BufferedImage(width, height, BufferedImage.TYPE_USHORT_GRAY);\n WritableRaster wr = retVal.getRaster();\n\n //write in it line by line\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int offset = ((x + y * width) * 2);\n int value = (short) ((Byte.toUnsignedInt(buffer[offset]) +\n (Byte.toUnsignedInt(buffer[offset + 1]) << 8)) - 32768);\n wr.setSample(x, y, 0, value);\n }\n }\n\n return retVal;\n }",
"BufferedImage getImage();",
"BufferedImage getImage();",
"BufferedImage getImage();",
"public static Try<byte[]> imageToPng(BufferedImage image) {\n return Try.of(() -> Imaging.writeImageToBytes(image, ImageFormats.PNG, null))\n .logIfFailure(TAG, err -> \"failed to convert image to bytes\");\n }",
"public static BufferedImage toImage(VImage vImage) {\n BufferedImage image = new BufferedImage(vImage.getWidth(), vImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n System.arraycopy(vImage.getData(), 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0,\n vImage.getWidth() * vImage.getHeight() * 3);\n return image;\n }",
"public byte[] Img2Bin (String path){\t \n\t\tByteArrayOutputStream bin = new ByteArrayOutputStream();\n\t\t\n\t\ttry {\n\t\t\tBufferedImage image = ImageIO.read(new File(path));\n\t\t\tImageIO.write(image, \"jpg\", bin);\n\t\t} catch (IOException e) {\n\t\t\tLOG.error(\"Img2Bin didn't succeed. Error: {}\",e);\n\t\t\treturn null;\n\t\t}\n\n\t return bin.toByteArray();\n\t}",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public BufferedImage convertToBimage(int[][][] TmpArray) {\n\n int width = TmpArray.length;\n int height = TmpArray[0].length;\n\n BufferedImage tmpimg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int a = TmpArray[x][y][0];\n int r = TmpArray[x][y][1];\n int g = TmpArray[x][y][2];\n int b = TmpArray[x][y][3];\n\n //set RGB value\n\n int p = (a << 24) | (r << 16) | (g << 8) | b;\n tmpimg.setRGB(x, y, p);\n\n }\n }\n return tmpimg;\n }",
"public static int[][] getMatrizBin(BufferedImage img){\n int largura = img.getWidth();\r\n int altura = img.getHeight();\r\n \r\n //Imagem de saida\r\n BufferedImage outImage = new BufferedImage(largura, altura, BufferedImage.TYPE_3BYTE_BGR);\r\n \r\n //matriz de saida\r\n int[][] output = new int[largura][altura];\r\n \r\n //calculando os valores do CIVE\r\n for (int x = 0; x < largura; x++) {\r\n for (int y = 0; y < altura; y++) {\r\n double red = Color.getColor(\"red\", img.getRGB(x, y)).getRed();\r\n double green = Color.getColor(\"green\", img.getRGB(x, y)).getGreen();\r\n \r\n if (green > red ) {\r\n output[x][y] = 1;\r\n } else {\r\n output[x][y] = 0;\r\n }\r\n \r\n }\r\n }\r\n\r\n return output;\r\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public static Image toImage(BufferedImage bufferedImage) {\r\n return Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());\r\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static BufferedImage convertToJpg(BufferedImage image) {\r\n\t\tint w = image.getWidth();\r\n\t\tint h = image.getHeight();\r\n\t\tBufferedImage image2 = new BufferedImage(w, h,\r\n\t\t\t\tBufferedImage.TYPE_INT_RGB);\r\n\t\tGraphics2D g = image2.createGraphics();\r\n\t\tg.setColor(Color.WHITE);\r\n\t\tg.fillRect(0, 0, w, h);\r\n\t\tg.drawRenderedImage(image, null);\r\n\t\tg.dispose();\r\n\t\treturn image2;\r\n\t}",
"public Image drawOnImage(Mat binary, Mat image) {\n Raster binaryRaster = toBufferedImage(binary).getData();\n int radius = 6;\n int diameter = radius * 2;\n\n BufferedImage imageBI = toBufferedImage(image);\n int width = imageBI.getWidth();\n int height = imageBI.getHeight();\n Graphics2D g2d = (Graphics2D) imageBI.getGraphics();\n g2d.setColor(Color.WHITE);\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int v = binaryRaster.getSample(x, y, 0);\n if (v == 0) {\n g2d.draw(new Ellipse2D.Double(x - radius, y - radius, diameter, diameter));\n }\n }\n }\n\n return imageBI;\n }",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }"
] | [
"0.7205129",
"0.6996914",
"0.68688506",
"0.68242425",
"0.68019116",
"0.67329466",
"0.66495275",
"0.64879274",
"0.6357478",
"0.63517165",
"0.6292849",
"0.62526375",
"0.62447983",
"0.6209636",
"0.61951864",
"0.6163945",
"0.6129583",
"0.60634494",
"0.60455036",
"0.60412747",
"0.60167885",
"0.59256387",
"0.5857892",
"0.5839467",
"0.5837427",
"0.58133185",
"0.58133185",
"0.5775619",
"0.5765254",
"0.57278156",
"0.56999916",
"0.5688725",
"0.568345",
"0.5665715",
"0.5658645",
"0.5637521",
"0.56256896",
"0.5595693",
"0.5558432",
"0.5550313",
"0.54770625",
"0.54595697",
"0.5440552",
"0.5436457",
"0.54187584",
"0.5418426",
"0.5400692",
"0.5395017",
"0.53896886",
"0.5385049",
"0.5378822",
"0.53399813",
"0.5320638",
"0.5311456",
"0.52945995",
"0.526137",
"0.5239072",
"0.522157",
"0.5209071",
"0.51829135",
"0.51524484",
"0.51061386",
"0.51019794",
"0.5097365",
"0.50954115",
"0.50928867",
"0.5050269",
"0.5016034",
"0.5013044",
"0.5010136",
"0.50078803",
"0.49915466",
"0.4962874",
"0.49589235",
"0.4929266",
"0.49258137",
"0.49180076",
"0.48990884",
"0.48807344",
"0.48806104",
"0.48714808",
"0.4871069",
"0.4864661",
"0.48577562",
"0.48577562",
"0.48577562",
"0.4856457",
"0.48512566",
"0.48239297",
"0.48120093",
"0.47931948",
"0.47799262",
"0.47779417",
"0.47629464",
"0.47532934",
"0.47502032",
"0.47289523",
"0.47270223",
"0.4724614",
"0.47168583"
] | 0.809203 | 0 |
Converts a RealGrayImage to a GrayImage | public static GrayImage toGray(RealGrayImage img) {
int X = img.X();
int Y = img.Y();
GrayImage newimg = new GrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
newimg.set(x, y, (short) img.get(x, y));
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"void greyscale();",
"void greyscale();",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public native boolean isGrayImage() throws MagickException;",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public static Mat rapidConvertRGBAToGRAY(Mat rgba) {\n Mat gray = new Mat(rgba.rows(), rgba.cols(), CvType.CV_8UC1);\n Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);\n return gray;\n }",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"public void setOutput8BitGray(boolean output8BitGray) {\n/* 158 */ this.output8BitGray = output8BitGray;\n/* */ }",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static int grayToBinary(int num) {\r\n\t\tint k = (INTEGER_SIZE >>> 1);\r\n\t\tint temp = num;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp ^= (temp >>> k);\r\n\t\t\tk >>>= 1;\r\n\t\t}\r\n\t\treturn temp;\r\n\t}",
"@Test\n public void testGrayFilter() {\n System.out.println(\"grayFilter\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.grayFilter();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"public static GrayU8 convert( ImageGray input, double min, double max, int numValues, GrayU8 output ) {\n\t\t// see if it can use the faster straight forward convert\n\t\tif (min == 0 && max == 255 && numValues == 256) {\n\t\t\tif (output == null)\n\t\t\t\toutput = new GrayU8(input.width, input.height);\n\t\t\tconvert(input, output);\n\t\t\treturn output;\n\t\t}\n\n\t\tImageDataType type = input.getImageType().getDataType();\n\t\tif (type == ImageDataType.U8) {\n\t\t\treturn ConvertImage.convert((GrayU8)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S8) {\n\t\t\treturn ConvertImage.convert((GrayS8)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.U16) {\n\t\t\treturn ConvertImage.convert((GrayU16)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S16) {\n\t\t\treturn ConvertImage.convert((GrayS16)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S32) {\n\t\t\treturn ConvertImage.convert((GrayS32)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S64) {\n\t\t\treturn ConvertImage.convert((GrayS64)input, (long)min, (long)max, numValues, output);\n\t\t} else if (type == ImageDataType.F32) {\n\t\t\treturn ConvertImage.convert((GrayF32)input, (float)min, (float)max, numValues, output);\n\t\t} else if (type == ImageDataType.F64) {\n\t\t\treturn ConvertImage.convert((GrayF64)input, min, max, numValues, output);\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"Unknown image type: \" + type);\n\t\t}\n\t}",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}",
"public static Image aplicarLienzoAoriginal(Image imagenOriginal, int nxn) {\n BufferedImage biNegro = new BufferedImage(nxn, nxn, BufferedImage.TYPE_INT_RGB);\r\n for (int n = 0; n < biNegro.getHeight(); n++) {\r\n for (int n1 = 0; n1 < biNegro.getWidth(); n1++) {\r\n Color color = new Color(0, 0, 0);\r\n biNegro.setRGB(n, n, color.getRGB());\r\n }\r\n }\r\n\r\n BufferedImage bi = herramientas.HerramientasImagen.toBufferedImage(imagenOriginal);\r\n Color color;\r\n\r\n int x, y, aux;\r\n for (y = 0; y < bi.getHeight(); y++) {\r\n for (x = 0; x < bi.getWidth(); x++) {\r\n color = new Color(bi.getRGB(x, y));\r\n\r\n try {\r\n biNegro.setRGB(x, y, color.getRGB());\r\n } catch (Exception e) {\r\n }\r\n\r\n }\r\n }\r\n return herramientas.HerramientasImagen.toImage(biNegro);\r\n\r\n }",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage rescaleImage(BufferedImage image, float scale) {\r\n int[][][] arr = convertToArray(image);\r\n return convertToBimage(rescaleImage(arr, scale));//return array\r\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public static int[][][] greyScale(int[][][] source) {\n\n\t\t// Creating the new matrix\n\t\tint[][][] gray = new int[source.length][source[0].length][3]; \n\n\t\t// Creating a loop to print\n\t\tfor (int i = 0; i < source.length; i++) { \n\t\t\tfor (int j = 0; j < source[0].length; j++) { \n\t\t\t\tint[] klum = new int[3];\n\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\tklum[k] = source[i][j][k]; // Creating a pixel\n\t\t\t\t}\n\t\t\t\t// Put the grey pixel in the new Matrix\n\t\t\t\tgray[i][j] = luminance(klum); \n\t\t\t}\n\t\t}\n\t\treturn gray;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static int NTSCRGBtoGray(int r, int g, int b) {\n return (int) (0.2126 * r + 0.7152 * g + 0.0722 * b);\n }",
"@SuppressWarnings( \"unchecked\" )\n\t@Test\n\tpublic void testMatToImgConversion() throws IOException {\n\t\tMat mat = imread( input, opencv_imgcodecs.IMREAD_GRAYSCALE );\n\t\tif ( mat.empty() )\n\t\t\tfail( \"Couldn't load image: \" + input );\n\t\tRandomAccessibleInterval< ByteType > convertedMat = ( RandomAccessibleInterval< ByteType > ) new MatToImgConverter().convert( mat, RandomAccessibleInterval.class );\n\t\tsaveImg( convertedMat, mat2img );\n\n\t\t//Read image with ImageJ\n\t\tDataset dataset = getScifio().datasetIO().open( input );\n\t\tRandomAccessibleInterval< ByteType > ijImage =\n\t\t\t\tRealTypeConverters.convert( ( RandomAccessibleInterval< ? extends RealType< ? > > ) dataset.getImgPlus().getImg(), new ByteType() );\n\n\t\t//Compare data\n\t\tcheckData( convertedMat, ijImage );\n\t}",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"public Mat convertToEdges(Mat img) {\n\n return img;\n }",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image toImage(BufferedImage bufferedImage) {\r\n return Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());\r\n }",
"BufferedImage getImage();",
"BufferedImage getImage();",
"BufferedImage getImage();",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"public static byte[] grayToBin(byte g[]){\n byte bg[] = new byte[g.length];\n bg[0] = g[0];\n for(int i=1;i<g.length;i++){\n bg[i]=(byte) (bg[i-1] ^ g[i]);\n }\n return bg;\n }",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"BufferedImage getImage(Mat mat){\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR);\n\n //Hue Saturation Lighting to Blue Green Red values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR);\n\n //Re-reverses Blue and Red color values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB);\n\n //Sets colors to grayscale\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY);\n\n\n getSpace(mat);\n WritableRaster raster = img.getRaster();\n DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer();\n byte[] data = dataBuffer.getData();\n mat.get(0, 0, data);\n return img;\n }",
"public native MagickImage edgeImage(double raduis) throws MagickException;",
"private Image bitmap2JPEG(Bitmap bit) {\n\n Image baseImage = new Image();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bit.compress(Bitmap.CompressFormat.JPEG, 90, stream);\n byte[] imageBytes = stream.toByteArray();\n baseImage.encodeContent(imageBytes);\n\n return baseImage;\n }",
"BufferedImage outputImage();"
] | [
"0.8497793",
"0.80680686",
"0.7813711",
"0.78018594",
"0.7695945",
"0.76695627",
"0.7564981",
"0.7556177",
"0.7426256",
"0.70291036",
"0.7025832",
"0.70166475",
"0.6925392",
"0.6896109",
"0.68901694",
"0.68265295",
"0.68193924",
"0.6759341",
"0.66511",
"0.6582029",
"0.65096474",
"0.6482372",
"0.64575046",
"0.63860595",
"0.6384525",
"0.63593286",
"0.63564956",
"0.6346614",
"0.6265446",
"0.6239707",
"0.60561913",
"0.60561913",
"0.60444516",
"0.6037076",
"0.59962547",
"0.5915897",
"0.5857082",
"0.57860726",
"0.5744458",
"0.5733592",
"0.56863433",
"0.567825",
"0.5654579",
"0.56456465",
"0.56361526",
"0.5467666",
"0.54626715",
"0.5450097",
"0.53719306",
"0.536478",
"0.5336904",
"0.53265613",
"0.53051656",
"0.53036135",
"0.5275917",
"0.5187648",
"0.51656234",
"0.51390225",
"0.51279116",
"0.511506",
"0.50009227",
"0.49961266",
"0.49901417",
"0.4971091",
"0.49707663",
"0.4966803",
"0.49647793",
"0.49374643",
"0.49357164",
"0.49141073",
"0.49101114",
"0.4899062",
"0.48849347",
"0.48775056",
"0.4870416",
"0.4868621",
"0.48313183",
"0.48211047",
"0.48180628",
"0.48056602",
"0.47977775",
"0.4794216",
"0.4786841",
"0.47848913",
"0.4782457",
"0.47682425",
"0.47677177",
"0.4763112",
"0.46861342",
"0.4670526",
"0.4670526",
"0.4670526",
"0.46615604",
"0.46452224",
"0.46405128",
"0.46069336",
"0.45818853",
"0.4563641",
"0.45575383",
"0.45485052"
] | 0.8287119 | 1 |
Converts an ColorImage to a GrayImage. Uses the following formula for calculation: gray value = (int)(red_value 0.299 + green_value 0.587 + blue_value 0.114) | public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,
ColorModelUnknownException {
int X = img.X();
int Y = img.Y();
int[] color = new int[3];
int gray;
GrayImage newimg = null;
switch (img.getColorModel()) {
case ColorImage.RGB:
newimg = new GrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
color = img.get(x, y);
gray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);
newimg.set(x, y, gray);
}
}
break;
case ColorImage.CMY:
case ColorImage.YIQ:
case ColorImage.HSV:
case ColorImage.HLS:
throw new ColorModelNotSupportedException();
default:
throw new ColorModelUnknownException();
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static int getGrayscale(int rgb[]) throws Exception {\r\n\t\t//Weights;\r\n\t\tdouble redWeight = 0.2126;\r\n\t\tdouble greenWeight = 0.7152;\r\n\t\tdouble blueWeight = 0.0722;\r\n\r\n\t\t//Multiplies the RGB by the Weights:\r\n\t\tint redWeighted = (int) (rgb[0] * redWeight);\r\n\t\tint greenWeighted = (int) (rgb[1] * greenWeight);\r\n\t\tint blueWeighted = (int) (rgb[2] * blueWeight);\r\n\r\n\t\t//Gets the GrayScale Value:\r\n\t\tint grayscale = redWeighted + greenWeighted + blueWeighted;\r\n\r\n\t\t//Returns the GrayScale Value:\r\n\t\treturn grayscale;\r\n\t}",
"public static Bitmap ChangeGrey(Bitmap src, int depth, double red, double green, double blue) {\n int width = src.getWidth();\n int height = src.getHeight();\n Bitmap finalBitmap = Bitmap.createBitmap(width, height, src.getConfig());\n final double grayScale_Red = 0.3;\n final double grayScale_Green = 0.59;\n final double grayScale_Blue = 0.11;\n\n int channel_aplha, channel_red, channel_green, channel_blue;\n int pixel;\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n pixel = src.getPixel(x, y);\n channel_aplha = Color.alpha(pixel);\n channel_red = Color.red(pixel);\n channel_green = Color.green(pixel);\n channel_blue = Color.blue(pixel);\n channel_blue = channel_green = channel_red = (int) (grayScale_Red * channel_red + grayScale_Green * channel_green + grayScale_Blue * channel_blue);\n channel_red += (depth * red);\n\n if (channel_red > 255) {\n channel_red = 255;\n }\n channel_green += (depth * green);\n if (channel_green > 255) {\n channel_green = 255;\n }\n channel_blue += (depth * blue);\n if (channel_blue > 255) {\n channel_blue = 255;\n }\n finalBitmap.setPixel(x, y, Color.argb(channel_aplha, channel_red, channel_green, channel_blue));\n }\n }\n return finalBitmap;\n }",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public static int MeanRGBtoGray(int r, int g, int b) {\n return (r + b + g) / 3;\n }",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"void greyscale();",
"void greyscale();",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }",
"private static int getGrayTranslucentRGB(int rgb) {\n\t\tint r = (0xff & rgb);\n\t\tint g = (0xff & (rgb >> 8));\n\t\tint b = (0xff & (rgb >> 16));\n\t\trgb = r + (g << 8) + (b << 16) + (100 << 24);\n\t\t// rgb = r + (g << 8) + (b << 16); // 亮一些\n\t\treturn rgb;\n\t}",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}",
"public GrayColor getColor(){\n return this.color;\n }",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static int[][] convertToGray(int w, int h, int[][] red, int[][] green,\r\n int[][] blue) {\r\n int [][]gray = new int [w][h];\r\n for( w = 0; w<gray.length;w++) {\r\n for (h = 0; h < gray[0].length; h++) {\r\n\r\n\r\n gray[w][h] =(int) ((0.2126 * red[w][h]) +( 0.7152 * green[w][h]) + (0.0722 * blue[w][h]) );\r\n //two for nested loops\r\n }\r\n }\r\n\r\n return gray;\r\n }",
"public native boolean isGrayImage() throws MagickException;",
"public abstract RGBIColor toRGBColor();",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public static Mat rapidConvertRGBAToGRAY(Mat rgba) {\n Mat gray = new Mat(rgba.rows(), rgba.cols(), CvType.CV_8UC1);\n Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);\n return gray;\n }",
"public static double takeMaximumGrayLevel(BufferedImage image) {\n int maxLevel = (new Color(image.getRGB(0, 0))).getBlue();\n\n for (int i = 0; i < image.getWidth(); i ++) {\n for (int j = 0; j < image.getHeight(); j++) {\n int temp = (new Color(image.getRGB(i, j))).getBlue();\n if (maxLevel < temp) {\n maxLevel = temp;\n }\n }\n }\n\n return maxLevel;\n }",
"public static int NTSCRGBtoGray(int r, int g, int b) {\n return (int) (0.2126 * r + 0.7152 * g + 0.0722 * b);\n }",
"public static int getGreyscale(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint avg = ((red + green + blue) / 3) & 0xff;\n\t\tint grey = (0xff << 24) + (avg << 16) + (avg << 8) + avg;\n\t\treturn grey;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }",
"public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }",
"public int getGreen(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int green = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n green = bdata[1] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n green = sdata[1] & 0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n green = idata[1];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[1] != 8) {\n int shift = nBits[1] - 8;\n green = ((shift > 0) \n ? (green>>shift)\n : (green<<(-shift)));\n\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (green*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return green;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[1] * 255.0f);\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public void toGreen(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }",
"private void greenGradient(BufferedImage myBufferedImage,\n ImageView myImage) {\n gradientPainter.setGradientColor(Color.GREEN);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"private static GBAPalette grayscalePalette(int size){\n GBAPalette.Creator creator = GBAPalette.create();\n //Interpolating! (0,0), (size, 31)\n //slope = 256 / size\n for(int count = 0; count < size; count++){\n int pixel = count * 31 / size;\n creator.with(GBAColor.from(pixel, pixel, pixel));\n }\n return creator.build();\n }",
"public static int toRGB(Color color) {\n int result = (int) (color.getRed() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getBlue() * 0xFF);\n return result;\n }",
"public abstract RGBFColor toRGBFColor();",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public ColorPlus darkenRGB(int value) {\n\t\tint r = this.getRed();\n\t\tint g = this.getGreen();\n\t\tint b = this.getBlue();\n\n\t\tr = (Math.max(r - value, 0));\n\t\tg = (Math.max(g - value, 0));\n\t\tb = (Math.max(b - value, 0));\n\t\treturn new ColorPlus(r,g,b);\n\t}",
"public ColorPlus binary() {\n\t\tint r = this.getRed();\n\t\tint g = this.getGreen();\n\t\tint b = this.getBlue();\n\t\t\n\t\tint cSum = r + g + b;\n\t\tif (cSum >= 382) {\n\t\t\tr = 0;\n\t\t\tg = 0;\n\t\t\tb = 0;\n\t\t}else{\n\t\t\tr = 255;\n\t\t\tg = 255;\n\t\t\tb = 255;\n\t\t}\n\t\treturn new ColorPlus(r,g,b); \n\t}",
"public Image showChanelG(Image image) {\n MyGreenFilter filter = new MyGreenFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n }",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"public Color getColor() {\r\n return Color.GRAY;\r\n }",
"public static int toRGB(Color color) {\n\t\treturn toInt(color.getRed()) | (toInt(color.getGreen()) << 8) | (toInt(color.getBlue()) << 16);\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static int getG8(BufferedImage image, int x, int y) {\n return image.getRGB(x, y) & 0xFF;\n }",
"public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}",
"static public int getGreen(int color) {\n return (color >> 8) & 0xff;\n }",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static int grayToBinary(int num) {\r\n\t\tint k = (INTEGER_SIZE >>> 1);\r\n\t\tint temp = num;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp ^= (temp >>> k);\r\n\t\t\tk >>>= 1;\r\n\t\t}\r\n\t\treturn temp;\r\n\t}",
"public static int[] getPixelColor(final BufferedImage img, final int x, final int y){\n int rgb = img.getRGB(x, y);\n int r = (rgb >> 16) & 0xFF;\n int g = (rgb >> 8) & 0xFF;\n int b = (rgb & 0xFF);\n\t\n return new int[]{r,g,b};\n }",
"public static int[][][] greyScale(int[][][] source) {\n\n\t\t// Creating the new matrix\n\t\tint[][][] gray = new int[source.length][source[0].length][3]; \n\n\t\t// Creating a loop to print\n\t\tfor (int i = 0; i < source.length; i++) { \n\t\t\tfor (int j = 0; j < source[0].length; j++) { \n\t\t\t\tint[] klum = new int[3];\n\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\tklum[k] = source[i][j][k]; // Creating a pixel\n\t\t\t\t}\n\t\t\t\t// Put the grey pixel in the new Matrix\n\t\t\t\tgray[i][j] = luminance(klum); \n\t\t\t}\n\t\t}\n\t\treturn gray;\n\t}",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"public static byte[] grayToBin(byte g[]){\n byte bg[] = new byte[g.length];\n bg[0] = g[0];\n for(int i=1;i<g.length;i++){\n bg[i]=(byte) (bg[i-1] ^ g[i]);\n }\n return bg;\n }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }"
] | [
"0.71958053",
"0.71915084",
"0.7153634",
"0.712466",
"0.70532244",
"0.68662095",
"0.6826572",
"0.66876596",
"0.66138077",
"0.648518",
"0.6448577",
"0.64167625",
"0.6321249",
"0.6273656",
"0.6246107",
"0.6234385",
"0.6185621",
"0.6165242",
"0.6126579",
"0.6063372",
"0.60362774",
"0.6020895",
"0.60154194",
"0.60096896",
"0.6008171",
"0.60065746",
"0.59769523",
"0.597266",
"0.5965795",
"0.5958055",
"0.5953817",
"0.5932619",
"0.5902993",
"0.5900602",
"0.58813125",
"0.58739907",
"0.58739907",
"0.5732059",
"0.57259876",
"0.57204276",
"0.5709078",
"0.5704185",
"0.569431",
"0.5637481",
"0.5609342",
"0.5606765",
"0.56038225",
"0.5598423",
"0.55849564",
"0.5568967",
"0.5563325",
"0.55524015",
"0.55158055",
"0.5507493",
"0.5482401",
"0.54566884",
"0.5453368",
"0.5443283",
"0.54419565",
"0.54405046",
"0.5392748",
"0.5377507",
"0.5372218",
"0.5361615",
"0.53375214",
"0.5289485",
"0.52719593",
"0.52392435",
"0.52338773",
"0.523109",
"0.5224636",
"0.5214963",
"0.52022195",
"0.51938695",
"0.51618236",
"0.51451516",
"0.5115429",
"0.51146543",
"0.51044124",
"0.5096353",
"0.50905323",
"0.5078639",
"0.5073871",
"0.5073691",
"0.5052832",
"0.50513524",
"0.5048485",
"0.5042947",
"0.50258845",
"0.5014459",
"0.50124264",
"0.50074905",
"0.49973658",
"0.4978709",
"0.49764392",
"0.49762955",
"0.49738902",
"0.49638584",
"0.49588612",
"0.49560913"
] | 0.6808102 | 7 |
Converts an RealColorImage to a GrayImage. Uses the following formula for calculation: gray value = (int)(red_value 0.299 + green_value 0.587 + blue_value 0.114) | public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,
ColorModelUnknownException {
int X = img.X();
int Y = img.Y();
float[] color = new float[3];
int gray;
GrayImage newimg = null;
switch (img.getColorModel()) {
case ColorImage.RGB:
newimg = new GrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
color = img.get(x, y);
gray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);
newimg.set(x, y, gray);
}
}
break;
case ColorImage.CMY:
case ColorImage.YIQ:
case ColorImage.HSV:
case ColorImage.HLS:
throw new ColorModelNotSupportedException();
default:
throw new ColorModelUnknownException();
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"void greyscale();",
"void greyscale();",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static int getGrayscale(int rgb[]) throws Exception {\r\n\t\t//Weights;\r\n\t\tdouble redWeight = 0.2126;\r\n\t\tdouble greenWeight = 0.7152;\r\n\t\tdouble blueWeight = 0.0722;\r\n\r\n\t\t//Multiplies the RGB by the Weights:\r\n\t\tint redWeighted = (int) (rgb[0] * redWeight);\r\n\t\tint greenWeighted = (int) (rgb[1] * greenWeight);\r\n\t\tint blueWeighted = (int) (rgb[2] * blueWeight);\r\n\r\n\t\t//Gets the GrayScale Value:\r\n\t\tint grayscale = redWeighted + greenWeighted + blueWeighted;\r\n\r\n\t\t//Returns the GrayScale Value:\r\n\t\treturn grayscale;\r\n\t}",
"public static int MeanRGBtoGray(int r, int g, int b) {\n return (r + b + g) / 3;\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public static Bitmap ChangeGrey(Bitmap src, int depth, double red, double green, double blue) {\n int width = src.getWidth();\n int height = src.getHeight();\n Bitmap finalBitmap = Bitmap.createBitmap(width, height, src.getConfig());\n final double grayScale_Red = 0.3;\n final double grayScale_Green = 0.59;\n final double grayScale_Blue = 0.11;\n\n int channel_aplha, channel_red, channel_green, channel_blue;\n int pixel;\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n pixel = src.getPixel(x, y);\n channel_aplha = Color.alpha(pixel);\n channel_red = Color.red(pixel);\n channel_green = Color.green(pixel);\n channel_blue = Color.blue(pixel);\n channel_blue = channel_green = channel_red = (int) (grayScale_Red * channel_red + grayScale_Green * channel_green + grayScale_Blue * channel_blue);\n channel_red += (depth * red);\n\n if (channel_red > 255) {\n channel_red = 255;\n }\n channel_green += (depth * green);\n if (channel_green > 255) {\n channel_green = 255;\n }\n channel_blue += (depth * blue);\n if (channel_blue > 255) {\n channel_blue = 255;\n }\n finalBitmap.setPixel(x, y, Color.argb(channel_aplha, channel_red, channel_green, channel_blue));\n }\n }\n return finalBitmap;\n }",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public abstract RGBIColor toRGBColor();",
"public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}",
"public static int NTSCRGBtoGray(int r, int g, int b) {\n return (int) (0.2126 * r + 0.7152 * g + 0.0722 * b);\n }",
"public static int getGreyscale(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint avg = ((red + green + blue) / 3) & 0xff;\n\t\tint grey = (0xff << 24) + (avg << 16) + (avg << 8) + avg;\n\t\treturn grey;\n\t}",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"private static int getGrayTranslucentRGB(int rgb) {\n\t\tint r = (0xff & rgb);\n\t\tint g = (0xff & (rgb >> 8));\n\t\tint b = (0xff & (rgb >> 16));\n\t\trgb = r + (g << 8) + (b << 16) + (100 << 24);\n\t\t// rgb = r + (g << 8) + (b << 16); // 亮一些\n\t\treturn rgb;\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public abstract RGBFColor toRGBFColor();",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static Mat rapidConvertRGBAToGRAY(Mat rgba) {\n Mat gray = new Mat(rgba.rows(), rgba.cols(), CvType.CV_8UC1);\n Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);\n return gray;\n }",
"public native boolean isGrayImage() throws MagickException;",
"public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }",
"public GrayColor getColor(){\n return this.color;\n }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public static int[][] convertToGray(int w, int h, int[][] red, int[][] green,\r\n int[][] blue) {\r\n int [][]gray = new int [w][h];\r\n for( w = 0; w<gray.length;w++) {\r\n for (h = 0; h < gray[0].length; h++) {\r\n\r\n\r\n gray[w][h] =(int) ((0.2126 * red[w][h]) +( 0.7152 * green[w][h]) + (0.0722 * blue[w][h]) );\r\n //two for nested loops\r\n }\r\n }\r\n\r\n return gray;\r\n }",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public static double takeMaximumGrayLevel(BufferedImage image) {\n int maxLevel = (new Color(image.getRGB(0, 0))).getBlue();\n\n for (int i = 0; i < image.getWidth(); i ++) {\n for (int j = 0; j < image.getHeight(); j++) {\n int temp = (new Color(image.getRGB(i, j))).getBlue();\n if (maxLevel < temp) {\n maxLevel = temp;\n }\n }\n }\n\n return maxLevel;\n }",
"public ColorPlus binary() {\n\t\tint r = this.getRed();\n\t\tint g = this.getGreen();\n\t\tint b = this.getBlue();\n\t\t\n\t\tint cSum = r + g + b;\n\t\tif (cSum >= 382) {\n\t\t\tr = 0;\n\t\t\tg = 0;\n\t\t\tb = 0;\n\t\t}else{\n\t\t\tr = 255;\n\t\t\tg = 255;\n\t\t\tb = 255;\n\t\t}\n\t\treturn new ColorPlus(r,g,b); \n\t}",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}",
"public static int grayToBinary(int num) {\r\n\t\tint k = (INTEGER_SIZE >>> 1);\r\n\t\tint temp = num;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp ^= (temp >>> k);\r\n\t\t\tk >>>= 1;\r\n\t\t}\r\n\t\treturn temp;\r\n\t}",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"ImagePlus getRGBResultImage(double[] values,int width,int height){\r\n \t\tImagePlus tempImage = new ImagePlus(\"Visual results\");\r\n \t\ttempImage.setProcessor(new FloatProcessor(width,height,values));\r\n \t\tnew ImageConverter(tempImage).convertToRGB();\r\n \t\treturn tempImage;\r\n \t}",
"public Color getColor() {\r\n return Color.GRAY;\r\n }",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }",
"public static int[][][] greyScale(int[][][] source) {\n\n\t\t// Creating the new matrix\n\t\tint[][][] gray = new int[source.length][source[0].length][3]; \n\n\t\t// Creating a loop to print\n\t\tfor (int i = 0; i < source.length; i++) { \n\t\t\tfor (int j = 0; j < source[0].length; j++) { \n\t\t\t\tint[] klum = new int[3];\n\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\tklum[k] = source[i][j][k]; // Creating a pixel\n\t\t\t\t}\n\t\t\t\t// Put the grey pixel in the new Matrix\n\t\t\t\tgray[i][j] = luminance(klum); \n\t\t\t}\n\t\t}\n\t\treturn gray;\n\t}",
"public static BufferedImage convertG16ToRGB24(BufferedImage source) {\n int width = source.getWidth();\n int height = source.getHeight();\n BufferedImage retVal = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\n Raster raster = source.getData();\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n int original = raster.getSample(x, y, 0);\n //fixed addition of 1000m to get out of negative numbers everywhere\n //multiply by 100 to get the value in centimeters\n //this should comfortably fit in 24 bits considering lowest point\n //-418m and highest point 8800m give or take.\n //four bit left shift is for better visual representation of small\n //values (now they are represented with higher values of blue and\n //green)\n int replacement = ((original + 1000) * 100) << 4;\n\n retVal.setRGB(x, y, replacement);\n }\n }\n\n return retVal;\n }",
"private static BufferedImage colorBird(final BufferedImage refImage,\n final Color color) {\n \n final BufferedImage image = new BufferedImage(BIRD_WIDTH,\n BIRD_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n \n final Color bright = color.brighter().brighter();\n final Color dark = color.darker().darker();\n \n for (int y = 0; y < BIRD_HEIGHT; ++y){\n for (int x = 0; x < BIRD_WIDTH; ++x) {\n int argb = refImage.getRGB(x, y);\n if (argb == 0xffe0802c)\n argb = dark.getRGB();\n else if (argb == 0xfffad78c)\n argb = bright.getRGB();\n else if (argb == 0xfff8b733)\n argb = color.getRGB();\n image.setRGB(x, y, argb);\n }\n } \n return image;\n }",
"public static byte[] grayToBin(byte g[]){\n byte bg[] = new byte[g.length];\n bg[0] = g[0];\n for(int i=1;i<g.length;i++){\n bg[i]=(byte) (bg[i-1] ^ g[i]);\n }\n return bg;\n }",
"public void toGreen(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public Color getColor() {\n\t\treturn Color.GRAY;\n\t}",
"private BufferedImage initImg() throws IOException {\n\t\tint h = 256, w = 256;\n\t\tBufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB);\n\t\t\n\t\t//int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000;\n\t\tshort max = 0, min = 255, c = max;\n\t\tint color = SimpleImageViewer.getIntPixel(c, c, c);\n\t\t\n\t\tfor (int y = 0; y < h; y++) {\n\t\t\tfor (int x = 0; x < w; x++) {\n\t\t\t\timg.setRGB(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn img;\n\t}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }"
] | [
"0.7539967",
"0.75027645",
"0.7399723",
"0.7226301",
"0.7060517",
"0.7045929",
"0.7033008",
"0.6999505",
"0.6990598",
"0.696048",
"0.6924167",
"0.67787033",
"0.6753394",
"0.6723318",
"0.6685698",
"0.6603418",
"0.6600652",
"0.65646714",
"0.6538671",
"0.65261734",
"0.64955115",
"0.64580864",
"0.64497036",
"0.64322644",
"0.6381269",
"0.63340664",
"0.62923294",
"0.6225261",
"0.6220613",
"0.6199544",
"0.61857766",
"0.6172754",
"0.61650103",
"0.61440957",
"0.61440957",
"0.6108447",
"0.6050518",
"0.6004742",
"0.59940034",
"0.5971375",
"0.59359336",
"0.59255725",
"0.58479905",
"0.5839767",
"0.58370185",
"0.58234084",
"0.5821618",
"0.5818629",
"0.57872546",
"0.57540125",
"0.5753231",
"0.57471484",
"0.57283086",
"0.57195896",
"0.5712257",
"0.5682872",
"0.5665875",
"0.56415606",
"0.56252193",
"0.56219214",
"0.5611878",
"0.56082696",
"0.56033725",
"0.55923295",
"0.55547357",
"0.55496156",
"0.54885834",
"0.54701686",
"0.54184294",
"0.54099256",
"0.5399499",
"0.5381123",
"0.53781235",
"0.5377785",
"0.5365289",
"0.5350843",
"0.53377646",
"0.53143173",
"0.5294737",
"0.52751094",
"0.5244232",
"0.52325255",
"0.5179501",
"0.5158585",
"0.51360756",
"0.51172966",
"0.51054746",
"0.50981015",
"0.5087111",
"0.5063646",
"0.5035925",
"0.50307095",
"0.5025964",
"0.5014268",
"0.501057",
"0.5008064",
"0.4997227",
"0.49958536",
"0.49908754",
"0.49881157"
] | 0.71110934 | 4 |
Converts an ComplexImage to a GrayImage. Just throws away the imaginary part of the complex image. | public static GrayImage toGray(ComplexImage img) {
int X = img.X();
int Y = img.Y();
GrayImage newimg = null;
newimg = new GrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
newimg.set(x, y, (int) img.getReal(x, y));
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexNumber fromImaginary(double imaginary) {\n\t\treturn new ComplexNumber(0, imaginary);\n\t}",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"void greyscale();",
"void greyscale();",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Image bitmap2JPEG(Bitmap bit) {\n\n Image baseImage = new Image();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bit.compress(Bitmap.CompressFormat.JPEG, 90, stream);\n byte[] imageBytes = stream.toByteArray();\n baseImage.encodeContent(imageBytes);\n\n return baseImage;\n }",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public native boolean isGrayImage() throws MagickException;",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public Complex getConjugate() {\n\t\treturn new Complex(real, -imaginary);\n\t}",
"public Complex conjugate() {\r\n return new Complex(this.getReal(), this.getImag() * -1);\r\n }",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"public void setOutput8BitGray(boolean output8BitGray) {\n/* 158 */ this.output8BitGray = output8BitGray;\n/* */ }",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public native boolean negateImage(int grayscale) throws MagickException;",
"public Pic invert() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n current.setRed(255 - current.getRed());\n current.setGreen(255 - current.getGreen());\n current.setBlue(255 - current.getBlue());\n }\n }\n return output;\n }",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"Complex() {\n real = 0.0;\n imag = 0.0;\n }",
"public static Image aplicarLienzoAoriginal(Image imagenOriginal, int nxn) {\n BufferedImage biNegro = new BufferedImage(nxn, nxn, BufferedImage.TYPE_INT_RGB);\r\n for (int n = 0; n < biNegro.getHeight(); n++) {\r\n for (int n1 = 0; n1 < biNegro.getWidth(); n1++) {\r\n Color color = new Color(0, 0, 0);\r\n biNegro.setRGB(n, n, color.getRGB());\r\n }\r\n }\r\n\r\n BufferedImage bi = herramientas.HerramientasImagen.toBufferedImage(imagenOriginal);\r\n Color color;\r\n\r\n int x, y, aux;\r\n for (y = 0; y < bi.getHeight(); y++) {\r\n for (x = 0; x < bi.getWidth(); x++) {\r\n color = new Color(bi.getRGB(x, y));\r\n\r\n try {\r\n biNegro.setRGB(x, y, color.getRGB());\r\n } catch (Exception e) {\r\n }\r\n\r\n }\r\n }\r\n return herramientas.HerramientasImagen.toImage(biNegro);\r\n\r\n }",
"public ComplexNumber(double real, double imaginary) {\n this.real = real;\n this.imaginary = imaginary;\n }",
"public ComplexNumber(double real, double imaginary) {\n\t\tsuper();\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"BufferedImage outputImage();",
"public double getImaginary() {\r\n return imaginary;\r\n }",
"public ComplexNumber(ComplexNumber cn) {\n\t\treal = cn.getReal();\n\t\timag = cn.getImag();\n\t}",
"public double getImaginary() {\n\t\treturn imaginary;\n\t}",
"public double getImaginary() {\n\t\treturn imaginary;\n\t}",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public Complex getConjugate() {\n return new Complex(r, -i);\n }",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public static BufferedImage BToBI(Blob image) throws SQLException, IOException {\n\t\tInputStream in = image.getBinaryStream(); \n\t\tBufferedImage toReturn = ImageIO.read(in);\n\t\treturn toReturn;\n\t}",
"@Override\n public byte[] compress(byte[] imagen) {\n ResetVarC();\n /*\n Declaraciones de variables\n */\n char[] imagenaux = new char[imagen.length];\n for (int j = 0; j < imagen.length; j++) {\n imagenaux[j] = (char) (imagen[j] & 0xFF);\n }\n\n getWidthandHeight(imagenaux);\n\n imagenYCbCr = new int[height][width][3];\n for (int i = 0; i < height; ++i) {\n for (int j = 0; j < width; ++j) {\n int[] RGB = {(int) imagenaux[iterator], (int) imagenaux[iterator + 1], (int) imagenaux[iterator + 2]};\n imagenYCbCr[i][j] = RGBtoYCbCr(RGB);\n iterator += 3;\n }\n }\n\n CreateCompression();\n\n\n Huffman comprimirY = new Huffman();\n Huffman comprimirCB = new Huffman();\n Huffman comprimirCR = new Huffman();\n\n String Yen = comprimirY.compressHuffman(Yencoding);\n String Cben = comprimirCB.compressHuffman(Cbencoding);\n String Cren = comprimirCR.compressHuffman(Crencoding);\n\n\n Map<Integer, Integer> freqY = comprimirY.getFrequencies();\n Map<Integer, Integer> freqCb = comprimirCB.getFrequencies();\n Map<Integer, Integer> freqCr = comprimirCR.getFrequencies();\n\n\n CreateFreq(freqY, freqCb, freqCr);\n\n return JPEGFile(freqY, freqCb, freqCr, Yen, Cben, Cren);\n }",
"public native MagickImage enhanceImage() throws MagickException;",
"public native void blobToImage(ImageInfo imageInfo, byte[] blob)\n\t\t\tthrows MagickException;",
"public static BufferedImage deepCopy(BufferedImage bi) \n {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultip = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultip, null);\n }",
"public ComplexNum copy() {\n /*\n * returns a deep copy of this complex number\n * */\n\n return new ComplexNum(realPart, imaginaryPart);\n }",
"public FImage inverse() {\n\t\tfinal int cs = real.getCols();\n\t\tfinal int rs = real.getRows();\n\n\t\tfinal FloatFFT_2D fft = new FloatFFT_2D(rs, cs);\n\t\tfinal float[][] prepared = new float[rs][cs * 2];\n\t\tfor (int y = 0; y < rs; y++) {\n\t\t\tfor (int x = 0; x < cs; x++) {\n\t\t\t\tprepared[y][x * 2] = real.pixels[y][x];\n\t\t\t\tprepared[y][1 + x * 2] = imaginary.pixels[y][x];\n\t\t\t}\n\t\t}\n\n\t\tfft.complexInverse(prepared, true);\n\n\t\tfinal FImage image = new FImage(cs, rs);\n\t\tFourierTransform.unprepareData(prepared, image, centre);\n\n\t\treturn image;\n\t}",
"public static BufferedImage deepCopy(BufferedImage bi) {\n\t\tColorModel cm = bi.getColorModel();\n\t\tboolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n\t\tWritableRaster raster = bi.copyData(null);\n\t\treturn new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n\t}",
"public static void convert( ImageBase input, ImageBase output ) {\n\n\t\tImageType typeIn = input.getImageType();\n\t\tImageType typeOut = output.getImageType();\n\n\t\tif (input instanceof ImageGray) {\n\t\t\tImageGray sb = (ImageGray)input;\n\t\t\tif (output instanceof ImageGray) {\n\t\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\t\toutput.setTo(input);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (output instanceof Planar) {\n\t\t\t\tPlanar ms = (Planar)output;\n\t\t\t\tfor (int i = 0; i < ms.getNumBands(); i++) {\n\t\t\t\t\tconvert(input, ms.getBand(i));\n\t\t\t\t}\n\t\t\t} else if (output instanceof ImageInterleaved) {\n\t\t\t\tImageInterleaved il = (ImageInterleaved)output;\n\t\t\t\tfor (int i = 0; i < il.getNumBands(); i++) {\n\t\t\t\t\tGImageMiscOps.insertBand(sb, i, il);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageInterleaved) {\n\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\toutput.setTo(input);\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageGray) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mi.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mi.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mi, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mi, so);\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageInterleaved) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof Planar) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tPlanar mo = (Planar)output;\n\n\t\t\tif (mi.getBandType() == mo.getBandType()) {\n\t\t\t\tmo.setTo(mi);\n\t\t\t} else {\n\t\t\t\tfor (int i = 0; i < mi.getNumBands(); i++) {\n\t\t\t\t\tconvert(mi.getBand(i), mo.getBand(i));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof Planar) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageGray) {\n\t\t\tImageInterleaved mb = (ImageInterleaved)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mb.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mb.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mb, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mb, so);\n\t\t\t}\n\t\t} else {\n\t\t\tString nameInput = input.getClass().getSimpleName();\n\t\t\tString nameOutput = output.getClass().getSimpleName();\n\t\t\tthrow new IllegalArgumentException(\"Don't know how to convert between input types. \" + nameInput + \" \" + nameOutput);\n\t\t}\n\t}",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }"
] | [
"0.776779",
"0.74342155",
"0.7344059",
"0.69146544",
"0.6687242",
"0.66863155",
"0.661048",
"0.6539228",
"0.64494836",
"0.6412695",
"0.6356414",
"0.62665504",
"0.6257219",
"0.61983925",
"0.6194952",
"0.61843306",
"0.618035",
"0.6177579",
"0.6086458",
"0.6022815",
"0.5939348",
"0.5917747",
"0.5879244",
"0.5874218",
"0.5804149",
"0.58010787",
"0.5782092",
"0.5781974",
"0.575768",
"0.5742277",
"0.5739306",
"0.5690299",
"0.5677764",
"0.55841494",
"0.5544476",
"0.5470157",
"0.5445649",
"0.53960973",
"0.5370223",
"0.53686357",
"0.53641665",
"0.53340876",
"0.53298354",
"0.5262667",
"0.5262667",
"0.5260689",
"0.52226025",
"0.5177568",
"0.5168247",
"0.5145351",
"0.5119093",
"0.5115745",
"0.50634575",
"0.5048911",
"0.5031858",
"0.50269693",
"0.5014386",
"0.5003718",
"0.49854258",
"0.4983505",
"0.49803102",
"0.49731195",
"0.49618828",
"0.4957583",
"0.49314052",
"0.48963648",
"0.48689756",
"0.48551685",
"0.4838862",
"0.48044726",
"0.4776412",
"0.47686443",
"0.47677523",
"0.4746339",
"0.47370756",
"0.4706013",
"0.47049743",
"0.470362",
"0.4694932",
"0.46863773",
"0.4670888",
"0.4663003",
"0.46573177",
"0.4655871",
"0.4655871",
"0.46462438",
"0.46457893",
"0.46428388",
"0.46293518",
"0.4620537",
"0.45914334",
"0.45912442",
"0.45910594",
"0.45724183",
"0.45648953",
"0.45592242",
"0.45479208",
"0.4547754",
"0.4546721",
"0.4546584"
] | 0.84619296 | 0 |
Converts an GrayImage to a RealGrayImage | public static RealGrayImage toRealGray(GrayImage img) {
int X = img.X();
int Y = img.Y();
RealGrayImage newimg = new RealGrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
newimg.set(x, y, (float) img.get(x, y));
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"void greyscale();",
"void greyscale();",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public native boolean isGrayImage() throws MagickException;",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"public BufferedImage rescaleImage(BufferedImage image, float scale) {\r\n int[][][] arr = convertToArray(image);\r\n return convertToBimage(rescaleImage(arr, scale));//return array\r\n }",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"@Test\n public void testGrayFilter() {\n System.out.println(\"grayFilter\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.grayFilter();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public void setOutput8BitGray(boolean output8BitGray) {\n/* 158 */ this.output8BitGray = output8BitGray;\n/* */ }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private RealMatrix retrieveImageIntensities(String filename) {\n\t\tBufferedImage img = null;\n\t\tdouble matrixData[][] = null; \n\t\ttry {\n\t\t\t\n\t\t\t// Read in the image.\n\t\t\timg = ImageIO.read(new File(filename));\n\t\t\tmatrixData = new double[img.getWidth()][img.getHeight()];\n\n\t\t\t// Transform the image into a grayscale image.\n\t\t\tRaster raster = img.getData();\n\t\t\tfor (int i=0; i < img.getWidth(); i++) {\n\t\t\t\tfor (int j=0; j < img.getHeight(); j++) {\n\t\t\t\t\tint gray = raster.getPixel(i, j, new int[raster.getNumBands()])[0];\n\t\t\t\t\tdouble convertedGray = (double) gray / 255;\n\t\t\t\t\tif (convertedGray > 255) {\n\t\t\t\t\t\tSystem.out.println(\"wrong2\");\n\t\t\t\t\t}\n\t\t\t\t\tmatrixData[i][j] = convertedGray;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error reading \" + filename);\n\t\t}\n\t\treturn MatrixUtils.createRealMatrix(matrixData);\n\t}",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Mat rapidConvertRGBAToGRAY(Mat rgba) {\n Mat gray = new Mat(rgba.rows(), rgba.cols(), CvType.CV_8UC1);\n Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);\n return gray;\n }",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static Image aplicarLienzoAoriginal(Image imagenOriginal, int nxn) {\n BufferedImage biNegro = new BufferedImage(nxn, nxn, BufferedImage.TYPE_INT_RGB);\r\n for (int n = 0; n < biNegro.getHeight(); n++) {\r\n for (int n1 = 0; n1 < biNegro.getWidth(); n1++) {\r\n Color color = new Color(0, 0, 0);\r\n biNegro.setRGB(n, n, color.getRGB());\r\n }\r\n }\r\n\r\n BufferedImage bi = herramientas.HerramientasImagen.toBufferedImage(imagenOriginal);\r\n Color color;\r\n\r\n int x, y, aux;\r\n for (y = 0; y < bi.getHeight(); y++) {\r\n for (x = 0; x < bi.getWidth(); x++) {\r\n color = new Color(bi.getRGB(x, y));\r\n\r\n try {\r\n biNegro.setRGB(x, y, color.getRGB());\r\n } catch (Exception e) {\r\n }\r\n\r\n }\r\n }\r\n return herramientas.HerramientasImagen.toImage(biNegro);\r\n\r\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"@SuppressWarnings( \"unchecked\" )\n\t@Test\n\tpublic void testMatToImgConversion() throws IOException {\n\t\tMat mat = imread( input, opencv_imgcodecs.IMREAD_GRAYSCALE );\n\t\tif ( mat.empty() )\n\t\t\tfail( \"Couldn't load image: \" + input );\n\t\tRandomAccessibleInterval< ByteType > convertedMat = ( RandomAccessibleInterval< ByteType > ) new MatToImgConverter().convert( mat, RandomAccessibleInterval.class );\n\t\tsaveImg( convertedMat, mat2img );\n\n\t\t//Read image with ImageJ\n\t\tDataset dataset = getScifio().datasetIO().open( input );\n\t\tRandomAccessibleInterval< ByteType > ijImage =\n\t\t\t\tRealTypeConverters.convert( ( RandomAccessibleInterval< ? extends RealType< ? > > ) dataset.getImgPlus().getImg(), new ByteType() );\n\n\t\t//Compare data\n\t\tcheckData( convertedMat, ijImage );\n\t}",
"public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }",
"public static <R extends RealType<R>> Img<R> vectorToImage(final RealVector ar, final R type, final int numDims,\n final ImgFactory<R> fac) {\n final long[] dims = new long[numDims];\n\n for (int i = 0; i < (dims.length - 1); i++) {\n dims[i] = 1;\n }\n dims[dims.length - 1] = ar.getDimension();\n final Img<R> res = fac.create(dims, type);\n final Cursor<R> c = res.cursor();\n while (c.hasNext()) {\n c.fwd();\n c.get().setReal(ar.getEntry(c.getIntPosition(numDims - 1)));\n }\n\n return res;\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"BufferedImage getImage();",
"BufferedImage getImage();",
"BufferedImage getImage();",
"public int[][][] rescaleImage(int[][][] image, float scale) {\r\n int height = image[0].length;\r\n int width = image.length;\r\n BufferedImage result = new BufferedImage(width, height, 1);\r\n //loop through all pixels.\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n int a = image[x][y][0];\r\n int r = image[x][y][1];\r\n int g = image[x][y][2];\r\n int b = image[x][y][3];\r\n\r\n r = (int) (r * scale);\r\n g = (int) (g * scale);\r\n b = (int) (b * scale);\r\n\r\n image[x][y][0] = a;\r\n image[x][y][1] = r;\r\n image[x][y][2] = g;\r\n image[x][y][3] = b;\r\n }\r\n }\r\n return image; //return array\r\n }",
"@Override\r\n\tpublic BufferedImage transform(BufferedImage image){\n\t\tMat mat = Mat2BufImg.BufImg2Mat(image, BufferedImage.TYPE_3BYTE_BGR, CvType.CV_8UC3);\r\n\t\t//人脸识别\r\n\t\ttry {\r\n\t\t\t//mat --> bufferimage\r\n\t\t\treturn Mat2BufImg.Mat2BufImg(detectFace(mat),\".png\");\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn image;\r\n\t}",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}",
"private double[][] normalize255(RealMatrix realMatrix) {\n\t\tdouble[][] input = realMatrix.getData();\n\t\tdouble[][] normalized = new double[realMatrix.getRowDimension()][realMatrix.getColumnDimension()];\n\t\tdouble minimum = 99999.99;\n\t\tdouble maximum = -9999.99;\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tminimum = Math.min(minimum, input[i][j]);\n\t\t\t\tmaximum = Math.max(maximum, input[i][j]);\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tnormalized[i][j] = ((input[i][j] - minimum)*(255/(maximum-minimum)));\n\t\t\t}\n\t\t}\n\t\treturn normalized;\n\t}",
"public RawImage(BufferedImage img, int res) {\n boolean[] alpha = new boolean[1];\n m_img = ImageHelper.convertToRGB(img, alpha);\n m_hasAlpha = alpha[0];\n m_height = m_img.length;\n m_width = m_height > 0 ? m_img[0].length : 0;\n m_res = res;\n }",
"public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}",
"public native MagickImage edgeImage(double raduis) throws MagickException;",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public static GrayU8 convert( ImageGray input, double min, double max, int numValues, GrayU8 output ) {\n\t\t// see if it can use the faster straight forward convert\n\t\tif (min == 0 && max == 255 && numValues == 256) {\n\t\t\tif (output == null)\n\t\t\t\toutput = new GrayU8(input.width, input.height);\n\t\t\tconvert(input, output);\n\t\t\treturn output;\n\t\t}\n\n\t\tImageDataType type = input.getImageType().getDataType();\n\t\tif (type == ImageDataType.U8) {\n\t\t\treturn ConvertImage.convert((GrayU8)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S8) {\n\t\t\treturn ConvertImage.convert((GrayS8)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.U16) {\n\t\t\treturn ConvertImage.convert((GrayU16)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S16) {\n\t\t\treturn ConvertImage.convert((GrayS16)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S32) {\n\t\t\treturn ConvertImage.convert((GrayS32)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S64) {\n\t\t\treturn ConvertImage.convert((GrayS64)input, (long)min, (long)max, numValues, output);\n\t\t} else if (type == ImageDataType.F32) {\n\t\t\treturn ConvertImage.convert((GrayF32)input, (float)min, (float)max, numValues, output);\n\t\t} else if (type == ImageDataType.F64) {\n\t\t\treturn ConvertImage.convert((GrayF64)input, min, max, numValues, output);\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"Unknown image type: \" + type);\n\t\t}\n\t}",
"public static int[][][] greyScale(int[][][] source) {\n\n\t\t// Creating the new matrix\n\t\tint[][][] gray = new int[source.length][source[0].length][3]; \n\n\t\t// Creating a loop to print\n\t\tfor (int i = 0; i < source.length; i++) { \n\t\t\tfor (int j = 0; j < source[0].length; j++) { \n\t\t\t\tint[] klum = new int[3];\n\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\tklum[k] = source[i][j][k]; // Creating a pixel\n\t\t\t\t}\n\t\t\t\t// Put the grey pixel in the new Matrix\n\t\t\t\tgray[i][j] = luminance(klum); \n\t\t\t}\n\t\t}\n\t\treturn gray;\n\t}",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public abstract RGBFColor toRGBFColor();",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public static Image toImage(BufferedImage bufferedImage) {\r\n return Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());\r\n }",
"public Mat convertToEdges(Mat img) {\n\n return img;\n }"
] | [
"0.8587625",
"0.7919913",
"0.790885",
"0.7901528",
"0.7887143",
"0.7851263",
"0.77716064",
"0.76512545",
"0.70277095",
"0.69279313",
"0.69266135",
"0.6788941",
"0.6715673",
"0.6567234",
"0.64992434",
"0.6498429",
"0.6336164",
"0.62465227",
"0.62435853",
"0.6241609",
"0.6187426",
"0.6185919",
"0.59581846",
"0.59581846",
"0.59493047",
"0.59216064",
"0.58586454",
"0.5833539",
"0.5798173",
"0.5785896",
"0.5771389",
"0.56789297",
"0.562426",
"0.5595222",
"0.5593188",
"0.5591678",
"0.55723935",
"0.5547477",
"0.554652",
"0.5474809",
"0.5436631",
"0.54167354",
"0.5402564",
"0.5319268",
"0.5284315",
"0.5270634",
"0.52323544",
"0.52219355",
"0.51188904",
"0.51079863",
"0.51028746",
"0.5100893",
"0.50947",
"0.50855994",
"0.50850636",
"0.5082536",
"0.50716364",
"0.5043287",
"0.50160664",
"0.49323413",
"0.4923693",
"0.49112374",
"0.49106333",
"0.4906286",
"0.4879113",
"0.48735696",
"0.48684332",
"0.48667452",
"0.48547438",
"0.48455265",
"0.48317087",
"0.4809604",
"0.4789113",
"0.4778948",
"0.47490305",
"0.47461128",
"0.47436652",
"0.47135437",
"0.47016382",
"0.46880448",
"0.46880448",
"0.46880448",
"0.46568295",
"0.4631843",
"0.46285027",
"0.46197766",
"0.46105728",
"0.45939925",
"0.45899916",
"0.45887247",
"0.45827842",
"0.4571566",
"0.45482662",
"0.45470986",
"0.45366976",
"0.45352376",
"0.4533818",
"0.45238164",
"0.45176136",
"0.45168632"
] | 0.8609751 | 0 |
Converts a RealGrayImage to a RealGrayImage | public static RealGrayImage toRealGray(RealGrayImage img) {
int X = img.X();
int Y = img.Y();
RealGrayImage newimg = new RealGrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
newimg.set(x, y, img.get(x, y));
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"void greyscale();",
"void greyscale();",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public native boolean isGrayImage() throws MagickException;",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"public static Mat rapidConvertRGBAToGRAY(Mat rgba) {\n Mat gray = new Mat(rgba.rows(), rgba.cols(), CvType.CV_8UC1);\n Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);\n return gray;\n }",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public void setOutput8BitGray(boolean output8BitGray) {\n/* 158 */ this.output8BitGray = output8BitGray;\n/* */ }",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"public BufferedImage rescaleImage(BufferedImage image, float scale) {\r\n int[][][] arr = convertToArray(image);\r\n return convertToBimage(rescaleImage(arr, scale));//return array\r\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"@Test\n public void testGrayFilter() {\n System.out.println(\"grayFilter\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.grayFilter();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public static Image aplicarLienzoAoriginal(Image imagenOriginal, int nxn) {\n BufferedImage biNegro = new BufferedImage(nxn, nxn, BufferedImage.TYPE_INT_RGB);\r\n for (int n = 0; n < biNegro.getHeight(); n++) {\r\n for (int n1 = 0; n1 < biNegro.getWidth(); n1++) {\r\n Color color = new Color(0, 0, 0);\r\n biNegro.setRGB(n, n, color.getRGB());\r\n }\r\n }\r\n\r\n BufferedImage bi = herramientas.HerramientasImagen.toBufferedImage(imagenOriginal);\r\n Color color;\r\n\r\n int x, y, aux;\r\n for (y = 0; y < bi.getHeight(); y++) {\r\n for (x = 0; x < bi.getWidth(); x++) {\r\n color = new Color(bi.getRGB(x, y));\r\n\r\n try {\r\n biNegro.setRGB(x, y, color.getRGB());\r\n } catch (Exception e) {\r\n }\r\n\r\n }\r\n }\r\n return herramientas.HerramientasImagen.toImage(biNegro);\r\n\r\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"@SuppressWarnings( \"unchecked\" )\n\t@Test\n\tpublic void testMatToImgConversion() throws IOException {\n\t\tMat mat = imread( input, opencv_imgcodecs.IMREAD_GRAYSCALE );\n\t\tif ( mat.empty() )\n\t\t\tfail( \"Couldn't load image: \" + input );\n\t\tRandomAccessibleInterval< ByteType > convertedMat = ( RandomAccessibleInterval< ByteType > ) new MatToImgConverter().convert( mat, RandomAccessibleInterval.class );\n\t\tsaveImg( convertedMat, mat2img );\n\n\t\t//Read image with ImageJ\n\t\tDataset dataset = getScifio().datasetIO().open( input );\n\t\tRandomAccessibleInterval< ByteType > ijImage =\n\t\t\t\tRealTypeConverters.convert( ( RandomAccessibleInterval< ? extends RealType< ? > > ) dataset.getImgPlus().getImg(), new ByteType() );\n\n\t\t//Compare data\n\t\tcheckData( convertedMat, ijImage );\n\t}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static <R extends RealType<R>> Img<R> vectorToImage(final RealVector ar, final R type, final int numDims,\n final ImgFactory<R> fac) {\n final long[] dims = new long[numDims];\n\n for (int i = 0; i < (dims.length - 1); i++) {\n dims[i] = 1;\n }\n dims[dims.length - 1] = ar.getDimension();\n final Img<R> res = fac.create(dims, type);\n final Cursor<R> c = res.cursor();\n while (c.hasNext()) {\n c.fwd();\n c.get().setReal(ar.getEntry(c.getIntPosition(numDims - 1)));\n }\n\n return res;\n }",
"public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public Mat convertToEdges(Mat img) {\n\n return img;\n }",
"public static Mat invert(JPEGCategory[] input) {\n\t\tdouble[] data = new double[64];\n\t\tint k = 0;\n\t\t\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tdouble[] subArr = convertToDouble(input[i]);\n\t\t\tfor (int j = 0; j < subArr.length; j++) {\n\t\t\t\tdata[k] = subArr[j];\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble[] newData = { \n\t\t\t data[0], data[1], data[5], data[6], data[14], data[15], data[27], data[28], \n\t\t\t data[2], data[4], data[7], data[13], data[16], data[26], data[29], data[42], \n\t\t\t data[3], data[8], data[12], data[17], data[25], data[30], data[41], data[43], \n\t\t\t data[9], data[11], data[18], data[24], data[31], data[40], data[44], data[53], \n\t\t\tdata[10], data[19], data[23], data[32], data[39], data[45], data[52], data[54], \n\t\t\tdata[20], data[22], data[33], data[38], data[46], data[51], data[55], data[60], \n\t\t\tdata[21], data[34], data[37], data[47], data[50], data[56], data[59], data[61], \n\t\t\tdata[35], data[36], data[48], data[49], data[57], data[58], data[62], data[63] \n\t\t};\n\n\t\tMat result = new Mat(8, 8, CvType.CV_64FC1);\n\t\tresult.put(0, 0, newData);\n\t\treturn result;\n\t}",
"public static GrayU8 convert( ImageGray input, double min, double max, int numValues, GrayU8 output ) {\n\t\t// see if it can use the faster straight forward convert\n\t\tif (min == 0 && max == 255 && numValues == 256) {\n\t\t\tif (output == null)\n\t\t\t\toutput = new GrayU8(input.width, input.height);\n\t\t\tconvert(input, output);\n\t\t\treturn output;\n\t\t}\n\n\t\tImageDataType type = input.getImageType().getDataType();\n\t\tif (type == ImageDataType.U8) {\n\t\t\treturn ConvertImage.convert((GrayU8)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S8) {\n\t\t\treturn ConvertImage.convert((GrayS8)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.U16) {\n\t\t\treturn ConvertImage.convert((GrayU16)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S16) {\n\t\t\treturn ConvertImage.convert((GrayS16)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S32) {\n\t\t\treturn ConvertImage.convert((GrayS32)input, (int)min, (int)max, numValues, output);\n\t\t} else if (type == ImageDataType.S64) {\n\t\t\treturn ConvertImage.convert((GrayS64)input, (long)min, (long)max, numValues, output);\n\t\t} else if (type == ImageDataType.F32) {\n\t\t\treturn ConvertImage.convert((GrayF32)input, (float)min, (float)max, numValues, output);\n\t\t} else if (type == ImageDataType.F64) {\n\t\t\treturn ConvertImage.convert((GrayF64)input, min, max, numValues, output);\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"Unknown image type: \" + type);\n\t\t}\n\t}",
"private double[][] normalize255(RealMatrix realMatrix) {\n\t\tdouble[][] input = realMatrix.getData();\n\t\tdouble[][] normalized = new double[realMatrix.getRowDimension()][realMatrix.getColumnDimension()];\n\t\tdouble minimum = 99999.99;\n\t\tdouble maximum = -9999.99;\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tminimum = Math.min(minimum, input[i][j]);\n\t\t\t\tmaximum = Math.max(maximum, input[i][j]);\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tnormalized[i][j] = ((input[i][j] - minimum)*(255/(maximum-minimum)));\n\t\t\t}\n\t\t}\n\t\treturn normalized;\n\t}",
"private RealMatrix retrieveImageIntensities(String filename) {\n\t\tBufferedImage img = null;\n\t\tdouble matrixData[][] = null; \n\t\ttry {\n\t\t\t\n\t\t\t// Read in the image.\n\t\t\timg = ImageIO.read(new File(filename));\n\t\t\tmatrixData = new double[img.getWidth()][img.getHeight()];\n\n\t\t\t// Transform the image into a grayscale image.\n\t\t\tRaster raster = img.getData();\n\t\t\tfor (int i=0; i < img.getWidth(); i++) {\n\t\t\t\tfor (int j=0; j < img.getHeight(); j++) {\n\t\t\t\t\tint gray = raster.getPixel(i, j, new int[raster.getNumBands()])[0];\n\t\t\t\t\tdouble convertedGray = (double) gray / 255;\n\t\t\t\t\tif (convertedGray > 255) {\n\t\t\t\t\t\tSystem.out.println(\"wrong2\");\n\t\t\t\t\t}\n\t\t\t\t\tmatrixData[i][j] = convertedGray;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error reading \" + filename);\n\t\t}\n\t\treturn MatrixUtils.createRealMatrix(matrixData);\n\t}",
"@Override\r\n\tpublic BufferedImage transform(BufferedImage image){\n\t\tMat mat = Mat2BufImg.BufImg2Mat(image, BufferedImage.TYPE_3BYTE_BGR, CvType.CV_8UC3);\r\n\t\t//人脸识别\r\n\t\ttry {\r\n\t\t\t//mat --> bufferimage\r\n\t\t\treturn Mat2BufImg.Mat2BufImg(detectFace(mat),\".png\");\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn image;\r\n\t}",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}",
"public abstract RGBFColor toRGBFColor();",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public int[][][] rescaleImage(int[][][] image, float scale) {\r\n int height = image[0].length;\r\n int width = image.length;\r\n BufferedImage result = new BufferedImage(width, height, 1);\r\n //loop through all pixels.\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n int a = image[x][y][0];\r\n int r = image[x][y][1];\r\n int g = image[x][y][2];\r\n int b = image[x][y][3];\r\n\r\n r = (int) (r * scale);\r\n g = (int) (g * scale);\r\n b = (int) (b * scale);\r\n\r\n image[x][y][0] = a;\r\n image[x][y][1] = r;\r\n image[x][y][2] = g;\r\n image[x][y][3] = b;\r\n }\r\n }\r\n return image; //return array\r\n }",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"public native MagickImage edgeImage(double raduis) throws MagickException;",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public RawImage(BufferedImage img, int res) {\n boolean[] alpha = new boolean[1];\n m_img = ImageHelper.convertToRGB(img, alpha);\n m_hasAlpha = alpha[0];\n m_height = m_img.length;\n m_width = m_height > 0 ? m_img[0].length : 0;\n m_res = res;\n }",
"public static Image toImage(BufferedImage bufferedImage) {\r\n return Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());\r\n }",
"public static int[][][] greyScale(int[][][] source) {\n\n\t\t// Creating the new matrix\n\t\tint[][][] gray = new int[source.length][source[0].length][3]; \n\n\t\t// Creating a loop to print\n\t\tfor (int i = 0; i < source.length; i++) { \n\t\t\tfor (int j = 0; j < source[0].length; j++) { \n\t\t\t\tint[] klum = new int[3];\n\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\tklum[k] = source[i][j][k]; // Creating a pixel\n\t\t\t\t}\n\t\t\t\t// Put the grey pixel in the new Matrix\n\t\t\t\tgray[i][j] = luminance(klum); \n\t\t\t}\n\t\t}\n\t\treturn gray;\n\t}",
"public static void convert( ImageBase input, ImageBase output ) {\n\n\t\tImageType typeIn = input.getImageType();\n\t\tImageType typeOut = output.getImageType();\n\n\t\tif (input instanceof ImageGray) {\n\t\t\tImageGray sb = (ImageGray)input;\n\t\t\tif (output instanceof ImageGray) {\n\t\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\t\toutput.setTo(input);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (output instanceof Planar) {\n\t\t\t\tPlanar ms = (Planar)output;\n\t\t\t\tfor (int i = 0; i < ms.getNumBands(); i++) {\n\t\t\t\t\tconvert(input, ms.getBand(i));\n\t\t\t\t}\n\t\t\t} else if (output instanceof ImageInterleaved) {\n\t\t\t\tImageInterleaved il = (ImageInterleaved)output;\n\t\t\t\tfor (int i = 0; i < il.getNumBands(); i++) {\n\t\t\t\t\tGImageMiscOps.insertBand(sb, i, il);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageInterleaved) {\n\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\toutput.setTo(input);\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageGray) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mi.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mi.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mi, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mi, so);\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageInterleaved) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof Planar) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tPlanar mo = (Planar)output;\n\n\t\t\tif (mi.getBandType() == mo.getBandType()) {\n\t\t\t\tmo.setTo(mi);\n\t\t\t} else {\n\t\t\t\tfor (int i = 0; i < mi.getNumBands(); i++) {\n\t\t\t\t\tconvert(mi.getBand(i), mo.getBand(i));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof Planar) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageGray) {\n\t\t\tImageInterleaved mb = (ImageInterleaved)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mb.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mb.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mb, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mb, so);\n\t\t\t}\n\t\t} else {\n\t\t\tString nameInput = input.getClass().getSimpleName();\n\t\t\tString nameOutput = output.getClass().getSimpleName();\n\t\t\tthrow new IllegalArgumentException(\"Don't know how to convert between input types. \" + nameInput + \" \" + nameOutput);\n\t\t}\n\t}",
"public static int grayToBinary(int num) {\r\n\t\tint k = (INTEGER_SIZE >>> 1);\r\n\t\tint temp = num;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp ^= (temp >>> k);\r\n\t\t\tk >>>= 1;\r\n\t\t}\r\n\t\treturn temp;\r\n\t}",
"public static int NTSCRGBtoGray(int r, int g, int b) {\n return (int) (0.2126 * r + 0.7152 * g + 0.0722 * b);\n }"
] | [
"0.84286344",
"0.80323845",
"0.784206",
"0.7829642",
"0.7785133",
"0.77483577",
"0.7722892",
"0.74813056",
"0.6996566",
"0.697725",
"0.6761562",
"0.6652751",
"0.6609191",
"0.6594575",
"0.65575236",
"0.6545868",
"0.6525927",
"0.65119255",
"0.6413849",
"0.6375653",
"0.63280123",
"0.62570226",
"0.6226515",
"0.61315554",
"0.6095671",
"0.60835785",
"0.60459524",
"0.60459524",
"0.60075766",
"0.5849621",
"0.5825926",
"0.5802393",
"0.5753022",
"0.5657208",
"0.5650513",
"0.56299824",
"0.5622893",
"0.56150013",
"0.55834144",
"0.5524055",
"0.54582715",
"0.53566766",
"0.5338276",
"0.5299393",
"0.5287",
"0.5238794",
"0.5220771",
"0.51652884",
"0.51127785",
"0.50989175",
"0.5076493",
"0.5038751",
"0.50337696",
"0.5030768",
"0.5029792",
"0.502425",
"0.49801978",
"0.4979944",
"0.49607828",
"0.4926933",
"0.49082568",
"0.4892451",
"0.48832372",
"0.48731068",
"0.4870901",
"0.4865873",
"0.48326284",
"0.4831313",
"0.48076868",
"0.47722515",
"0.47360134",
"0.47000107",
"0.46942118",
"0.46896693",
"0.46884567",
"0.4668556",
"0.46630555",
"0.46626896",
"0.46605012",
"0.46579474",
"0.46565723",
"0.4641586",
"0.4621016",
"0.46170345",
"0.46088392",
"0.46072093",
"0.46025333",
"0.45961362",
"0.45956314",
"0.45898178",
"0.4584263",
"0.45697403",
"0.45668876",
"0.4551272",
"0.4522336",
"0.45201987",
"0.45024598",
"0.45000595",
"0.44978103",
"0.4474023"
] | 0.8633919 | 0 |
Converts a ColorImage to a RealGrayImage. Uses the following formula for calculation: gray value = (float)(red_value 0.299 + green_value 0.587 + blue_value 0.114) | public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,
ColorModelUnknownException {
int X = img.X();
int Y = img.Y();
int[] color = new int[3];
float gray;
RealGrayImage newimg = null;
switch (img.getColorModel()) {
case ColorImage.RGB:
newimg = new RealGrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
color = img.get(x, y);
gray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]
* 0.114f;
newimg.set(x, y, gray);
}
}
break;
case ColorImage.CMY:
case ColorImage.YIQ:
case ColorImage.HSV:
case ColorImage.HLS:
throw new ColorModelNotSupportedException();
default:
throw new ColorModelUnknownException();
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"void greyscale();",
"void greyscale();",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public abstract RGBFColor toRGBFColor();",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public static Bitmap ChangeGrey(Bitmap src, int depth, double red, double green, double blue) {\n int width = src.getWidth();\n int height = src.getHeight();\n Bitmap finalBitmap = Bitmap.createBitmap(width, height, src.getConfig());\n final double grayScale_Red = 0.3;\n final double grayScale_Green = 0.59;\n final double grayScale_Blue = 0.11;\n\n int channel_aplha, channel_red, channel_green, channel_blue;\n int pixel;\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n pixel = src.getPixel(x, y);\n channel_aplha = Color.alpha(pixel);\n channel_red = Color.red(pixel);\n channel_green = Color.green(pixel);\n channel_blue = Color.blue(pixel);\n channel_blue = channel_green = channel_red = (int) (grayScale_Red * channel_red + grayScale_Green * channel_green + grayScale_Blue * channel_blue);\n channel_red += (depth * red);\n\n if (channel_red > 255) {\n channel_red = 255;\n }\n channel_green += (depth * green);\n if (channel_green > 255) {\n channel_green = 255;\n }\n channel_blue += (depth * blue);\n if (channel_blue > 255) {\n channel_blue = 255;\n }\n finalBitmap.setPixel(x, y, Color.argb(channel_aplha, channel_red, channel_green, channel_blue));\n }\n }\n return finalBitmap;\n }",
"public native boolean isGrayImage() throws MagickException;",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public abstract RGBIColor toRGBColor();",
"public static int getGrayscale(int rgb[]) throws Exception {\r\n\t\t//Weights;\r\n\t\tdouble redWeight = 0.2126;\r\n\t\tdouble greenWeight = 0.7152;\r\n\t\tdouble blueWeight = 0.0722;\r\n\r\n\t\t//Multiplies the RGB by the Weights:\r\n\t\tint redWeighted = (int) (rgb[0] * redWeight);\r\n\t\tint greenWeighted = (int) (rgb[1] * greenWeight);\r\n\t\tint blueWeighted = (int) (rgb[2] * blueWeight);\r\n\r\n\t\t//Gets the GrayScale Value:\r\n\t\tint grayscale = redWeighted + greenWeighted + blueWeighted;\r\n\r\n\t\t//Returns the GrayScale Value:\r\n\t\treturn grayscale;\r\n\t}",
"public static Mat rapidConvertRGBAToGRAY(Mat rgba) {\n Mat gray = new Mat(rgba.rows(), rgba.cols(), CvType.CV_8UC1);\n Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);\n return gray;\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"public static int MeanRGBtoGray(int r, int g, int b) {\n return (r + b + g) / 3;\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"private static int getGrayTranslucentRGB(int rgb) {\n\t\tint r = (0xff & rgb);\n\t\tint g = (0xff & (rgb >> 8));\n\t\tint b = (0xff & (rgb >> 16));\n\t\trgb = r + (g << 8) + (b << 16) + (100 << 24);\n\t\t// rgb = r + (g << 8) + (b << 16); // 亮一些\n\t\treturn rgb;\n\t}",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}",
"public GrayColor getColor(){\n return this.color;\n }",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public static int getGreyscale(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint avg = ((red + green + blue) / 3) & 0xff;\n\t\tint grey = (0xff << 24) + (avg << 16) + (avg << 8) + avg;\n\t\treturn grey;\n\t}",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public static double takeMaximumGrayLevel(BufferedImage image) {\n int maxLevel = (new Color(image.getRGB(0, 0))).getBlue();\n\n for (int i = 0; i < image.getWidth(); i ++) {\n for (int j = 0; j < image.getHeight(); j++) {\n int temp = (new Color(image.getRGB(i, j))).getBlue();\n if (maxLevel < temp) {\n maxLevel = temp;\n }\n }\n }\n\n return maxLevel;\n }",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public static int NTSCRGBtoGray(int r, int g, int b) {\n return (int) (0.2126 * r + 0.7152 * g + 0.0722 * b);\n }",
"public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"ImagePlus getRGBResultImage(double[] values,int width,int height){\r\n \t\tImagePlus tempImage = new ImagePlus(\"Visual results\");\r\n \t\ttempImage.setProcessor(new FloatProcessor(width,height,values));\r\n \t\tnew ImageConverter(tempImage).convertToRGB();\r\n \t\treturn tempImage;\r\n \t}",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public Image showChanelG(Image image) {\n MyGreenFilter filter = new MyGreenFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"public Color getColor() {\r\n return Color.GRAY;\r\n }",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"private static BufferedImage colorBird(final BufferedImage refImage,\n final Color color) {\n \n final BufferedImage image = new BufferedImage(BIRD_WIDTH,\n BIRD_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n \n final Color bright = color.brighter().brighter();\n final Color dark = color.darker().darker();\n \n for (int y = 0; y < BIRD_HEIGHT; ++y){\n for (int x = 0; x < BIRD_WIDTH; ++x) {\n int argb = refImage.getRGB(x, y);\n if (argb == 0xffe0802c)\n argb = dark.getRGB();\n else if (argb == 0xfffad78c)\n argb = bright.getRGB();\n else if (argb == 0xfff8b733)\n argb = color.getRGB();\n image.setRGB(x, y, argb);\n }\n } \n return image;\n }",
"public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"private void redGradient(BufferedImage myBufferedImage, ImageView myImage) {\n gradientPainter.setGradientColor(Color.RED);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"private void greenGradient(BufferedImage myBufferedImage,\n ImageView myImage) {\n gradientPainter.setGradientColor(Color.GREEN);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }",
"@LargeTest\n public void testIntrinsicsColorMatrixGrey() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX_GREY);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX_GREY.name());\n }",
"public int getRed(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int red = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n red = bdata[0] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n red = sdata[0]&0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n red = idata[0];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[0] != 8) {\n int shift = nBits[0] - 8;\n red = ((shift > 0) \n ? (red>>shift)\n : (red<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (red*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return red;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n // Not TYPE_GRAY or TYPE_RGB ColorSpace\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[0] * 255.0f);\n }",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"public Color getColor() {\n\t\treturn Color.GRAY;\n\t}",
"protected abstract float[] getRgbLut();",
"public static double getRGBColorDifference1(int color, int color2) {\r\n if (color == color2) {\r\n return 0;\r\n }\r\n Color c = new Color(color);\r\n Color c2 = new Color(color2);\r\n int dif0 = c.getRed() - c2.getRed();\r\n int dif1 = c.getGreen() - c2.getGreen();\r\n int dif2 = c.getBlue() - c2.getBlue();\r\n return Math.sqrt(dif0 * dif0 + dif1 * dif1 + dif2 * dif2);\r\n }",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public void setColor(GrayColor color){\n this.color = color;\n }"
] | [
"0.7709912",
"0.7704281",
"0.74312264",
"0.7373645",
"0.71113354",
"0.7035516",
"0.70208216",
"0.6999043",
"0.6955295",
"0.6948454",
"0.6866252",
"0.68562573",
"0.68146443",
"0.67250633",
"0.6686131",
"0.6668824",
"0.665042",
"0.66460884",
"0.66295666",
"0.66186017",
"0.6582022",
"0.63727796",
"0.6360609",
"0.6265028",
"0.62404716",
"0.6159109",
"0.6159109",
"0.6107941",
"0.60956943",
"0.60156757",
"0.59999454",
"0.5986672",
"0.5984495",
"0.5963831",
"0.58974886",
"0.5865233",
"0.58529156",
"0.5832745",
"0.5783061",
"0.5771789",
"0.5756243",
"0.57341766",
"0.5717287",
"0.5715186",
"0.5703444",
"0.5695777",
"0.5688831",
"0.5637789",
"0.562017",
"0.5609953",
"0.557456",
"0.5569415",
"0.55580586",
"0.5556206",
"0.55292886",
"0.55242103",
"0.55210775",
"0.5469319",
"0.546285",
"0.54173946",
"0.5375778",
"0.537227",
"0.5350268",
"0.5337257",
"0.53192896",
"0.5316765",
"0.53118956",
"0.52851194",
"0.5269478",
"0.5265418",
"0.5242526",
"0.5239088",
"0.52286446",
"0.5177397",
"0.5132328",
"0.5122557",
"0.51203287",
"0.5107302",
"0.51022446",
"0.5089563",
"0.50794524",
"0.50533116",
"0.5042326",
"0.5032887",
"0.5030364",
"0.5029072",
"0.50024325",
"0.5000514",
"0.49973512",
"0.49848488",
"0.4984756",
"0.49686545",
"0.49667472",
"0.4965055",
"0.4957671",
"0.49487272",
"0.4934022",
"0.49328974",
"0.4923526",
"0.49122575"
] | 0.73393655 | 4 |
Converts a RealColorImage to a RealGrayImage. Uses the following formula for calculation: gray value = (float)(red_value 0.299 + green_value 0.587 + blue_value 0.114) | public static RealGrayImage toRealGray(RealColorImage img)
throws ColorModelNotSupportedException, ColorModelUnknownException {
int X = img.X();
int Y = img.Y();
float[] color = new float[3];
float gray;
RealGrayImage newimg = null;
switch (img.getColorModel()) {
case ColorImage.RGB:
newimg = new RealGrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
color = img.get(x, y);
gray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;
newimg.set(x, y, gray);
}
}
break;
case ColorImage.CMY:
case ColorImage.YIQ:
case ColorImage.HSV:
case ColorImage.HLS:
throw new ColorModelNotSupportedException();
default:
throw new ColorModelUnknownException();
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"void greyscale();",
"void greyscale();",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static int getGray(int pixel)\n {\n /*\n // Extract r, g, b components of the hex value\n int r = (pixel >> 16) - 0xFFFFFF00;\n int g = (pixel >> 8) - (0xFFFF0000 | (r << 8));\n int b = (pixel) - (0xFF000000 | (r << 16) | (g << 8));\n\n // Get the max of the three components\n int gray = maxVal(maxVal(r, g), b);\n\n // Return a fully gray pixel\n return 0xFF000000 | (gray << 16) | (gray << 8) | gray;\n */\n return 0xFFFFFFFF;\n }",
"public abstract RGBFColor toRGBFColor();",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public static int MeanRGBtoGray(int r, int g, int b) {\n return (r + b + g) / 3;\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public native boolean isGrayImage() throws MagickException;",
"public static Mat rapidConvertRGBAToGRAY(Mat rgba) {\n Mat gray = new Mat(rgba.rows(), rgba.cols(), CvType.CV_8UC1);\n Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);\n return gray;\n }",
"public static int getGrayscale(int rgb[]) throws Exception {\r\n\t\t//Weights;\r\n\t\tdouble redWeight = 0.2126;\r\n\t\tdouble greenWeight = 0.7152;\r\n\t\tdouble blueWeight = 0.0722;\r\n\r\n\t\t//Multiplies the RGB by the Weights:\r\n\t\tint redWeighted = (int) (rgb[0] * redWeight);\r\n\t\tint greenWeighted = (int) (rgb[1] * greenWeight);\r\n\t\tint blueWeighted = (int) (rgb[2] * blueWeight);\r\n\r\n\t\t//Gets the GrayScale Value:\r\n\t\tint grayscale = redWeighted + greenWeighted + blueWeighted;\r\n\r\n\t\t//Returns the GrayScale Value:\r\n\t\treturn grayscale;\r\n\t}",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public abstract RGBIColor toRGBColor();",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static Bitmap ChangeGrey(Bitmap src, int depth, double red, double green, double blue) {\n int width = src.getWidth();\n int height = src.getHeight();\n Bitmap finalBitmap = Bitmap.createBitmap(width, height, src.getConfig());\n final double grayScale_Red = 0.3;\n final double grayScale_Green = 0.59;\n final double grayScale_Blue = 0.11;\n\n int channel_aplha, channel_red, channel_green, channel_blue;\n int pixel;\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n pixel = src.getPixel(x, y);\n channel_aplha = Color.alpha(pixel);\n channel_red = Color.red(pixel);\n channel_green = Color.green(pixel);\n channel_blue = Color.blue(pixel);\n channel_blue = channel_green = channel_red = (int) (grayScale_Red * channel_red + grayScale_Green * channel_green + grayScale_Blue * channel_blue);\n channel_red += (depth * red);\n\n if (channel_red > 255) {\n channel_red = 255;\n }\n channel_green += (depth * green);\n if (channel_green > 255) {\n channel_green = 255;\n }\n channel_blue += (depth * blue);\n if (channel_blue > 255) {\n channel_blue = 255;\n }\n finalBitmap.setPixel(x, y, Color.argb(channel_aplha, channel_red, channel_green, channel_blue));\n }\n }\n return finalBitmap;\n }",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"private static int getGrayTranslucentRGB(int rgb) {\n\t\tint r = (0xff & rgb);\n\t\tint g = (0xff & (rgb >> 8));\n\t\tint b = (0xff & (rgb >> 16));\n\t\trgb = r + (g << 8) + (b << 16) + (100 << 24);\n\t\t// rgb = r + (g << 8) + (b << 16); // 亮一些\n\t\treturn rgb;\n\t}",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public static int NTSCRGBtoGray(int r, int g, int b) {\n return (int) (0.2126 * r + 0.7152 * g + 0.0722 * b);\n }",
"public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static int getGreyscale(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint avg = ((red + green + blue) / 3) & 0xff;\n\t\tint grey = (0xff << 24) + (avg << 16) + (avg << 8) + avg;\n\t\treturn grey;\n\t}",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public GrayColor getColor(){\n return this.color;\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"ImagePlus getRGBResultImage(double[] values,int width,int height){\r\n \t\tImagePlus tempImage = new ImagePlus(\"Visual results\");\r\n \t\ttempImage.setProcessor(new FloatProcessor(width,height,values));\r\n \t\tnew ImageConverter(tempImage).convertToRGB();\r\n \t\treturn tempImage;\r\n \t}",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"private void toGray(Bitmap bmp) {\n int outH = bmp.getHeight();\n int outW = bmp.getWidth();\n\n int pixels[] = new int[outW*outH];\n bmp.getPixels(pixels, 0, outW, 0, 0, outW, outH);\n for (int i = 0; i < outW*outH; i++) {\n int gray = (int) (0.11 * Color.blue(pixels[i]) + 0.3 * Color.red(pixels[i]) + 0.59 * Color.green(pixels[i]));\n pixels[i] = Color.rgb(gray, gray, gray);\n }\n bmp.setPixels(pixels, 0, outW, 0, 0, outW, outH);\n }",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public static int[][] convertToGray(int w, int h, int[][] red, int[][] green,\r\n int[][] blue) {\r\n int [][]gray = new int [w][h];\r\n for( w = 0; w<gray.length;w++) {\r\n for (h = 0; h < gray[0].length; h++) {\r\n\r\n\r\n gray[w][h] =(int) ((0.2126 * red[w][h]) +( 0.7152 * green[w][h]) + (0.0722 * blue[w][h]) );\r\n //two for nested loops\r\n }\r\n }\r\n\r\n return gray;\r\n }",
"public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }",
"public ColorPlus binary() {\n\t\tint r = this.getRed();\n\t\tint g = this.getGreen();\n\t\tint b = this.getBlue();\n\t\t\n\t\tint cSum = r + g + b;\n\t\tif (cSum >= 382) {\n\t\t\tr = 0;\n\t\t\tg = 0;\n\t\t\tb = 0;\n\t\t}else{\n\t\t\tr = 255;\n\t\t\tg = 255;\n\t\t\tb = 255;\n\t\t}\n\t\treturn new ColorPlus(r,g,b); \n\t}",
"public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}",
"public static double takeMaximumGrayLevel(BufferedImage image) {\n int maxLevel = (new Color(image.getRGB(0, 0))).getBlue();\n\n for (int i = 0; i < image.getWidth(); i ++) {\n for (int j = 0; j < image.getHeight(); j++) {\n int temp = (new Color(image.getRGB(i, j))).getBlue();\n if (maxLevel < temp) {\n maxLevel = temp;\n }\n }\n }\n\n return maxLevel;\n }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"public Color getColor() {\r\n return Color.GRAY;\r\n }",
"protected abstract float[] getRgbLut();",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"@LargeTest\n public void testIntrinsicsColorMatrixGrey() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX_GREY);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX_GREY.name());\n }",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"public void grayscale(int start, int end)\n {\n Pixel[] originPixel = this.getPixels();\n int colorIntensity =0;\n //loop through all pixels in the calling object and parameter \n for(int index=start;index<=end;index++){\n colorIntensity = (int) ((originPixel[index].getRed() + originPixel[index].getGreen() \n +originPixel[index].getBlue()) / 3);\n originPixel[index].setGreen(colorIntensity);\n originPixel[index].setBlue(colorIntensity);\n originPixel[index].setRed(colorIntensity); \n }\n \n }",
"public Image showChanelG(Image image) {\n MyGreenFilter filter = new MyGreenFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n }",
"private Color pixelColor(int i, int j, int res) {\r\n\t\tCamera camera = _scene.get_camera();\r\n\t\tColor background = _scene.get_background();\r\n\t\tdouble distance = _scene.get_screenDistance();\r\n\t\tdouble width = _imageWriter.getWidth();\r\n\t\tdouble height = _imageWriter.getHeight();\r\n\r\n\t\tint nX = _imageWriter.getNx();\r\n\t\tint nY = _imageWriter.getNy();\r\n\r\n\t\tRay ray = camera.constructRayThroughPixel((int) (nX * res), (int) (nY * res), j, i, distance, width, height);\r\n\t\tGeoPoint closestPoint = findClosestIntersection(ray);\r\n\t\tif (closestPoint == null)\r\n\t\t\treturn background;\r\n\r\n\t\telse\r\n\t\t\treturn calcColor(closestPoint, ray);\r\n\r\n\t}",
"public void toGreen(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }",
"public Color getColor() {\n\t\treturn Color.GRAY;\n\t}",
"@Test\n public void testChangeGrey() {\n System.out.println(\"changeGrey\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.changeGrey();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static BufferedImage convertG16ToRGB24(BufferedImage source) {\n int width = source.getWidth();\n int height = source.getHeight();\n BufferedImage retVal = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\n Raster raster = source.getData();\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n int original = raster.getSample(x, y, 0);\n //fixed addition of 1000m to get out of negative numbers everywhere\n //multiply by 100 to get the value in centimeters\n //this should comfortably fit in 24 bits considering lowest point\n //-418m and highest point 8800m give or take.\n //four bit left shift is for better visual representation of small\n //values (now they are represented with higher values of blue and\n //green)\n int replacement = ((original + 1000) * 100) << 4;\n\n retVal.setRGB(x, y, replacement);\n }\n }\n\n return retVal;\n }",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }"
] | [
"0.7814668",
"0.76929283",
"0.73927426",
"0.7256043",
"0.72291297",
"0.7167337",
"0.71040857",
"0.70874286",
"0.7049825",
"0.6953926",
"0.6906445",
"0.6888231",
"0.6834258",
"0.67770886",
"0.6767142",
"0.67378",
"0.6721685",
"0.65925103",
"0.647083",
"0.64458543",
"0.6372732",
"0.6353002",
"0.6341006",
"0.62993276",
"0.62353426",
"0.61952245",
"0.61952245",
"0.6159718",
"0.61074626",
"0.6087657",
"0.5956294",
"0.5955578",
"0.5903677",
"0.5863552",
"0.5855695",
"0.58516",
"0.58085626",
"0.5783571",
"0.57675505",
"0.57583934",
"0.5752745",
"0.5735732",
"0.57180136",
"0.5705286",
"0.5688369",
"0.56583357",
"0.56449926",
"0.5644255",
"0.56228",
"0.56048775",
"0.5599694",
"0.55881506",
"0.5551159",
"0.5501695",
"0.54820794",
"0.5435744",
"0.5423853",
"0.5411269",
"0.53976625",
"0.53202254",
"0.5305856",
"0.529537",
"0.52660567",
"0.52505416",
"0.5241101",
"0.5238901",
"0.523435",
"0.52189034",
"0.5213021",
"0.52075875",
"0.52047205",
"0.51874274",
"0.5178938",
"0.5176111",
"0.5107824",
"0.50994253",
"0.5084252",
"0.505545",
"0.5052061",
"0.5033261",
"0.49974233",
"0.4995876",
"0.4995224",
"0.49934435",
"0.49683622",
"0.49188542",
"0.49175143",
"0.49125496",
"0.48975354",
"0.48971716",
"0.4886077",
"0.48691958",
"0.4857194",
"0.48561433",
"0.4798957",
"0.479768",
"0.47930658",
"0.47890112",
"0.47871518",
"0.47837216"
] | 0.7482005 | 2 |
Converts a ComplexImage to a RealGrayImage | public static RealGrayImage toRealGray(ComplexImage img) {
int X = img.X();
int Y = img.Y();
RealGrayImage newimg = null;
newimg = new RealGrayImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
newimg.set(x, y, img.getReal(x, y));
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"void greyscale();",
"void greyscale();",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public void setGrayscale() throws MagickException {\n\t\tQuantizeInfo quantizeInfo = new QuantizeInfo();\n\t\tquantizeInfo.setColorspace(ColorspaceType.GRAYColorspace);\n\t\tquantizeInfo.setNumberColors(256);\n\t\tquantizeInfo.setTreeDepth(8);\n\t\tquantizeImage(quantizeInfo);\n\t}",
"public native boolean isGrayImage() throws MagickException;",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static ComplexNumber fromImaginary(double imaginary) {\n\t\treturn new ComplexNumber(0, imaginary);\n\t}",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public Complex(float real, float imag) {\n this.re = real;\n this.im = imag;\n }",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"Complex(double r, double i) {\n real = r;\n imag = i;\n }",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public boolean getOutput8BitGray() {\n/* 139 */ return this.output8BitGray;\n/* */ }",
"public ComplexNumber(double re, double im) {\n\t\treal = re;\n\t\timag = im;\n\t}",
"Complex() {\n real = 0.0;\n imag = 0.0;\n }",
"public ComplexNumber(double real, double imaginary) {\n this.real = real;\n this.imaginary = imaginary;\n }",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void getVal(Complex c) {\n\t\tc.re =re;\n\t\tc.im = im;\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public Complex(double real, double imaginary) {\n r = real;\n i = imaginary;\n }",
"public ComplexNumber(double real, double imaginary) {\n\t\tsuper();\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public Image showGray(Image image) {\n\n MyGrayFilter filter = new MyGrayFilter();\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(new FilteredImageSource(image\n .getSource(), filter));\n return img;\n\n }",
"public Complex(double real, double imaginary) {\r\n this.real = real;\r\n this.imaginary = imaginary;\r\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"private RealMatrix retrieveImageIntensities(String filename) {\n\t\tBufferedImage img = null;\n\t\tdouble matrixData[][] = null; \n\t\ttry {\n\t\t\t\n\t\t\t// Read in the image.\n\t\t\timg = ImageIO.read(new File(filename));\n\t\t\tmatrixData = new double[img.getWidth()][img.getHeight()];\n\n\t\t\t// Transform the image into a grayscale image.\n\t\t\tRaster raster = img.getData();\n\t\t\tfor (int i=0; i < img.getWidth(); i++) {\n\t\t\t\tfor (int j=0; j < img.getHeight(); j++) {\n\t\t\t\t\tint gray = raster.getPixel(i, j, new int[raster.getNumBands()])[0];\n\t\t\t\t\tdouble convertedGray = (double) gray / 255;\n\t\t\t\t\tif (convertedGray > 255) {\n\t\t\t\t\t\tSystem.out.println(\"wrong2\");\n\t\t\t\t\t}\n\t\t\t\t\tmatrixData[i][j] = convertedGray;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error reading \" + filename);\n\t\t}\n\t\treturn MatrixUtils.createRealMatrix(matrixData);\n\t}",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public static BufferedImage Mat2BufferedImage(Mat m) {\n\n int type = BufferedImage.TYPE_BYTE_GRAY;\n if (m.channels() > 1) {\n type = BufferedImage.TYPE_3BYTE_BGR;\n }\n int bufferSize = m.channels() * m.cols() * m.rows();\n byte[] b = new byte[bufferSize];\n m.get(0, 0, b); // get all the pixels\n BufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n System.arraycopy(b, 0, targetPixels, 0, b.length);\n return image;\n }",
"public void setOutput8BitGray(boolean output8BitGray) {\n/* 158 */ this.output8BitGray = output8BitGray;\n/* */ }",
"public BufferedImage rescaleImage(BufferedImage image, float scale) {\r\n int[][][] arr = convertToArray(image);\r\n return convertToBimage(rescaleImage(arr, scale));//return array\r\n }",
"public Complex(double real, double imaginary) {\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"boolean equals (ComplexNum c) //compares two complex numbers and produces\n {\n\tif (c.real == real && im == c.im)\n\t return true;\n\treturn false;\n }",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"public ComplexNumber(double re, double im) {\r\n this.re = re;\r\n this.im = im;\r\n }",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public void mul(Complex c){\n\t\tdouble tempRe = re*c.getRe() - im*c.getIm();\n\t\tim = im*c.getRe() + re*c.getIm();\n\t\tre = tempRe;\n\t}",
"public static Image aplicarLienzoAoriginal(Image imagenOriginal, int nxn) {\n BufferedImage biNegro = new BufferedImage(nxn, nxn, BufferedImage.TYPE_INT_RGB);\r\n for (int n = 0; n < biNegro.getHeight(); n++) {\r\n for (int n1 = 0; n1 < biNegro.getWidth(); n1++) {\r\n Color color = new Color(0, 0, 0);\r\n biNegro.setRGB(n, n, color.getRGB());\r\n }\r\n }\r\n\r\n BufferedImage bi = herramientas.HerramientasImagen.toBufferedImage(imagenOriginal);\r\n Color color;\r\n\r\n int x, y, aux;\r\n for (y = 0; y < bi.getHeight(); y++) {\r\n for (x = 0; x < bi.getWidth(); x++) {\r\n color = new Color(bi.getRGB(x, y));\r\n\r\n try {\r\n biNegro.setRGB(x, y, color.getRGB());\r\n } catch (Exception e) {\r\n }\r\n\r\n }\r\n }\r\n return herramientas.HerramientasImagen.toImage(biNegro);\r\n\r\n }",
"public native MagickImage enhanceImage() throws MagickException;",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public ComplexNumber(ComplexNumber cn) {\n\t\treal = cn.getReal();\n\t\timag = cn.getImag();\n\t}",
"public double getImaginary() {\r\n return imaginary;\r\n }",
"public int[][][] rescaleImage(int[][][] image, float scale) {\r\n int height = image[0].length;\r\n int width = image.length;\r\n BufferedImage result = new BufferedImage(width, height, 1);\r\n //loop through all pixels.\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n int a = image[x][y][0];\r\n int r = image[x][y][1];\r\n int g = image[x][y][2];\r\n int b = image[x][y][3];\r\n\r\n r = (int) (r * scale);\r\n g = (int) (g * scale);\r\n b = (int) (b * scale);\r\n\r\n image[x][y][0] = a;\r\n image[x][y][1] = r;\r\n image[x][y][2] = g;\r\n image[x][y][3] = b;\r\n }\r\n }\r\n return image; //return array\r\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public static Mat invert(JPEGCategory[] input) {\n\t\tdouble[] data = new double[64];\n\t\tint k = 0;\n\t\t\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tdouble[] subArr = convertToDouble(input[i]);\n\t\t\tfor (int j = 0; j < subArr.length; j++) {\n\t\t\t\tdata[k] = subArr[j];\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble[] newData = { \n\t\t\t data[0], data[1], data[5], data[6], data[14], data[15], data[27], data[28], \n\t\t\t data[2], data[4], data[7], data[13], data[16], data[26], data[29], data[42], \n\t\t\t data[3], data[8], data[12], data[17], data[25], data[30], data[41], data[43], \n\t\t\t data[9], data[11], data[18], data[24], data[31], data[40], data[44], data[53], \n\t\t\tdata[10], data[19], data[23], data[32], data[39], data[45], data[52], data[54], \n\t\t\tdata[20], data[22], data[33], data[38], data[46], data[51], data[55], data[60], \n\t\t\tdata[21], data[34], data[37], data[47], data[50], data[56], data[59], data[61], \n\t\t\tdata[35], data[36], data[48], data[49], data[57], data[58], data[62], data[63] \n\t\t};\n\n\t\tMat result = new Mat(8, 8, CvType.CV_64FC1);\n\t\tresult.put(0, 0, newData);\n\t\treturn result;\n\t}",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"public static int binaryToGray(int num) { return (num >>> 1) ^ num; }",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"@Test\n public void testGrayFilter() {\n System.out.println(\"grayFilter\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.grayFilter();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public double getImaginary() {\n\t\treturn imaginary;\n\t}",
"public double getImaginary() {\n\t\treturn imaginary;\n\t}",
"public void set( int row, int col, double real, double imaginary ) {\n if (imaginary == 0) {\n set(row, col, real);\n } else {\n ops.set(mat, row, col, real, imaginary);\n }\n }",
"public double getImag() {return this.imag;}",
"private Image bitmap2JPEG(Bitmap bit) {\n\n Image baseImage = new Image();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bit.compress(Bitmap.CompressFormat.JPEG, 90, stream);\n byte[] imageBytes = stream.toByteArray();\n baseImage.encodeContent(imageBytes);\n\n return baseImage;\n }",
"@SuppressWarnings( \"unchecked\" )\n\t@Test\n\tpublic void testMatToImgConversion() throws IOException {\n\t\tMat mat = imread( input, opencv_imgcodecs.IMREAD_GRAYSCALE );\n\t\tif ( mat.empty() )\n\t\t\tfail( \"Couldn't load image: \" + input );\n\t\tRandomAccessibleInterval< ByteType > convertedMat = ( RandomAccessibleInterval< ByteType > ) new MatToImgConverter().convert( mat, RandomAccessibleInterval.class );\n\t\tsaveImg( convertedMat, mat2img );\n\n\t\t//Read image with ImageJ\n\t\tDataset dataset = getScifio().datasetIO().open( input );\n\t\tRandomAccessibleInterval< ByteType > ijImage =\n\t\t\t\tRealTypeConverters.convert( ( RandomAccessibleInterval< ? extends RealType< ? > > ) dataset.getImgPlus().getImg(), new ByteType() );\n\n\t\t//Compare data\n\t\tcheckData( convertedMat, ijImage );\n\t}",
"public static ComplexNumber fromReal(double real) {\n\t\treturn new ComplexNumber(real, 0);\n\t}",
"BufferedImage outputImage();",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"public abstract BufferedImage transform();"
] | [
"0.79037625",
"0.7712259",
"0.7592379",
"0.72216266",
"0.7168589",
"0.7087834",
"0.70038635",
"0.6962647",
"0.69107574",
"0.68958676",
"0.68369544",
"0.67314005",
"0.6659708",
"0.6589824",
"0.64811033",
"0.6459463",
"0.6396026",
"0.6340708",
"0.62805265",
"0.6279558",
"0.6156325",
"0.60966754",
"0.5930056",
"0.5907777",
"0.5907777",
"0.584905",
"0.5827069",
"0.5764981",
"0.5741361",
"0.5632465",
"0.55400884",
"0.5539151",
"0.5511068",
"0.54584587",
"0.5443504",
"0.54166335",
"0.5395287",
"0.52721626",
"0.52446413",
"0.5237272",
"0.521677",
"0.5190331",
"0.51441365",
"0.51281106",
"0.508024",
"0.50648844",
"0.50285435",
"0.50233245",
"0.4977108",
"0.49613327",
"0.49578524",
"0.49578494",
"0.49534273",
"0.49455997",
"0.49375466",
"0.49256125",
"0.4923293",
"0.49190295",
"0.49078342",
"0.490423",
"0.4902318",
"0.4900532",
"0.48760384",
"0.48715937",
"0.48607203",
"0.48580647",
"0.48395762",
"0.48360232",
"0.48266253",
"0.4820248",
"0.48122543",
"0.48036382",
"0.47900593",
"0.47725537",
"0.4771429",
"0.47510839",
"0.47506854",
"0.4736904",
"0.47317433",
"0.47310922",
"0.4727073",
"0.4717092",
"0.4703049",
"0.4701793",
"0.47016433",
"0.4691386",
"0.4684786",
"0.4681832",
"0.46734062",
"0.46734062",
"0.4662036",
"0.46421847",
"0.46387425",
"0.46326134",
"0.4610883",
"0.46104106",
"0.46059322",
"0.45966274",
"0.45950308",
"0.45777538"
] | 0.8677705 | 0 |
Converts a GrayImage to a ColorImage. Each plane of the color image has the same value in every pixel. | public static ColorImage toColor(GrayImage img) {
int X = img.X();
int Y = img.Y();
int[] color = new int[3];
int gray;
ColorImage newimg = new ColorImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
gray = img.get(x, y);
color[0] = gray;
color[1] = gray;
color[2] = gray;
newimg.set(x, y, color);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public void createColorArray(Pixel[][] originalImage, int row, int column) {\n int index = 0;\n\n for (int i = -1; i < 2; i++) {\n for (int k = -1; k < 2; k++) {\n colorArray[index] = originalImage[row + i][column + k];\n index++;\n }\n }\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private native int grayToRgb(byte src[],int dst[]);",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"void greyscale();",
"void greyscale();",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"public GrayColor getColor(){\n return this.color;\n }",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private void recompose(int[][] array,int[][] red,int[][] green,int[][] blue){\n\t\tfor(int i=0;i<array.length;i++){\n\t\t\tfor(int j=0;j<array[0].length;j++){\n\t\t\t\tarray[i][j]=GImage.createRGBPixel(red[i][j],green[i][j],blue[i][j]);\n\t\t\t}\n\t\t}\n\t\t//Your code ends here\n\t}",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public abstract RGBIColor toRGBColor();",
"public abstract RGBFColor toRGBFColor();",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private List<int[]> separateColorChannels(RGBImage image) {\n\t\tList<int[]> outList = new ArrayList<int[]>(3);\n\t\tint[] data = (int[]) image.getValue();\n\t\tint[] rch = new int[data.length];\n\t\tint[] gch = new int[data.length];\n\t\tint[] bch = new int[data.length];\n\t\tfor (int i = 0; i < data.length && start; i++) {\n\t\t\trch[i] = (data[i] >> 16) & MASK;\n\t\t\tgch[i] = (data[i] >> 8) & MASK;\n\t\t\tbch[i] = data[i] & MASK;\n\t\t}\n\t\toutList.add(0, rch);\n\t\toutList.add(1, gch);\n\t\toutList.add(2, bch);\n\t\treturn outList;\n\t}",
"private static double [][][] convertToArray1(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n double [][][] result = new double [width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }",
"public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"Compress(double[][][] Image){\n \n /** Step 1 */\n R1 = new Reduce(Image);\n A1 = R1.Nearest(2);\n // A1 = R1.Bilinear(2);\n \n /** Step 2 */ \n R2 = new Reduce(A1);\n A2 = R2.Nearest(2);\n //A2 = R2.Bilinear(2);\n \n /** Step 3 */\n R3 = new Reduce(A2);\n A3 = R3.Nearest(2);\n //A3 = R3.Bilinear(2);\n \n /** Step 4 */\n R4 = new Reduce(A3);\n A4 = R4.Nearest(2);\n //A4 = R4.Bilinear(2);\n\n }",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"public static Integer[][] preformRGBConvolution(Integer[][][] img, Double[][] filter) {\n Integer[][] r = operationConvolution(img[0], filter);\n Integer[][] g = operationConvolution(img[1], filter);\n Integer[][] b = operationConvolution(img[2], filter);\n Integer[][] output = new Integer[r.length][r[0].length];\n for (int y = 0; y < output.length; y++) {\n for (int x = 0; x < output[0].length; x++) {\n output[y][x] = r[y][x] + g[y][x] + b[y][x];\n }\n }\n return output;\n }",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static Image Transform1ColorToTransparency2ToColors(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor1,\n\t\t\tfinal Color c5, final Color c6, final int otherColor2){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\t\tfinal int r5 = c5.getRed();\n\t\tfinal int g5 = c5.getGreen();\n\t\tfinal int b5 = c5.getBlue();\n\t\tfinal int r6 = c6.getRed();\n\t\tfinal int g6 = c6.getGreen();\n\t\tfinal int b6 = c6.getBlue();\n\n\t\tfinal ImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor1;\n\t\t}\n\t\tif (r >= r5 && r <= r6 &&\n\t\t\t\tg >= g5 && g <= g6 &&\n\t\t\t\tb >= b5 && b <= b6){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor2;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public native void cycleColormapImage(int amount) throws MagickException;",
"public native PixelPacket[] getColormap() throws MagickException;",
"private static int[][][] convertToArray(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n int[][][] result = new int[width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }",
"public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public static Integer[][] preformRGBConvolution(Integer[][][] img, Double[][][] filter) {\n Integer[][] r = operationConvolution(img[0], filter[0]);\n Integer[][] g = operationConvolution(img[1], filter[1]);\n Integer[][] b = operationConvolution(img[2], filter[2]);\n Integer[][] output = new Integer[r.length][r[0].length];\n for (int y = 0; y < output.length; y++) {\n for (int x = 0; x < output[0].length; x++) {\n output[y][x] = r[y][x] + g[y][x] + b[y][x];\n }\n }\n return output;\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Integer[][][] getRGBMatrixFromImage(BufferedImage img) {\n int w = img.getWidth();\n int h = img.getHeight();\n Integer[][][] data = new Integer[3][h][w];\n for (int y = 0; y < h; y++) {\n for (int x = 0; x < w; x++) {\n Color c = new Color(img.getRGB(x, y));\n data[0][y][x] = c.getRed();\n data[1][y][x] = c.getGreen();\n data[2][y][x] = c.getBlue();\n }\n }\n return data;\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"@LargeTest\n public void testIntrinsicsColorMatrixGrey() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX_GREY);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX_GREY.name());\n }",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"public void apply(OFImage image)\n {\n int height = image.getHeight();\n int width = image.getWidth();\n OFImage original = new OFImage(image);\n \n for(int y = 0; y < height; y++) {\n for(int x = 0; x < width; x++) {\n Color currentPixel = original.getPixel(x,y);\n int grn,blu,red;\n grn = 255 - currentPixel.getGreen();\n red = 255 - currentPixel.getRed();\n blu = 255 - currentPixel.getBlue();\n image.setPixel(x, y, new Color(red,blu,grn));\n }\n }\n }",
"public static WritableImage copyImage(Image image) {\n int height=(int)image.getHeight();\n int width=(int)image.getWidth();\n PixelReader pixelReader=image.getPixelReader();\n WritableImage writableImage = new WritableImage(width,height);\n PixelWriter pixelWriter = writableImage.getPixelWriter();\n\n for (int y = 0; y < height; y++){\n for (int x = 0; x < width; x++){\n Color color = pixelReader.getColor(x, y);\n pixelWriter.setColor(x, y, color);\n }\n }\n return writableImage;\n }",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"private void decomposeColors(int[][] array,int[][] red,int[][] green,int[][] blue){\n\t\tfor(int i=0;i<array.length;i++){\n\t\t\tfor(int j=0;j<array[0].length;j++){\n\t\t\t\tint pixel = array[i][j];\n\t\t\t\tred[i][j] = GImage.getRed(pixel);\n\t\t\t\tgreen[i][j] = GImage.getGreen(pixel);\n\t\t\t\tblue[i][j] = GImage.getBlue(pixel);\n\t\t\t}\n\t\t}\n\t\t//Your code ends here\n\t}",
"Picture colourComponentImage() throws Exception;",
"private static int getMainColor(BufferedImage image)\n {\n // Counts how many time each colors appear\n ColorOccurence co[] = new ColorOccurence[10000];\n\n // For every pixel of the image\n for(int x = 0; x < image.getWidth(null) / 2; x++)\n {\n for(int y = 0; y < image.getHeight(null) / 2; y++)\n {\n // Get the pixel\n int pixel = image.getRGB(x, y);\n\n // Parse every element initialized of the array\n for(int i = 0; i < 10000; i++)\n {\n // If the element is null, a new color has been found\n if(co[i] == null)\n {\n // Creates a new color and sets its occurence to 1\n co[i] = new ColorOccurence(pixel, 1);\n break;\n }\n\n // If the color is already is already in the array, add one\n if(co[i].color == pixel){\n co[i].occurence += 1;\n break;\n }\n }\n }\n }\n\n // Maximum number of occurence\n int max = 0;\n\n // The color that appeared the most so far\n int maxVal = 0;\n\n // For every color\n for(ColorOccurence c : co)\n {\n // If null, the whole array has been parsed\n if(c == null)\n {\n break;\n }\n\n // If this color occurs more times than the previous most appearing\n // color, set it as the new most appearing color\n if(c.occurence > max)\n {\n max = c.occurence;\n maxVal = c.color;\n }\n }\n return maxVal;\n }",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public Pic invert() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n current.setRed(255 - current.getRed());\n current.setGreen(255 - current.getGreen());\n current.setBlue(255 - current.getBlue());\n }\n }\n return output;\n }",
"@Override\n public native Color getPixelColor(int x, int y);",
"public static int[] getPixelColor(BufferedImage image,int x,int y) {\n int colors[] = new int[3];\n int clr = 0;\n\n try{\n clr = image.getRGB(x,y); \n }catch(Exception e){\n System.out.println(e);\n System.out.println(x + \" \" + y);\n }\n\n int red = (clr & 0x00ff0000) >> 16;\n int green = (clr & 0x0000ff00) >> 8;\n int blue = clr & 0x000000ff;\n colors[0] = red;\n colors[1] = green;\n colors[2] = blue;\n return colors;\n }",
"public final BufferedImage convolute(BufferedImage image) {\n\t\tint blockLength = 2 * radius + 1;\n\n\t\tif (image.getWidth() < blockLength || image.getHeight() < blockLength)\n\t\t\tthrow new IllegalArgumentException(\"Image is too small to apply this convolution filter\");\n\n\t\tint width = image.getWidth();\n\t\tint height = image.getHeight();\n\n\t\tint newWidth = width - blockLength;\n\t\tint newHeight = height - blockLength;\n\t\t\n\t\tBufferedImage results = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_RGB);\n\n\t\tfor (int x = 0; x < newWidth; x++) {\n\t\t\tfor (int y = 0; y < newHeight; y++) {\n\t\t\t\tint[] rgb = image.getRGB(x, y, blockLength, blockLength, null, 0, blockLength);\n\t\t\t\tint[] r = new int[rgb.length];\n\t\t\t\tint[] g = new int[rgb.length];\n\t\t\t\tint[] b = new int[rgb.length];\n\t\t\t\tfor (int i = 0; i < rgb.length; i++) {\n\t\t\t\t\tr[i] = (rgb[i] & 0xFF0000) / 0x10000;\n\t\t\t\t\tg[i] = (rgb[i] & 0x00FF00) / 0x100;\n\t\t\t\t\tb[i] = rgb[i] & 0x0000FF;\n\t\t\t\t}\n\t\t\t\tint[] filtered = applier.apply(r, g, b);\n\t\t\t\tint rgbi = filtered[0] * 0x10000 + filtered[1] * 0x100 + filtered[2];\n\t\t\t\tresults.setRGB(x, y, rgbi);\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t}",
"public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"protected ColorSpace getImageColorSpace() {\n return this.image.getColorSpace();\n }",
"public static BufferedImage toImage(VImage vImage) {\n BufferedImage image = new BufferedImage(vImage.getWidth(), vImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n System.arraycopy(vImage.getData(), 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0,\n vImage.getWidth() * vImage.getHeight() * 3);\n return image;\n }",
"public ColourAutoCorrelogram(BufferedImage image) {\r\n\t\timageRaster = image.getData();\r\n\t\tdistanceSet = new int[]{1,3,5,7};\r\n\t}",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public HTColorImage(BufferedImage bImage)\n\t{\n\t\tif (bImage == null)\n\t\t{\n\t\t\tthrow new HTException(\"Image is null\");\n\t\t}\t\n\t\timg = HTUtil.getCopy(bImage);\n\t}"
] | [
"0.7498243",
"0.70117486",
"0.6872367",
"0.674546",
"0.6739472",
"0.67118424",
"0.6358699",
"0.6322501",
"0.62557334",
"0.613397",
"0.61126256",
"0.5997728",
"0.5996459",
"0.59436554",
"0.5890316",
"0.58525294",
"0.5820113",
"0.581861",
"0.5698821",
"0.56968236",
"0.563243",
"0.56113255",
"0.5582699",
"0.5572282",
"0.55685914",
"0.55458266",
"0.55454296",
"0.55454296",
"0.55116135",
"0.55099064",
"0.54151577",
"0.539996",
"0.53827804",
"0.5380226",
"0.5354635",
"0.5315614",
"0.5310007",
"0.5306451",
"0.5301968",
"0.52699953",
"0.52617073",
"0.525729",
"0.52518934",
"0.52437353",
"0.52389604",
"0.52346605",
"0.5226132",
"0.521728",
"0.52089095",
"0.5197143",
"0.51960653",
"0.5182019",
"0.5168276",
"0.5162802",
"0.5132078",
"0.51287776",
"0.51236296",
"0.5120134",
"0.51093894",
"0.51083136",
"0.5103676",
"0.5088102",
"0.5073885",
"0.5065724",
"0.5056318",
"0.5045371",
"0.5045241",
"0.5044093",
"0.50344723",
"0.500745",
"0.49938563",
"0.49923748",
"0.49865043",
"0.49862754",
"0.49842992",
"0.4982305",
"0.49767783",
"0.4972913",
"0.49646804",
"0.49567452",
"0.49566057",
"0.49474606",
"0.49416798",
"0.4922385",
"0.49092558",
"0.49061137",
"0.49045846",
"0.4899727",
"0.4899408",
"0.489755",
"0.48851353",
"0.4867153",
"0.48553726",
"0.48411322",
"0.48389825",
"0.48341677",
"0.4833883",
"0.4817985",
"0.48146573",
"0.48048198"
] | 0.76650804 | 0 |
Converts a RealGrayImage to a ColorImage. Each plane of the color image has the same value in every pixel. | public static ColorImage toColor(RealGrayImage img) {
int X = img.X();
int Y = img.Y();
int[] color = new int[3];
float gray;
ColorImage newimg = new ColorImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
gray = img.get(x, y);
color[0] = (int) gray;
color[1] = (int) gray;
color[2] = (int) gray;
newimg.set(x, y, color);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public abstract RGBFColor toRGBFColor();",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"void greyscale();",
"void greyscale();",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public abstract RGBIColor toRGBColor();",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void createColorArray(Pixel[][] originalImage, int row, int column) {\n int index = 0;\n\n for (int i = -1; i < 2; i++) {\n for (int k = -1; k < 2; k++) {\n colorArray[index] = originalImage[row + i][column + k];\n index++;\n }\n }\n }",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"private Color pixelColor(int i, int j, int res) {\r\n\t\tCamera camera = _scene.get_camera();\r\n\t\tColor background = _scene.get_background();\r\n\t\tdouble distance = _scene.get_screenDistance();\r\n\t\tdouble width = _imageWriter.getWidth();\r\n\t\tdouble height = _imageWriter.getHeight();\r\n\r\n\t\tint nX = _imageWriter.getNx();\r\n\t\tint nY = _imageWriter.getNy();\r\n\r\n\t\tRay ray = camera.constructRayThroughPixel((int) (nX * res), (int) (nY * res), j, i, distance, width, height);\r\n\t\tGeoPoint closestPoint = findClosestIntersection(ray);\r\n\t\tif (closestPoint == null)\r\n\t\t\treturn background;\r\n\r\n\t\telse\r\n\t\t\treturn calcColor(closestPoint, ray);\r\n\r\n\t}",
"public static Integer[][] preformRGBConvolution(Integer[][][] img, Double[][] filter) {\n Integer[][] r = operationConvolution(img[0], filter);\n Integer[][] g = operationConvolution(img[1], filter);\n Integer[][] b = operationConvolution(img[2], filter);\n Integer[][] output = new Integer[r.length][r[0].length];\n for (int y = 0; y < output.length; y++) {\n for (int x = 0; x < output[0].length; x++) {\n output[y][x] = r[y][x] + g[y][x] + b[y][x];\n }\n }\n return output;\n }",
"public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"public static Integer[][] preformRGBConvolution(Integer[][][] img, Double[][][] filter) {\n Integer[][] r = operationConvolution(img[0], filter[0]);\n Integer[][] g = operationConvolution(img[1], filter[1]);\n Integer[][] b = operationConvolution(img[2], filter[2]);\n Integer[][] output = new Integer[r.length][r[0].length];\n for (int y = 0; y < output.length; y++) {\n for (int x = 0; x < output[0].length; x++) {\n output[y][x] = r[y][x] + g[y][x] + b[y][x];\n }\n }\n return output;\n }",
"@LargeTest\n public void testIntrinsicsColorMatrixGrey() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX_GREY);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX_GREY.name());\n }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"private double[][] normalize255(RealMatrix realMatrix) {\n\t\tdouble[][] input = realMatrix.getData();\n\t\tdouble[][] normalized = new double[realMatrix.getRowDimension()][realMatrix.getColumnDimension()];\n\t\tdouble minimum = 99999.99;\n\t\tdouble maximum = -9999.99;\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tminimum = Math.min(minimum, input[i][j]);\n\t\t\t\tmaximum = Math.max(maximum, input[i][j]);\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tnormalized[i][j] = ((input[i][j] - minimum)*(255/(maximum-minimum)));\n\t\t\t}\n\t\t}\n\t\treturn normalized;\n\t}",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public static <R extends RealType<R>> Img<R> vectorToImage(final RealVector ar, final R type, final int numDims,\n final ImgFactory<R> fac) {\n final long[] dims = new long[numDims];\n\n for (int i = 0; i < (dims.length - 1); i++) {\n dims[i] = 1;\n }\n dims[dims.length - 1] = ar.getDimension();\n final Img<R> res = fac.create(dims, type);\n final Cursor<R> c = res.cursor();\n while (c.hasNext()) {\n c.fwd();\n c.get().setReal(ar.getEntry(c.getIntPosition(numDims - 1)));\n }\n\n return res;\n }",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public ColourAutoCorrelogram(BufferedImage image) {\r\n\t\timageRaster = image.getData();\r\n\t\tdistanceSet = new int[]{1,3,5,7};\r\n\t}",
"public GrayColor getColor(){\n return this.color;\n }",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"private static double [][][] convertToArray1(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n double [][][] result = new double [width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }",
"public static Integer[][][] getRGBMatrixFromImage(BufferedImage img) {\n int w = img.getWidth();\n int h = img.getHeight();\n Integer[][][] data = new Integer[3][h][w];\n for (int y = 0; y < h; y++) {\n for (int x = 0; x < w; x++) {\n Color c = new Color(img.getRGB(x, y));\n data[0][y][x] = c.getRed();\n data[1][y][x] = c.getGreen();\n data[2][y][x] = c.getBlue();\n }\n }\n return data;\n }",
"public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}",
"public void codifRLC()\n\t{\n\t\tList<Integer> result= new ArrayList<Integer>();\n\t\tint rgb=0;\n\t\tColor color;\n\t\tint r=0;\n\t\tint ant=-1;\n\t\tint acum=0;\n\t\tfor(int i=this.inicalto;i<=this.alto;i++) {\n\t\t\tfor(int j=this.inicancho;j<=this.ancho;j++)\n\t\t\t{\n\t\t\t\trgb = this.img.getRGB(j, i);\n\t\t\t\tcolor = new Color(rgb, true);\n\t\t\t\tr = color.getRed();\n\t\t\t\t\tif(ant==-1) {\n\t\t\t\t\t\tant=r;\n\t\t\t\t\t\tacum=1;\n\t\t\t\t\t}\n\t\t\t\t\t\tif(r==ant && acum<256)\n\t\t\t\t\t\t\tacum++;\n\t\t\t\t\t\t\tif(r!=ant){\n\t\t\t\t\t\t\t\tresult.add(ant);\n\t\t\t\t\t\t\t\tresult.add(acum);\n\t\t\t\t\t\t\t\tacum=1;\n\t\t\t\t\t\t\t\tant=r;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(acum==255){\n\t\t\t\t\t\t\t\t\tresult.add(ant);\n\t\t\t\t\t\t\t\t\tresult.add(acum);\n\t\t\t\t\t\t\t\t\tacum=1;\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tresult.add(ant);\n\t\tresult.add(acum);\n\t\t\n\t\tthis.CR=new CabeceraRLC(this.inicancho,this.inicalto,this.ancho,this.alto,img.TYPE_INT_RGB);\n\t\tthis.codResultRLC=result;\n\t\tthis.generarArchivoRLC(result);\n\t}",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"void colorize(ObservableValue<? extends Number> ov, Number old_val,\n Number new_val, Color color, BufferedImage myBufferedImage,\n ImageView myImage) {\n double coefColor = (new_val.doubleValue() / 100 + 0.5)\n / (old_val.doubleValue() / 100 + 0.5);\n this.colorizer.setChangeColor(color);\n this.colorizer.setRatio(coefColor);\n myBufferedImage = Utils.clone(this.colorizer.process(myBufferedImage));\n myImage.setImage(SwingFXUtils.toFXImage(myBufferedImage, null));\n }",
"protected abstract float[] getRgbLut();",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private static Image Transform1ColorToTransparency2ToColors(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor1,\n\t\t\tfinal Color c5, final Color c6, final int otherColor2){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\t\tfinal int r5 = c5.getRed();\n\t\tfinal int g5 = c5.getGreen();\n\t\tfinal int b5 = c5.getBlue();\n\t\tfinal int r6 = c6.getRed();\n\t\tfinal int g6 = c6.getGreen();\n\t\tfinal int b6 = c6.getBlue();\n\n\t\tfinal ImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor1;\n\t\t}\n\t\tif (r >= r5 && r <= r6 &&\n\t\t\t\tg >= g5 && g <= g6 &&\n\t\t\t\tb >= b5 && b <= b6){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor2;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"ImagePlus getRGBResultImage(double[] values,int width,int height){\r\n \t\tImagePlus tempImage = new ImagePlus(\"Visual results\");\r\n \t\ttempImage.setProcessor(new FloatProcessor(width,height,values));\r\n \t\tnew ImageConverter(tempImage).convertToRGB();\r\n \t\treturn tempImage;\r\n \t}",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public void toRed(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public native PixelPacket[] getColormap() throws MagickException;",
"public static BufferedImage toBufferedImage(Mat m) {\n\t\tint type = BufferedImage.TYPE_BYTE_GRAY;\n\t\tif (m.channels() > 1) {\n\t\t\ttype = BufferedImage.TYPE_3BYTE_BGR;\n\t\t}\n\t\tint bufferSize = m.channels() * m.cols() * m.rows();\n\t\tbyte[] b = new byte[bufferSize];\n\t\tm.get(0, 0, b); // get all the pixels\n\t\tBufferedImage image = new BufferedImage(m.cols(), m.rows(), type);\n\t\tfinal byte[] targetPixels = ((DataBufferByte) image.getRaster()\n\t\t\t\t.getDataBuffer()).getData();\n\t\tSystem.arraycopy(b, 0, targetPixels, 0, b.length);\n\t\treturn image;\n\t}",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }"
] | [
"0.8154642",
"0.8035639",
"0.7707396",
"0.7538144",
"0.7409241",
"0.7359763",
"0.6903233",
"0.687002",
"0.6863707",
"0.6829024",
"0.67499745",
"0.66346234",
"0.63582164",
"0.6323653",
"0.6284069",
"0.6276719",
"0.6263919",
"0.59674865",
"0.59400284",
"0.585556",
"0.5771726",
"0.57506627",
"0.5692649",
"0.56379133",
"0.5614367",
"0.5573976",
"0.55108005",
"0.5498859",
"0.5440133",
"0.5440133",
"0.54372925",
"0.5363306",
"0.5275936",
"0.5271323",
"0.5246212",
"0.52165073",
"0.5206142",
"0.5197367",
"0.5157193",
"0.5133681",
"0.51326674",
"0.5129954",
"0.51057655",
"0.5092948",
"0.50852346",
"0.5083022",
"0.5030706",
"0.5015968",
"0.5015383",
"0.50070244",
"0.4990915",
"0.49664438",
"0.49543306",
"0.4930288",
"0.4917392",
"0.48997706",
"0.4893325",
"0.48740983",
"0.48693407",
"0.4843767",
"0.4842471",
"0.48401904",
"0.48384807",
"0.48208708",
"0.47964546",
"0.47809395",
"0.4771983",
"0.47664654",
"0.47573212",
"0.47551155",
"0.47530627",
"0.47312826",
"0.47278196",
"0.47266266",
"0.4725744",
"0.47254044",
"0.4724856",
"0.47239712",
"0.47140282",
"0.46933895",
"0.46576217",
"0.46533623",
"0.46487084",
"0.46484303",
"0.46304494",
"0.46243224",
"0.46184295",
"0.4616311",
"0.4600923",
"0.45928228",
"0.4590621",
"0.4582836",
"0.45788035",
"0.45739225",
"0.45606875",
"0.45512375",
"0.45350012",
"0.45315337",
"0.45136648",
"0.45132712"
] | 0.793127 | 2 |
Copies a ColorImage to form a new ColorImage | public static ColorImage toColor(ColorImage img) {
int X = img.X();
int Y = img.Y();
ColorImage newimg = null;
newimg = new ColorImage(X, Y);
newimg.setColorModel(img.getColorModel());
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
newimg.set(x, y, img.get(x, y));
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"public void updateImage(ColorImage newImage) {\n currentImage.push(newImage);\n }",
"public HTColorImage(HTColorImage htImage)\n\t{\n\t\timg = HTUtil.getCopy(htImage.getImage());\n\t}",
"@SuppressWarnings(\"unused\")\n\tprivate void cloneImage() {\n//\t\tColorModel cm = offimg.getColorModel();\n//\t\t boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n//\t\t WritableRaster raster = offimg.copyData(null);\n//\t\t offimg2 = new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n//\t\t BufferedImage currentImage = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);\n\n\t//Fastest method to clone the image (DOES NOT WORK for MACOS)\n//\t\t int[] frame = ((DataBufferInt)offimg.getRaster().getDataBuffer()).getData();\n//\t\t int[] imgData = ((DataBufferInt)offimg2.getRaster().getDataBuffer()).getData();\n//\t\t System.arraycopy(frame,0,imgData,0,frame.length);\n\t}",
"public static WritableImage copyImage(Image image) {\n int height=(int)image.getHeight();\n int width=(int)image.getWidth();\n PixelReader pixelReader=image.getPixelReader();\n WritableImage writableImage = new WritableImage(width,height);\n PixelWriter pixelWriter = writableImage.getPixelWriter();\n\n for (int y = 0; y < height; y++){\n for (int x = 0; x < width; x++){\n Color color = pixelReader.getColor(x, y);\n pixelWriter.setColor(x, y, color);\n }\n }\n return writableImage;\n }",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"@Override\n public void setColor(Color newColor) {\n BufferedImage bufferedImage;\n try {\n bufferedImage = ImageIO.read(new URL(this.pieceType.getFileName2D()));\n BufferedImage coloredImage = colorImage(bufferedImage,newColor);\n Image image = SwingFXUtils.toFXImage(coloredImage, null);\n view = new ImageView(image);\n\n //these are temporary\n view.setFitHeight(80);\n view.setFitWidth(80);\n\n } catch (IOException e) {\n System.err.println(\"Error with creating the buffered image\");\n e.printStackTrace();\n }\n }",
"public HTColorImage(BufferedImage bImage)\n\t{\n\t\tif (bImage == null)\n\t\t{\n\t\t\tthrow new HTException(\"Image is null\");\n\t\t}\t\n\t\timg = HTUtil.getCopy(bImage);\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public HTColorImage(HTImage sourceImage) {\n\t\tthis(sourceImage.getImage());\n\t}",
"Picture colourComponentImage() throws Exception;",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage deepCopy(BufferedImage bi) \n {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultip = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultip, null);\n }",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void copy(RasterImage src, RasterImage dst) {\n\t\t// TODO: just copy the image\n\n\t\tfor (int i = 0; i < dst.argb.length; i++) {\n\t\t\tdst.argb[i] = src.argb[i];\n\t\t}\n\t}",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"protected void copy(){\n\t\tthis.model.copy(this.color.getBackground());\n\t}",
"RGB getNewColor();",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public static BufferedImage deepCopy(BufferedImage bi) {\n\t\tColorModel cm = bi.getColorModel();\n\t\tboolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n\t\tWritableRaster raster = bi.copyData(null);\n\t\treturn new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n\t}",
"public static Image cloneImage(Image image) {\n\t\tBufferedImage imageCopy = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\t\tGraphics g = imageCopy.createGraphics();\n\t\tg.drawImage(image, 0, 0, null);\n\t\tg.dispose();\n\t\t\n\t\treturn imageCopy;\n }",
"public void setImage(Image newImage)\n {\n if (newImage == null)\n {\n setFill(null);\n }\n else\n {\n setFill(new ImageFill(newImage));\n }\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"void colorize(ObservableValue<? extends Number> ov, Number old_val,\n Number new_val, Color color, BufferedImage myBufferedImage,\n ImageView myImage) {\n double coefColor = (new_val.doubleValue() / 100 + 0.5)\n / (old_val.doubleValue() / 100 + 0.5);\n this.colorizer.setChangeColor(color);\n this.colorizer.setRatio(coefColor);\n myBufferedImage = Utils.clone(this.colorizer.process(myBufferedImage));\n myImage.setImage(SwingFXUtils.toFXImage(myBufferedImage, null));\n }",
"void setImage(BufferedImage valueImage, BufferedImage BackImage);",
"void copy(ImageMetadata toCopy);",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"private void fuzPixel(int rPix, int cPix, ImageArray iCopy){\n \n /*int rgb= currentIm.getPixel(rPix,cPix);\n double red= DM.getRed(rgb);\n double blue= DM.getBlue(rgb);\n double green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);*/\n \n int rgb = 0;\n double red = 0.0;\n double blue = 0.0;\n double green = 0.0;\n int alpha = 0;\n \n for(int rr = rPix-1; rr < rPix+2; rr++){\n \n for(int cc = cPix-1; cc <cPix+2; cc++){\n rgb = currentIm.getPixel(rr,cc);\n red = red + DM.getRed(rgb);\n blue = blue + DM.getBlue(rgb);\n green = green + DM.getGreen(rgb);\n alpha= alpha + DM.getAlpha(rgb);\n \n }\n \n }\n \n red = red/9;\n blue = blue/9;\n green = green/9;\n \n iCopy.setPixel(rPix, cPix,\n (alpha << 24) | ((int)red << 16) | ((int)green << 8) | \n (int)blue);\n }",
"public static BufferedImage copyImage(BufferedImage source, BufferedImage target) {\n if (target == null || target.getWidth() != source.getWidth() || target.getHeight() != source.getHeight() || target.getType() != source.getType())\n target = new BufferedImage(source.getWidth(), source.getHeight(), source.getType());\n Graphics g = target.getGraphics();\n g.drawImage(source, 0, 0, null);\n g.dispose();\n return target;\n }",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"void setColor(float r, float g, float b) {\n color c = color(r, g, b);\n for(int x = 0; x < _img.width; x++) {\n for(int y = 0; y < _img.height; y++) {\n _img.set(x, y, c);\n }\n }\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public ColorImage getImagem(){\n\t\treturn copiaFoto(this.fotografia);\n\t}",
"public static BufferedImage createBufferedImage(Dimension fieldSize, int color)\n {\n // Creates the image\n BufferedImage image = new BufferedImage(fieldSize.width, fieldSize.height, BufferedImage.TYPE_INT_ARGB);\n\n // For every pixels of the image\n for(int x = 0; x < fieldSize.width; x++)\n {\n for(int y = 0; y < fieldSize.height; y++)\n {\n // Set the pixel black\n image.setRGB(x, y, color);\n }\n }\n return image;\n }",
"public Color(Color newColor) {\n\n\t\tthis(newColor.r, newColor.g, newColor.b);\n\t}",
"@Source(\"gr/grnet/pithos/resources/editcopy.png\")\n ImageResource copy();",
"public void apply(OFImage image)\n {\n int height = image.getHeight();\n int width = image.getWidth();\n OFImage original = new OFImage(image);\n \n for(int y = 0; y < height; y++) {\n for(int x = 0; x < width; x++) {\n Color currentPixel = original.getPixel(x,y);\n int grn,blu,red;\n grn = 255 - currentPixel.getGreen();\n red = 255 - currentPixel.getRed();\n blu = 255 - currentPixel.getBlue();\n image.setPixel(x, y, new Color(red,blu,grn));\n }\n }\n }",
"public Picture(Picture copyPicture)\n {\n // let the parent class do the copy\n super(copyPicture);\n }",
"public Picture(Picture copyPicture)\n {\n // let the parent class do the copy\n super(copyPicture);\n }",
"private static BufferedImage colorBird(final BufferedImage refImage,\n final Color color) {\n \n final BufferedImage image = new BufferedImage(BIRD_WIDTH,\n BIRD_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n \n final Color bright = color.brighter().brighter();\n final Color dark = color.darker().darker();\n \n for (int y = 0; y < BIRD_HEIGHT; ++y){\n for (int x = 0; x < BIRD_WIDTH; ++x) {\n int argb = refImage.getRGB(x, y);\n if (argb == 0xffe0802c)\n argb = dark.getRGB();\n else if (argb == 0xfffad78c)\n argb = bright.getRGB();\n else if (argb == 0xfff8b733)\n argb = color.getRGB();\n image.setRGB(x, y, argb);\n }\n } \n return image;\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public abstract BufferedImage applyTo(BufferedImage image);",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public Image clone() {\r\n\t\treturn new Image(renderer, texture, textureX, textureY, textureWidth, textureHeight, width, height);\r\n\t}",
"void imageData(int width, int height, int[] rgba);",
"public void fillNewImage(){\n newImage = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);\n\n // Fill the new image with the pixels\n for(int i = 0; i < imageHeight; i++)\n for(int j = 0; j < imageWidth; j++){\n //System.out.println(\"pixel[\" + i + \"][\" + j + \"]\");\n newImage.setRGB(j, i, kCenters[assignedCluster[i][j]].getRGB());\n //newImage.setRGB(j, i, kCenters[0].getRGB());\n }\n }",
"static BufferedImage writeImage(int[][] color, String name) {\n String path = \"./\" + name + \".png\";\n BufferedImage image = new BufferedImage(color.length, color[0].length, BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < color.length; x++) {\n for (int y = 0; y < color.length; y++) {\n image.setRGB(x, y, color[x][y]);\n }\n }\n File ImageFile = new File(path);\n try {\n ImageIO.write(image, \"png\", ImageFile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return image;\n }",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public ColorFilter(Color color) {\r\n this.color = color;\r\n }",
"private ColorIcon(final Color theColor) {\r\n this.myColor = theColor;\r\n }",
"public void createNewImageFile(){\n fillNewImage();\n\n try {\n ImageIO.write(newImage, imageFileType, new File(k + \"_Colored_\" + fileName.substring(0,fileName.length() - 4) + \".\" + imageFileType));\n } catch (IOException e){\n e.printStackTrace();\n }\n \n }",
"public void addColor(PhotoColor color) {\n fullPhoto.addColor(color);\n }",
"public abstract boolean atomicChangeObjectColor(Object dst, int oldColor, int newColor);",
"public void toGreen(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"private Picture copy(Picture p) {\n\t\tif (p == null) {\n\t\t\tthrow new IllegalArgumentException(\"Cannot create a copy of a null Picture\");\n\t\t}\n\t\tPicture replica = new PictureImpl(p.getWidth(), p.getHeight());\n\n\t\tfor (int i = 0; i < p.getWidth(); i++) {\n\t\t\tfor (int j = 0; j < p.getHeight(); j++) {\n\t\t\t\treplica.setPixel(i, j, p.getPixel(i, j));\n\t\t\t}\n\t\t}\n\t\treturn replica;\n\t}",
"private void greenGradient(BufferedImage myBufferedImage,\n ImageView myImage) {\n gradientPainter.setGradientColor(Color.GREEN);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"void setSourceImage(BufferedImage mySourceImage);",
"public void toBlue(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public static synchronized void copyGraph(Image image) {\n\t\tcopytoClipboard(image);\n\t}",
"@Test\n\tpublic void testSetColor() {\n\n\t\tproc = new ByteProcessor(1,3,new byte[] {1,2,3},new IndexColorModel(8,1,new byte[]{1},new byte[]{2},new byte[]{3}));\n\n\t\tif (IJInfo.RUN_ENHANCED_TESTS)\n\t\t{\n\t\t\t// this test crashes with a null ptr exception\n\t\t\tip = new ImagePlus(\"MyChemicalRomance\", proc);\n\t\t\tip.setColor(null);\n\t\t}\n\n\t\t// try to set color of ImagePlus with no processor\n\t\t// ... should do nothing\n\t\tip = new ImagePlus();\n\t\t// can't rely on as packages may change : assertNull(ip.ip);\n\t\tip.setColor(Color.yellow);\n\t\t// can't do due to access: assertEquals(ip.ip.drawingColor,Color.black);\n\n\t\t// try to set color of processor when it exists\n\t\t// ... should set something lower -> defers to ImageProcessor.setColor() -> test there\n\t\tip = new ImagePlus(\"MyChemicalRomance\", proc);\n\t\t// can't rely on as packages may change : assertEquals(proc,ip.ip);\n\t\tip.setColor(Color.magenta);\n\t\t// can't do due to access: assertEquals(ip.ip.drawingColor,Color.magenta);\n\t}",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"protected Color getAlphaCopy(Color copy, Color orig) {\r\n if (copy==null)\r\n copy = new Color(orig);\r\n copy.r = orig.r;\r\n copy.g = orig.g;\r\n copy.b = orig.b;\r\n copy.a = alphaFilter!=null ? alphaFilter.a : orig.a;\r\n return copy;\r\n }",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public static BufferedImage copyImage(BufferedImage source) {\n return copyImage(source, null);\n }",
"Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }",
"private BufferedImage initImg() throws IOException {\n\t\tint h = 256, w = 256;\n\t\tBufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB);\n\t\t\n\t\t//int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000;\n\t\tshort max = 0, min = 255, c = max;\n\t\tint color = SimpleImageViewer.getIntPixel(c, c, c);\n\t\t\n\t\tfor (int y = 0; y < h; y++) {\n\t\t\tfor (int x = 0; x < w; x++) {\n\t\t\t\timg.setRGB(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn img;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"@Override public void setColor(Color c) \n\t{\n\t\tc2 = c1; c1 = c.dup();\n\t}",
"public Pic overlay(Pic other) {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n Pixel[][] overlayPixels = other.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Sets color to average values only if there is enough\n //area in the original image\n if (row < other.getHeight()\n && col < other.getWidth()) {\n Pixel overlayCurrent = overlayPixels[row][col];\n int redAverage = (current.getRed()\n + overlayCurrent.getRed()) / 2;\n int greenAverage = (current.getGreen()\n + overlayCurrent.getGreen()) / 2;\n int blueAverage = (current.getBlue()\n + overlayCurrent.getBlue()) / 2;\n current.setRed(redAverage);\n current.setGreen(greenAverage);\n current.setBlue(blueAverage);\n }\n }\n }\n return output;\n }",
"public void takeRGBPicture() {\n\t\ttry {\n\t\t\tpixels = this.takeStillAsRGB(width, height, false);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void redGradient(BufferedImage myBufferedImage, ImageView myImage) {\n gradientPainter.setGradientColor(Color.RED);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"public void changeImage() {\r\n this.image = ColourDoor.image2;\r\n }",
"private static Picture negateColor(Picture pic){\r\n int red = 0, green = 0, blue = 0;\r\n\r\n for( Pixel p : pic.getPixels()){\r\n // get colors of pixel and negate\r\n red = 255 - p.getRed();\r\n green = 255 - p.getGreen();\r\n blue = 255 - p.getBlue();\r\n p.setColor(new Color(red, green, blue));\r\n // pic.setBasicPixel(p.getX(), p.getY(), color.hashCode());\r\n }\r\n return pic;\r\n }",
"public void toRed(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"protected BufferedImage getImageCopy(BufferedImage orig) {\n\t BufferedImage copy = new BufferedImage(this.getWidth(), this.getHeight(),\n\t orig.getType());\n\t Graphics g = copy.createGraphics();\n\t g.drawImage(orig, (this.getWidth() - orig.getWidth()) / 2, \n\t \t\tthis.getHeight() - orig.getHeight(), null);\n\t g.dispose();\n\t return copy;\n\t}",
"public SeamCarver(Picture inputPicture) {\n if (input_picture == null) { throw new NullPointerException(\"picture can't be null\"); }\n this.picture = new Picture(inputPicture);\n height = picture.height();\n width = picture.width();\n colorArray = new int[height()][width()];\n for (int col = 0; col < width(); col++) {\n for (int row = 0; row < height(); row++) {\n colorArray[row][col] = picture.get(col, row).getRGB();\n }\n }\n }",
"public abstract void putPixelRgb(int x, int y, RGBPixel p);",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"public void setBlockImage(ImagePattern color) {\n rectangle.setFill(color);\n }",
"Image createImage();",
"@Test\n public void copyTest() {\n ImageLayout layout = new ImageLayout();\n int[] bitMask = new int[] { 0, 1 };\n SampleModel sampleModel = new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, 512, 512,\n bitMask);\n layout.setSampleModel(sampleModel);\n layout.setColorModel(null);\n\n // Creation of the RenderingHints\n RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);\n\n // create image with 2 bands\n RenderedImage twoBands = ConstantDescriptor.create(512f, 512f, new Byte[] { 1, 0 }, null);\n // Force the SampleModel to be th one defiend by the layout\n RenderedImage twoBandsPacked = new CopyOpImage(twoBands, hints, layout);\n\n // now select second band\n RenderedOp oneBand = BandSelectDescriptor.create(twoBandsPacked, new int[] { 1 }, hints);\n\n // make sure we got the right band\n Assert.assertEquals(1, oneBand.getSampleModel().getNumBands());\n Assert.assertEquals(0, oneBand.getData().getSample(0, 0, 0), 1E-11);\n }",
"public ImageResource makeInversion(ImageResource inputImg) {\n // creates the outputImg with same dimensions\n ImageResource outputImg = new ImageResource(inputImg.getWidth(), inputImg.getHeight());\n //for each pixel in outputImg\n for (Pixel pixel : outputImg.pixels()) {\n Pixel inputImgPixel = inputImg.getPixel(pixel.getX(), pixel.getY());\n // r= red g= green b= blue\n int r,g,b;\n r= inputImgPixel.getRed();\n g=inputImgPixel.getGreen();\n b=inputImgPixel.getBlue();\n pixel.setRed(255-r);\n pixel.setGreen(255-g);\n pixel.setBlue(255-b);\n }\n return outputImg;\n }",
"public static Bitmap ChangeGrey(Bitmap src, int depth, double red, double green, double blue) {\n int width = src.getWidth();\n int height = src.getHeight();\n Bitmap finalBitmap = Bitmap.createBitmap(width, height, src.getConfig());\n final double grayScale_Red = 0.3;\n final double grayScale_Green = 0.59;\n final double grayScale_Blue = 0.11;\n\n int channel_aplha, channel_red, channel_green, channel_blue;\n int pixel;\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n pixel = src.getPixel(x, y);\n channel_aplha = Color.alpha(pixel);\n channel_red = Color.red(pixel);\n channel_green = Color.green(pixel);\n channel_blue = Color.blue(pixel);\n channel_blue = channel_green = channel_red = (int) (grayScale_Red * channel_red + grayScale_Green * channel_green + grayScale_Blue * channel_blue);\n channel_red += (depth * red);\n\n if (channel_red > 255) {\n channel_red = 255;\n }\n channel_green += (depth * green);\n if (channel_green > 255) {\n channel_green = 255;\n }\n channel_blue += (depth * blue);\n if (channel_blue > 255) {\n channel_blue = 255;\n }\n finalBitmap.setPixel(x, y, Color.argb(channel_aplha, channel_red, channel_green, channel_blue));\n }\n }\n return finalBitmap;\n }",
"void setImage(BufferedImage i);",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"private void blueGradient(BufferedImage myBufferedImage,\n ImageView myImage) {\n gradientPainter.setGradientColor(Color.BLUE);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"public void add(Color rhs) {\n\t\tthis.r += rhs.r;\n\t\tthis.g += rhs.g;\n\t\tthis.b += rhs.b;\n\t}",
"public void testCopyImage() {\n System.out.println(\"copyImage\");\n String from = \"\";\n String formatName = \"\";\n File output = null;\n boolean expResult = false;\n boolean result = IOUtil.copyImage(from, formatName, output);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public abstract RGBIColor toRGBColor();",
"public void setColor(Color a, Color b) \n\t{\n\t\tc1 = a.dup(); c2 = b.dup();\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"@Override\n public void addRGB(float R, float G, float B) {\n\n }",
"@Test\n public void testSetColorModel() throws FitsException, IOException{\n IndexColorModel colorModel = ColorTable.getColorModel(2);\n ImageData imageData = new ImageData(frArray, IMAGE_TYPE,COLROID, rangeValues, 0,0, 100, 100, true );\n imageData.setColorModel(colorModel);\n Assert.assertEquals(-1, imageData.getColorTableId());\n\n }"
] | [
"0.7081708",
"0.7053027",
"0.6770043",
"0.6682333",
"0.66303325",
"0.6493876",
"0.645452",
"0.63441694",
"0.629907",
"0.62821525",
"0.62087226",
"0.61328655",
"0.61256814",
"0.6042677",
"0.60322934",
"0.60318947",
"0.60310096",
"0.6018373",
"0.6009657",
"0.5962711",
"0.595759",
"0.5926628",
"0.5922393",
"0.5886707",
"0.58799297",
"0.57956874",
"0.5756015",
"0.5735075",
"0.5720118",
"0.57135314",
"0.5703353",
"0.570198",
"0.5695909",
"0.56909126",
"0.5690048",
"0.5667879",
"0.5637176",
"0.5635241",
"0.5632925",
"0.563037",
"0.5628204",
"0.5628204",
"0.5622193",
"0.5616153",
"0.5604089",
"0.56025183",
"0.55559707",
"0.55154556",
"0.5511566",
"0.55016506",
"0.5499705",
"0.54966825",
"0.5489108",
"0.5479656",
"0.5468187",
"0.5466087",
"0.54581755",
"0.54307693",
"0.54195464",
"0.5398195",
"0.5382078",
"0.5367292",
"0.53634363",
"0.53408885",
"0.53400946",
"0.5338318",
"0.5331865",
"0.53314966",
"0.5318754",
"0.5308117",
"0.52999115",
"0.5290532",
"0.52847284",
"0.5284002",
"0.52778655",
"0.52751327",
"0.526766",
"0.52639925",
"0.5255991",
"0.52544594",
"0.5241331",
"0.5220501",
"0.52157974",
"0.5213076",
"0.52118367",
"0.520575",
"0.5195441",
"0.51947546",
"0.51930755",
"0.5190357",
"0.5185218",
"0.51814014",
"0.5180726",
"0.5175419",
"0.5175274",
"0.5144972",
"0.51429623",
"0.5137639",
"0.51271343",
"0.512571"
] | 0.70963484 | 0 |
Converts a RealColorImage to a ColorImage | public static ColorImage toColor(RealColorImage img) {
int X = img.X();
int Y = img.Y();
float[] color = new float[3];
int[] icolor = new int[3];
ColorImage newimg = null;
newimg = new ColorImage(X, Y);
newimg.setColorModel(img.getColorModel());
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
color = img.get(x, y);
icolor[0] = (int) color[0];
icolor[1] = (int) color[1];
icolor[2] = (int) color[2];
newimg.set(x, y, icolor);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public abstract RGBFColor toRGBFColor();",
"public abstract RGBIColor toRGBColor();",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"Picture colourComponentImage() throws Exception;",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"void greyscale();",
"void greyscale();",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"void colorize(ObservableValue<? extends Number> ov, Number old_val,\n Number new_val, Color color, BufferedImage myBufferedImage,\n ImageView myImage) {\n double coefColor = (new_val.doubleValue() / 100 + 0.5)\n / (old_val.doubleValue() / 100 + 0.5);\n this.colorizer.setChangeColor(color);\n this.colorizer.setRatio(coefColor);\n myBufferedImage = Utils.clone(this.colorizer.process(myBufferedImage));\n myImage.setImage(SwingFXUtils.toFXImage(myBufferedImage, null));\n }",
"@Override\n public native Color getPixelColor(int x, int y);",
"private BufferedImage initImg() throws IOException {\n\t\tint h = 256, w = 256;\n\t\tBufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB);\n\t\t\n\t\t//int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000;\n\t\tshort max = 0, min = 255, c = max;\n\t\tint color = SimpleImageViewer.getIntPixel(c, c, c);\n\t\t\n\t\tfor (int y = 0; y < h; y++) {\n\t\t\tfor (int x = 0; x < w; x++) {\n\t\t\t\timg.setRGB(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn img;\n\t}",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"private static BufferedImage colorBird(final BufferedImage refImage,\n final Color color) {\n \n final BufferedImage image = new BufferedImage(BIRD_WIDTH,\n BIRD_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n \n final Color bright = color.brighter().brighter();\n final Color dark = color.darker().darker();\n \n for (int y = 0; y < BIRD_HEIGHT; ++y){\n for (int x = 0; x < BIRD_WIDTH; ++x) {\n int argb = refImage.getRGB(x, y);\n if (argb == 0xffe0802c)\n argb = dark.getRGB();\n else if (argb == 0xfffad78c)\n argb = bright.getRGB();\n else if (argb == 0xfff8b733)\n argb = color.getRGB();\n image.setRGB(x, y, argb);\n }\n } \n return image;\n }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"protected abstract float[] getRgbLut();",
"public static BufferedImage convertToBufferedImage(Image in)\n throws Exception {\n\n Image argb32Image;\n if (in.getFormat() == Format.ARGB32) {\n argb32Image = in;\n } else {\n argb32Image = convert(in, Format.ARGB32);\n }\n\n ConvertorToBufferedImage convertor = Conversion\n .getConvertorToBufferedImage(Format.ARGB32);\n if (convertor == null) {\n throw new UnsupportedFormatException(\"Cannot convert from \"\n + Format.ARGB32 + \" to BufferedImage\");\n }\n return convertor.convert(argb32Image);\n }",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static Image Transform1ColorToTransparency2ToColors(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor1,\n\t\t\tfinal Color c5, final Color c6, final int otherColor2){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\t\tfinal int r5 = c5.getRed();\n\t\tfinal int g5 = c5.getGreen();\n\t\tfinal int b5 = c5.getBlue();\n\t\tfinal int r6 = c6.getRed();\n\t\tfinal int g6 = c6.getGreen();\n\t\tfinal int b6 = c6.getBlue();\n\n\t\tfinal ImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor1;\n\t\t}\n\t\tif (r >= r5 && r <= r6 &&\n\t\t\t\tg >= g5 && g <= g6 &&\n\t\t\t\tb >= b5 && b <= b6){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor2;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"RGB getNewColor();",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"private Color pixelColor(int i, int j, int res) {\r\n\t\tCamera camera = _scene.get_camera();\r\n\t\tColor background = _scene.get_background();\r\n\t\tdouble distance = _scene.get_screenDistance();\r\n\t\tdouble width = _imageWriter.getWidth();\r\n\t\tdouble height = _imageWriter.getHeight();\r\n\r\n\t\tint nX = _imageWriter.getNx();\r\n\t\tint nY = _imageWriter.getNy();\r\n\r\n\t\tRay ray = camera.constructRayThroughPixel((int) (nX * res), (int) (nY * res), j, i, distance, width, height);\r\n\t\tGeoPoint closestPoint = findClosestIntersection(ray);\r\n\t\tif (closestPoint == null)\r\n\t\t\treturn background;\r\n\r\n\t\telse\r\n\t\t\treturn calcColor(closestPoint, ray);\r\n\r\n\t}",
"public HTColorImage(BufferedImage bImage)\n\t{\n\t\tif (bImage == null)\n\t\t{\n\t\t\tthrow new HTException(\"Image is null\");\n\t\t}\t\n\t\timg = HTUtil.getCopy(bImage);\n\t}",
"protected abstract void toSpace( float[] rgb );",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"java.awt.Color getColor();",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void toRed(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public IsColor getColorTo() {\n\t\treturn ColorBuilder.parse(getColorToAsString());\n\t}",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public void updateImage(ColorImage newImage) {\n currentImage.push(newImage);\n }",
"private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }",
"public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"BufferedImage getImage(Mat mat){\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR);\n\n //Hue Saturation Lighting to Blue Green Red values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR);\n\n //Re-reverses Blue and Red color values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB);\n\n //Sets colors to grayscale\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY);\n\n\n getSpace(mat);\n WritableRaster raster = img.getRaster();\n DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer();\n byte[] data = dataBuffer.getData();\n mat.get(0, 0, data);\n return img;\n }",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"abstract Color getColor();",
"public static BufferedImage convert(Grid grid, float minVal, float maxVal, int voidColor) {\n GridToImageOperator op = new GridToImageOperator(null, minVal, maxVal);\n op.setVoidColor(voidColor);\n op.operate(grid);\n return op.getImage();\n }",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}",
"public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }",
"public static BufferedImage createBufferedImage(Dimension fieldSize, int color)\n {\n // Creates the image\n BufferedImage image = new BufferedImage(fieldSize.width, fieldSize.height, BufferedImage.TYPE_INT_ARGB);\n\n // For every pixels of the image\n for(int x = 0; x < fieldSize.width; x++)\n {\n for(int y = 0; y < fieldSize.height; y++)\n {\n // Set the pixel black\n image.setRGB(x, y, color);\n }\n }\n return image;\n }",
"public interface ColorRemoteService extends RemoteService {\n\n /**\n * Returns color RGB value in hex from its canonical value.\n *\n * @param canonical canonical color, e.g., {@code \"red\"}\n * @return its RGB equivalent, e.g., {@code \"FF0000\"} or if canonical name is invalid, an empty\n * string\n */\n String getRGB(String canonical);\n\n /**\n * Returns canonical name corresponding to an RGB color.\n *\n * @param rgb RGB triplet, e.g., {@code \"FF0000\"}\n * @return canonical name, e.g., {@code \"red\"} or if RGB triplet if there is no such name\n */\n String getCanonicalName(String rgb);\n}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"private void redGradient(BufferedImage myBufferedImage, ImageView myImage) {\n gradientPainter.setGradientColor(Color.RED);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"protected abstract PixelAsColors applyToPixel(Node n) throws IllegalArgumentException;",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"@Override\n public void setColor(Color newColor) {\n BufferedImage bufferedImage;\n try {\n bufferedImage = ImageIO.read(new URL(this.pieceType.getFileName2D()));\n BufferedImage coloredImage = colorImage(bufferedImage,newColor);\n Image image = SwingFXUtils.toFXImage(coloredImage, null);\n view = new ImageView(image);\n\n //these are temporary\n view.setFitHeight(80);\n view.setFitWidth(80);\n\n } catch (IOException e) {\n System.err.println(\"Error with creating the buffered image\");\n e.printStackTrace();\n }\n }",
"public int getRed(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int red = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n red = bdata[0] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n red = sdata[0]&0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n red = idata[0];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[0] != 8) {\n int shift = nBits[0] - 8;\n red = ((shift > 0) \n ? (red>>shift)\n : (red<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (red*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return red;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n // Not TYPE_GRAY or TYPE_RGB ColorSpace\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[0] * 255.0f);\n }",
"public native boolean transformRgbImage(int colorspace)\n\t\t\tthrows MagickException;",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }"
] | [
"0.83574617",
"0.81832814",
"0.7976771",
"0.79482764",
"0.7947786",
"0.7880462",
"0.7722299",
"0.76271373",
"0.7490543",
"0.7105539",
"0.7043918",
"0.69051015",
"0.6654976",
"0.6478337",
"0.6440011",
"0.64106655",
"0.6379531",
"0.6362354",
"0.60722333",
"0.60695446",
"0.60451376",
"0.600948",
"0.5915391",
"0.5867883",
"0.58652556",
"0.5858449",
"0.5855055",
"0.5821224",
"0.5747867",
"0.5726291",
"0.5709974",
"0.56747943",
"0.56743574",
"0.56441855",
"0.5618672",
"0.56130755",
"0.5594747",
"0.5576896",
"0.5571755",
"0.55707663",
"0.55600476",
"0.55600476",
"0.5556628",
"0.5528105",
"0.55242234",
"0.5504592",
"0.54971635",
"0.5494991",
"0.54709876",
"0.54624844",
"0.5444925",
"0.54374146",
"0.54267585",
"0.5418871",
"0.5407242",
"0.53975207",
"0.5388919",
"0.5381807",
"0.53590304",
"0.5350926",
"0.5338641",
"0.53298867",
"0.5324041",
"0.5321782",
"0.531913",
"0.52989966",
"0.5293092",
"0.52901113",
"0.5277825",
"0.526781",
"0.52633005",
"0.5254825",
"0.52294093",
"0.5228535",
"0.5228374",
"0.52280515",
"0.5206108",
"0.51998365",
"0.5185199",
"0.51739436",
"0.51629895",
"0.5161026",
"0.5157505",
"0.515682",
"0.5156124",
"0.51492685",
"0.5137553",
"0.51282555",
"0.51282257",
"0.5125294",
"0.51187956",
"0.51157814",
"0.5113898",
"0.50916576",
"0.5086278",
"0.508131",
"0.5072497",
"0.50690955",
"0.50678974",
"0.50625575"
] | 0.83807653 | 0 |
Converts a ComplexImage to a ColorImage. Uses only the real plane of the complex image. | public static ColorImage toColor(ComplexImage img) {
int X = img.X();
int Y = img.Y();
ColorImage newimg = null;
newimg = new ColorImage(X, Y);
int[] color = new int[3];
int gray;
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
gray = (int) img.getReal(x, y);
color[0] = gray;
color[1] = gray;
color[2] = gray;
newimg.set(x, y, color);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }",
"public abstract RGBFColor toRGBFColor();",
"private static Image Transform1ColorToTransparency2ToColors(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor1,\n\t\t\tfinal Color c5, final Color c6, final int otherColor2){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\t\tfinal int r5 = c5.getRed();\n\t\tfinal int g5 = c5.getGreen();\n\t\tfinal int b5 = c5.getBlue();\n\t\tfinal int r6 = c6.getRed();\n\t\tfinal int g6 = c6.getGreen();\n\t\tfinal int b6 = c6.getBlue();\n\n\t\tfinal ImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor1;\n\t\t}\n\t\tif (r >= r5 && r <= r6 &&\n\t\t\t\tg >= g5 && g <= g6 &&\n\t\t\t\tb >= b5 && b <= b6){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor2;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public abstract RGBIColor toRGBColor();",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public ComplexNumber(ComplexNumber cn) {\n\t\treal = cn.getReal();\n\t\timag = cn.getImag();\n\t}",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"Complex(double r, double i) {\n real = r;\n imag = i;\n }",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"Picture colourComponentImage() throws Exception;",
"public void createColorArray(Pixel[][] originalImage, int row, int column) {\n int index = 0;\n\n for (int i = -1; i < 2; i++) {\n for (int k = -1; k < 2; k++) {\n colorArray[index] = originalImage[row + i][column + k];\n index++;\n }\n }\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public ComplexNumber(double real, double imaginary) {\n this.real = real;\n this.imaginary = imaginary;\n }",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"public Complex(float real, float imag) {\n this.re = real;\n this.im = imag;\n }",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexNumber fromImaginary(double imaginary) {\n\t\treturn new ComplexNumber(0, imaginary);\n\t}",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"void greyscale();",
"void greyscale();",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public ComplexNumber(double re, double im) {\r\n this.re = re;\r\n this.im = im;\r\n }",
"public Bitmap3DColor(\n float v1Red, float v1Green, float v1Blue, float v1Alpha,\n float v2Red, float v2Green, float v2Blue, float v2Alpha,\n float v3Red, float v3Green, float v3Blue, float v3Alpha,\n float v4Red, float v4Green, float v4Blue, float v4Alpha\n ) {\n if(\n v1Red < 0 || v1Red > 1 || v2Red < 0 || v2Red > 1 || v3Red < 0 || v3Red > 1 || v4Red < 0 || v4Red > 1 ||\n v1Green < 0 || v1Green > 1 || v2Green < 0 || v2Green > 1 || v3Green < 0 || v3Green > 1 || v4Green < 0 || v4Green > 1 ||\n v1Blue < 0 || v1Blue > 1 || v2Blue < 0 || v2Blue > 1 || v3Blue < 0 || v3Blue > 1 || v4Blue < 0 || v4Blue > 1 ||\n v1Alpha < 0 || v1Alpha > 1 || v2Alpha < 0 || v2Alpha> 1 || v3Alpha < 0 || v3Alpha > 1 || v4Alpha < 0 || v4Alpha > 1\n ) {\n throw new IllegalArgumentException(\"Values should be between 0 and 1\");\n }\n\n float[] colors = {\n v1Red, v1Green, v1Blue, v1Alpha,\n v2Red, v2Green, v2Blue, v2Alpha,\n v3Red, v3Green, v3Blue, v3Alpha,\n v4Red, v4Green, v4Blue, v4Alpha\n };\n\n ByteBuffer clb = ByteBuffer.allocateDirect(colors.length * 4);\n clb.order(ByteOrder.nativeOrder());\n this.colorBuffer = clb.asFloatBuffer();\n this.colorBuffer.put(colors);\n this.colorBuffer.position(0);\n }",
"void colorize(ObservableValue<? extends Number> ov, Number old_val,\n Number new_val, Color color, BufferedImage myBufferedImage,\n ImageView myImage) {\n double coefColor = (new_val.doubleValue() / 100 + 0.5)\n / (old_val.doubleValue() / 100 + 0.5);\n this.colorizer.setChangeColor(color);\n this.colorizer.setRatio(coefColor);\n myBufferedImage = Utils.clone(this.colorizer.process(myBufferedImage));\n myImage.setImage(SwingFXUtils.toFXImage(myBufferedImage, null));\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"Complex() {\n real = 0.0;\n imag = 0.0;\n }",
"public Complex(Complex c) {\n r = c.r;\n i = c.i;\n }",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"public Complex(double real, double imaginary) {\r\n this.real = real;\r\n this.imaginary = imaginary;\r\n }",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"public CXformWithAlpha getColorTransform() {\n return colorTransform;\n }",
"public BufferedImage getCompositeImage() {\n if (compositeImageUpToDate) {\n return cachedCompositeImage; // this caching is useful for example when using the Color Picker Tool\n }\n\n cachedCompositeImage = calculateCompositeImage();\n\n compositeImageUpToDate = true;\n return cachedCompositeImage;\n }",
"public ComplexNumber(double real, double imaginary) {\n\t\tsuper();\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"boolean equals (ComplexNum c) //compares two complex numbers and produces\n {\n\tif (c.real == real && im == c.im)\n\t return true;\n\treturn false;\n }",
"public ComplexNumber(double re, double im) {\n\t\treal = re;\n\t\timag = im;\n\t}",
"public IsColor getColorTo() {\n\t\treturn ColorBuilder.parse(getColorToAsString());\n\t}",
"public Complex(double real, double imaginary) {\n r = real;\n i = imaginary;\n }",
"@Override\n public native Color getPixelColor(int x, int y);",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public final Constant complex_constant() throws RecognitionException {\r\n Constant constant = null;\r\n\r\n\r\n LLVMParser.structure_constant_return structure_constant192 =null;\r\n\r\n LLVMParser.array_constant_return array_constant193 =null;\r\n\r\n LLVMParser.vector_constant_return vector_constant194 =null;\r\n\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:5: ( structure_constant | array_constant | vector_constant )\r\n int alt266=3;\r\n switch ( input.LA(1) ) {\r\n case 93:\r\n {\r\n alt266=1;\r\n }\r\n break;\r\n case 49:\r\n {\r\n alt266=2;\r\n }\r\n break;\r\n case 46:\r\n {\r\n alt266=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 266, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt266) {\r\n case 1 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:7: structure_constant\r\n {\r\n pushFollow(FOLLOW_structure_constant_in_complex_constant7999);\r\n structure_constant192=structure_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.structure, (structure_constant192!=null?input.toString(structure_constant192.start,structure_constant192.stop):null));\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1060:7: array_constant\r\n {\r\n pushFollow(FOLLOW_array_constant_in_complex_constant8009);\r\n array_constant193=array_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.array, (array_constant193!=null?input.toString(array_constant193.start,array_constant193.stop):null));\r\n\r\n }\r\n break;\r\n case 3 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1061:7: vector_constant\r\n {\r\n pushFollow(FOLLOW_vector_constant_in_complex_constant8019);\r\n vector_constant194=vector_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.vector, (vector_constant194!=null?input.toString(vector_constant194.start,vector_constant194.stop):null));\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return constant;\r\n }",
"public ColorFilter(Color color) {\r\n this.color = color;\r\n }",
"public HTColorImage(BufferedImage bImage)\n\t{\n\t\tif (bImage == null)\n\t\t{\n\t\t\tthrow new HTException(\"Image is null\");\n\t\t}\t\n\t\timg = HTUtil.getCopy(bImage);\n\t}",
"private Color pixelColor(int i, int j, int res) {\r\n\t\tCamera camera = _scene.get_camera();\r\n\t\tColor background = _scene.get_background();\r\n\t\tdouble distance = _scene.get_screenDistance();\r\n\t\tdouble width = _imageWriter.getWidth();\r\n\t\tdouble height = _imageWriter.getHeight();\r\n\r\n\t\tint nX = _imageWriter.getNx();\r\n\t\tint nY = _imageWriter.getNy();\r\n\r\n\t\tRay ray = camera.constructRayThroughPixel((int) (nX * res), (int) (nY * res), j, i, distance, width, height);\r\n\t\tGeoPoint closestPoint = findClosestIntersection(ray);\r\n\t\tif (closestPoint == null)\r\n\t\t\treturn background;\r\n\r\n\t\telse\r\n\t\t\treturn calcColor(closestPoint, ray);\r\n\r\n\t}",
"@LargeTest\n public void testIntrinsicsColorMatrix() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX.name());\n }",
"private Color getColor( float value ) {\n float[] rgba = (float[]) baseRgba_.clone();\n shader_.adjustRgba( rgba, value );\n return new Color( rgba[ 0 ], rgba[ 1 ], rgba[ 2 ], rgba[ 3 ] );\n }",
"public Color getColorObject() {\n switch (this) {\n case WHITE:\n return new Color(255,255,255);\n case BLACK:\n return new Color(0,0,0);\n case RED:\n return new Color(255,0,0);\n case GREEN:\n return new Color(0,255,0);\n case BLUE:\n return new Color(0,0,255);\n default:\n return null;\n }\n\n }",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"ClrConst(Color color)\n {\n this(Color.RGBtoHSB(\n color.getRed(), \n color.getGreen(),\n color.getBlue(), null)[0]);\n }",
"public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}",
"public @NotNull Image rotateCCW()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width; x++)\n {\n long src = Integer.toUnsignedLong(y * this.width + this.width - x - 1) * this.format.sizeof;\n long dst = Integer.toUnsignedLong(x * this.height + y) * this.format.sizeof;\n \n MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, this.format.sizeof);\n }\n }\n \n this.data.free();\n this.data = output;\n }\n return this;\n }",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"public static Object getCompositeImage(Object baseImage, Object overlayImage) {\n\t\tList<Object> images = new ArrayList<Object>(2);\n\t\timages.add(baseImage);\n\t\timages.add(overlayImage);\n\t\t\n\t\tObject image = new ComposedImage(images);\n\t\treturn image;\n\t}",
"public SeamCarver(Picture inputPicture) {\n if (input_picture == null) { throw new NullPointerException(\"picture can't be null\"); }\n this.picture = new Picture(inputPicture);\n height = picture.height();\n width = picture.width();\n colorArray = new int[height()][width()];\n for (int col = 0; col < width(); col++) {\n for (int row = 0; row < height(); row++) {\n colorArray[row][col] = picture.get(col, row).getRGB();\n }\n }\n }",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex(double real, double imaginary) {\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"static BufferedImage drawConc(int scale){\n\t\tint thisSX = scale*Data.meshRNx;\n\t\tint thisSY = scale*Data.meshRNy;\n BufferedImage bi = new BufferedImage(thisSX, thisSY,BufferedImage.TYPE_INT_RGB);\n\t \tGraphics2D g1 = bi.createGraphics();\n Functions.drawConc(g1,Data.meshRNx,Data.meshRNy,scale,Data.densCells, Pars.maxMesh);\n return bi;\n }",
"private void fuzPixel(int rPix, int cPix, ImageArray iCopy){\n \n /*int rgb= currentIm.getPixel(rPix,cPix);\n double red= DM.getRed(rgb);\n double blue= DM.getBlue(rgb);\n double green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);*/\n \n int rgb = 0;\n double red = 0.0;\n double blue = 0.0;\n double green = 0.0;\n int alpha = 0;\n \n for(int rr = rPix-1; rr < rPix+2; rr++){\n \n for(int cc = cPix-1; cc <cPix+2; cc++){\n rgb = currentIm.getPixel(rr,cc);\n red = red + DM.getRed(rgb);\n blue = blue + DM.getBlue(rgb);\n green = green + DM.getGreen(rgb);\n alpha= alpha + DM.getAlpha(rgb);\n \n }\n \n }\n \n red = red/9;\n blue = blue/9;\n green = green/9;\n \n iCopy.setPixel(rPix, cPix,\n (alpha << 24) | ((int)red << 16) | ((int)green << 8) | \n (int)blue);\n }",
"public Complex(double re, double im) {\n this.re = re;\n this.im = im;\n }",
"abstract public void colorize(TCell c);",
"public HTColorImage(HTColorImage htImage)\n\t{\n\t\timg = HTUtil.getCopy(htImage.getImage());\n\t}",
"java.awt.Color getColor();",
"public void runDarken() {\n BufferedImage transformedImage = new BufferedImage(this.image.getWidth(), this.image.getHeight(), this.image.getType());\n\n try {\n for(int i = 0; i < this.image.getWidth(); i++) {\n for(int j = 0; j < this.image.getHeight(); j++) {\n transformedImage.setRGB(i, j, image.getRGB(i,j));\n }\n }\n float scaleFactor = 0.5f;\n RescaleOp op = new RescaleOp(scaleFactor, 0, null);\n transformedImage = op.filter(transformedImage, null);\n\n File outputImageFileLocation = new File(this.exportLocation);\n ImageIO.write(transformedImage, Files.getFileExtension(this.imageLocation), outputImageFileLocation);\n System.out.println(\"Success\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public native boolean transformRgbImage(int colorspace)\n\t\t\tthrows MagickException;",
"public Complex(String cStr){\r\n\t\tthis(cStr.replaceAll(\" \", \"\").split(\"(?=\\\\+)|(?=\\\\-)\")); // splits cStr at + or - into an array of strings having two elements\r\n\t\t// The first element of the resultant array will be the real portion, \r\n\t\t// while the second is the imaginary portion. This array is passed to the next constructor.\r\n\t}",
"@SuppressWarnings(\"unused\")\n\tprivate void cloneImage() {\n//\t\tColorModel cm = offimg.getColorModel();\n//\t\t boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n//\t\t WritableRaster raster = offimg.copyData(null);\n//\t\t offimg2 = new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n//\t\t BufferedImage currentImage = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);\n\n\t//Fastest method to clone the image (DOES NOT WORK for MACOS)\n//\t\t int[] frame = ((DataBufferInt)offimg.getRaster().getDataBuffer()).getData();\n//\t\t int[] imgData = ((DataBufferInt)offimg2.getRaster().getDataBuffer()).getData();\n//\t\t System.arraycopy(frame,0,imgData,0,frame.length);\n\t}",
"public int getTransparency() {\n/* 148 */ return this.bufImg.getColorModel().getTransparency();\n/* */ }"
] | [
"0.78693",
"0.7337752",
"0.71710575",
"0.70748246",
"0.6983554",
"0.6952437",
"0.6851547",
"0.67979854",
"0.6766245",
"0.67117727",
"0.6696858",
"0.6523207",
"0.6386804",
"0.63455856",
"0.6302786",
"0.62882584",
"0.6276972",
"0.62615263",
"0.6205552",
"0.5740878",
"0.56446016",
"0.557579",
"0.5573751",
"0.5431455",
"0.5426253",
"0.53474027",
"0.5203001",
"0.5129488",
"0.51264817",
"0.5038939",
"0.50152904",
"0.49835277",
"0.49325767",
"0.49039474",
"0.48731783",
"0.48707315",
"0.4833652",
"0.48097244",
"0.47824708",
"0.4780271",
"0.47635162",
"0.47582334",
"0.46973437",
"0.46856186",
"0.46846598",
"0.4679838",
"0.46780777",
"0.46771815",
"0.46771815",
"0.46758163",
"0.4674326",
"0.46725124",
"0.46604133",
"0.46546376",
"0.4647234",
"0.46442068",
"0.46424162",
"0.46286154",
"0.46215785",
"0.46118814",
"0.4608355",
"0.45858756",
"0.45850384",
"0.45843503",
"0.45838985",
"0.4569451",
"0.4568733",
"0.45539856",
"0.4549119",
"0.45485044",
"0.45479208",
"0.45401543",
"0.4526205",
"0.45252806",
"0.45196658",
"0.45167452",
"0.45136917",
"0.45029247",
"0.44980285",
"0.44903815",
"0.44632676",
"0.44566542",
"0.44507432",
"0.4445752",
"0.44432408",
"0.443242",
"0.44319957",
"0.44303983",
"0.4418076",
"0.4404513",
"0.4403581",
"0.44018543",
"0.43904847",
"0.43857056",
"0.43804002",
"0.43798226",
"0.4369738",
"0.43649456",
"0.43643573",
"0.4356181"
] | 0.83367854 | 0 |
Converts a GrayImage to a RealColorImage. Each plane of the color image has the same value in every pixel. | public static RealColorImage toRealColor(GrayImage img) {
int X = img.X();
int Y = img.Y();
float[] color = new float[3];
float gray;
RealColorImage newimg = new RealColorImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
gray = (float) img.get(x, y);
color[0] = gray;
color[1] = gray;
color[2] = gray;
newimg.set(x, y, color);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"void greyscale();",
"void greyscale();",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public abstract RGBFColor toRGBFColor();",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"private double[][] normalize255(RealMatrix realMatrix) {\n\t\tdouble[][] input = realMatrix.getData();\n\t\tdouble[][] normalized = new double[realMatrix.getRowDimension()][realMatrix.getColumnDimension()];\n\t\tdouble minimum = 99999.99;\n\t\tdouble maximum = -9999.99;\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tminimum = Math.min(minimum, input[i][j]);\n\t\t\t\tmaximum = Math.max(maximum, input[i][j]);\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tnormalized[i][j] = ((input[i][j] - minimum)*(255/(maximum-minimum)));\n\t\t\t}\n\t\t}\n\t\treturn normalized;\n\t}",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"private static double [][][] convertToArray1(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n double [][][] result = new double [width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"protected abstract float[] getRgbLut();",
"public static Integer[][] preformRGBConvolution(Integer[][][] img, Double[][] filter) {\n Integer[][] r = operationConvolution(img[0], filter);\n Integer[][] g = operationConvolution(img[1], filter);\n Integer[][] b = operationConvolution(img[2], filter);\n Integer[][] output = new Integer[r.length][r[0].length];\n for (int y = 0; y < output.length; y++) {\n for (int x = 0; x < output[0].length; x++) {\n output[y][x] = r[y][x] + g[y][x] + b[y][x];\n }\n }\n return output;\n }",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public static <R extends RealType<R>> Img<R> vectorToImage(final RealVector ar, final R type, final int numDims,\n final ImgFactory<R> fac) {\n final long[] dims = new long[numDims];\n\n for (int i = 0; i < (dims.length - 1); i++) {\n dims[i] = 1;\n }\n dims[dims.length - 1] = ar.getDimension();\n final Img<R> res = fac.create(dims, type);\n final Cursor<R> c = res.cursor();\n while (c.hasNext()) {\n c.fwd();\n c.get().setReal(ar.getEntry(c.getIntPosition(numDims - 1)));\n }\n\n return res;\n }",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public static Integer[][] preformRGBConvolution(Integer[][][] img, Double[][][] filter) {\n Integer[][] r = operationConvolution(img[0], filter[0]);\n Integer[][] g = operationConvolution(img[1], filter[1]);\n Integer[][] b = operationConvolution(img[2], filter[2]);\n Integer[][] output = new Integer[r.length][r[0].length];\n for (int y = 0; y < output.length; y++) {\n for (int x = 0; x < output[0].length; x++) {\n output[y][x] = r[y][x] + g[y][x] + b[y][x];\n }\n }\n return output;\n }",
"public void createColorArray(Pixel[][] originalImage, int row, int column) {\n int index = 0;\n\n for (int i = -1; i < 2; i++) {\n for (int k = -1; k < 2; k++) {\n colorArray[index] = originalImage[row + i][column + k];\n index++;\n }\n }\n }",
"@LargeTest\n public void testIntrinsicsColorMatrixGrey() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX_GREY);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX_GREY.name());\n }",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"ImagePlus getRGBResultImage(double[] values,int width,int height){\r\n \t\tImagePlus tempImage = new ImagePlus(\"Visual results\");\r\n \t\ttempImage.setProcessor(new FloatProcessor(width,height,values));\r\n \t\tnew ImageConverter(tempImage).convertToRGB();\r\n \t\treturn tempImage;\r\n \t}",
"private native int grayToRgb(byte src[],int dst[]);",
"private RealMatrix retrieveImageIntensities(String filename) {\n\t\tBufferedImage img = null;\n\t\tdouble matrixData[][] = null; \n\t\ttry {\n\t\t\t\n\t\t\t// Read in the image.\n\t\t\timg = ImageIO.read(new File(filename));\n\t\t\tmatrixData = new double[img.getWidth()][img.getHeight()];\n\n\t\t\t// Transform the image into a grayscale image.\n\t\t\tRaster raster = img.getData();\n\t\t\tfor (int i=0; i < img.getWidth(); i++) {\n\t\t\t\tfor (int j=0; j < img.getHeight(); j++) {\n\t\t\t\t\tint gray = raster.getPixel(i, j, new int[raster.getNumBands()])[0];\n\t\t\t\t\tdouble convertedGray = (double) gray / 255;\n\t\t\t\t\tif (convertedGray > 255) {\n\t\t\t\t\t\tSystem.out.println(\"wrong2\");\n\t\t\t\t\t}\n\t\t\t\t\tmatrixData[i][j] = convertedGray;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error reading \" + filename);\n\t\t}\n\t\treturn MatrixUtils.createRealMatrix(matrixData);\n\t}",
"protected abstract void toSpace( float[] rgb );",
"public static Integer[][][] getRGBMatrixFromImage(BufferedImage img) {\n int w = img.getWidth();\n int h = img.getHeight();\n Integer[][][] data = new Integer[3][h][w];\n for (int y = 0; y < h; y++) {\n for (int x = 0; x < w; x++) {\n Color c = new Color(img.getRGB(x, y));\n data[0][y][x] = c.getRed();\n data[1][y][x] = c.getGreen();\n data[2][y][x] = c.getBlue();\n }\n }\n return data;\n }",
"public abstract RGBIColor toRGBColor();",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public void toRed(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"public int[][][] rescaleImage(int[][][] image, float scale) {\r\n int height = image[0].length;\r\n int width = image.length;\r\n BufferedImage result = new BufferedImage(width, height, 1);\r\n //loop through all pixels.\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n int a = image[x][y][0];\r\n int r = image[x][y][1];\r\n int g = image[x][y][2];\r\n int b = image[x][y][3];\r\n\r\n r = (int) (r * scale);\r\n g = (int) (g * scale);\r\n b = (int) (b * scale);\r\n\r\n image[x][y][0] = a;\r\n image[x][y][1] = r;\r\n image[x][y][2] = g;\r\n image[x][y][3] = b;\r\n }\r\n }\r\n return image; //return array\r\n }",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"private static int[][][] convertToArray(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n int[][][] result = new int[width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }",
"private void recompose(int[][] array,int[][] red,int[][] green,int[][] blue){\n\t\tfor(int i=0;i<array.length;i++){\n\t\t\tfor(int j=0;j<array[0].length;j++){\n\t\t\t\tarray[i][j]=GImage.createRGBPixel(red[i][j],green[i][j],blue[i][j]);\n\t\t\t}\n\t\t}\n\t\t//Your code ends here\n\t}",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"public BufferedImage logarithm(BufferedImage image, int c) {\r\n //convert buffered image to array.\r\n int[][][] arr = convertToArray(image);\r\n //loop through all pixels.\r\n for (int i = 0; i < arr[0].length; i++) {\r\n for (int j = 0; j < arr.length; j++) {\r\n arr[j][i][1] = (int) (c * Math.log(1 + arr[j][i][1]));\r\n arr[j][i][2] = (int) (c * Math.log(1 + arr[j][i][2]));\r\n arr[j][i][3] = (int) (c * Math.log(1 + arr[j][i][3]));\r\n }\r\n }\r\n return convertToBimage(arr); //return array\r\n }",
"public BufferedImage equalizedHistogram(BufferedImage image) {\r\n int height = image.getHeight();\r\n int width = image.getWidth();\r\n int[][][] arr = convertToArray(image);\r\n double[][] rgbCount = normalisedHistogram(image);\r\n double[][] lookup = new double[rgbCount.length][rgbCount[0].length];\r\n //create cumulative frequency\r\n lookup[0][0] = rgbCount[0][0];\r\n lookup[1][0] = rgbCount[1][0];\r\n lookup[2][0] = rgbCount[2][0];\r\n for (int i = 1; i < rgbCount[0].length; i++) {\r\n for (int col = 0; col < 3; col++) {\r\n lookup[col][i] = lookup[col][i - 1] + rgbCount[col][i]; //adds last frequency and current frequency\r\n }\r\n }\r\n for (int i = 1; i < rgbCount[0].length; i++) {\r\n for (int col = 0; col < 3; col++) {\r\n lookup[col][i] = (int) (lookup[col][i] * 255); //multiply by max value\r\n }\r\n }\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n for (int i = 1; i < 4; i++) {\r\n arr[x][y][i] = (int) lookup[i - 1][arr[x][y][i]]; //set value to the lookup table value for that color\r\n }\r\n }\r\n }\r\n return convertToBimage(arr);\r\n }",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public GrayColor getColor(){\n return this.color;\n }",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"private void traverseBayeredPatternFullSizeRGB() {\n\n for (int x = 0; x < originalImageHeight -1; x++){\n for (int y = 1; y < originalImageWidth -1; y++){\n Point position = new Point(x,y);\n int absolutePosition = getAbsolutPixelPosition(position);\n\n PixelType pixelType = null;\n\n if (x%2 == 0 && y%2 == 0) pixelType = PixelType.GREEN_TOPRED;\n if (x%2 == 0 && y%2 == 1) pixelType = PixelType.BLUE;\n if (x%2 == 1 && y%2 == 0) pixelType = PixelType.RED;\n if (x%2 == 1 && y%2 == 1) pixelType = PixelType.GREEN_TOPBLUE;\n\n fullSizePixRGB[absolutePosition] = getFullSizeRGB(new Point(x,y),pixelType);\n }\n }\n }"
] | [
"0.8037676",
"0.76118785",
"0.7566161",
"0.74915403",
"0.74713844",
"0.73557854",
"0.71013653",
"0.70211405",
"0.6702303",
"0.65099186",
"0.64385164",
"0.64271957",
"0.64021003",
"0.61042064",
"0.59772605",
"0.58234376",
"0.5774573",
"0.563268",
"0.563268",
"0.56313515",
"0.55465275",
"0.5500234",
"0.5475757",
"0.54303795",
"0.54021657",
"0.5386967",
"0.5382057",
"0.53755134",
"0.53239036",
"0.52579",
"0.5217787",
"0.52133405",
"0.51883215",
"0.5184596",
"0.5168488",
"0.5137791",
"0.5117504",
"0.5117248",
"0.51051533",
"0.51051366",
"0.50986016",
"0.50748044",
"0.50618553",
"0.5057974",
"0.5033652",
"0.5015377",
"0.4948726",
"0.4943619",
"0.49415627",
"0.49396485",
"0.49175894",
"0.48660758",
"0.4859168",
"0.48588392",
"0.48554084",
"0.48532003",
"0.485014",
"0.484827",
"0.48402375",
"0.48312017",
"0.48267096",
"0.48144948",
"0.48122764",
"0.481099",
"0.47953755",
"0.47930712",
"0.4774281",
"0.47671756",
"0.476044",
"0.4758784",
"0.47563574",
"0.47487423",
"0.47464484",
"0.4736767",
"0.47281733",
"0.4725549",
"0.47079653",
"0.47058615",
"0.4700528",
"0.469067",
"0.4683386",
"0.46572548",
"0.46417534",
"0.46368486",
"0.46224165",
"0.4617946",
"0.46116284",
"0.46033508",
"0.46029127",
"0.4599133",
"0.45988712",
"0.45938882",
"0.45859274",
"0.45806435",
"0.4578137",
"0.45694062",
"0.45660365",
"0.45569947",
"0.455393",
"0.4548892"
] | 0.81377375 | 0 |
Converts a RealGrayImage to a RealColorImage. Each plane of the color image has the same value in every pixel. | public static RealColorImage toRealColor(RealGrayImage img) {
int X = img.X();
int Y = img.Y();
float[] color = new float[3];
float gray;
RealColorImage newimg = new RealColorImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
gray = img.get(x, y);
color[0] = gray;
color[1] = gray;
color[2] = gray;
newimg.set(x, y, color);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"void greyscale();",
"void greyscale();",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public abstract RGBFColor toRGBFColor();",
"private double[][] normalize255(RealMatrix realMatrix) {\n\t\tdouble[][] input = realMatrix.getData();\n\t\tdouble[][] normalized = new double[realMatrix.getRowDimension()][realMatrix.getColumnDimension()];\n\t\tdouble minimum = 99999.99;\n\t\tdouble maximum = -9999.99;\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tminimum = Math.min(minimum, input[i][j]);\n\t\t\t\tmaximum = Math.max(maximum, input[i][j]);\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tnormalized[i][j] = ((input[i][j] - minimum)*(255/(maximum-minimum)));\n\t\t\t}\n\t\t}\n\t\treturn normalized;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public static <R extends RealType<R>> Img<R> vectorToImage(final RealVector ar, final R type, final int numDims,\n final ImgFactory<R> fac) {\n final long[] dims = new long[numDims];\n\n for (int i = 0; i < (dims.length - 1); i++) {\n dims[i] = 1;\n }\n dims[dims.length - 1] = ar.getDimension();\n final Img<R> res = fac.create(dims, type);\n final Cursor<R> c = res.cursor();\n while (c.hasNext()) {\n c.fwd();\n c.get().setReal(ar.getEntry(c.getIntPosition(numDims - 1)));\n }\n\n return res;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"@Override\n public String getGrayScaleHash(BufferedImage bufferedImage) {\n /* 1. Reduce smallImageSize to 32x32 */\n BufferedImage smallImage = Scalr.resize(bufferedImage,\n Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_EXACT, smallImageSize, smallImageSize);\n\n\t\t/* 2. Reduce color. */\n BufferedImage reducedImage = ImageHelper.convertImageToGrayScale(smallImage);\n\n\t\t/* 3. Compute the DCT. */\n double[][] imageColorPlane = new double[smallImageSize][smallImageSize];\n\n for (int iw = 0; iw < reducedImage.getWidth(); ++iw) {\n for (int ih = 0; ih < reducedImage.getHeight(); ++ih) {\n Color pixelColor = new Color(reducedImage.getRGB(iw, ih));\n imageColorPlane[iw][ih] = pixelColor.getGreen();\n }\n }\n return getColorPlaneHash(imageColorPlane);\n }",
"private static double [][][] convertToArray1(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n double [][][] result = new double [width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"protected abstract float[] getRgbLut();",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"public abstract RGBIColor toRGBColor();",
"public static Integer[][] preformRGBConvolution(Integer[][][] img, Double[][] filter) {\n Integer[][] r = operationConvolution(img[0], filter);\n Integer[][] g = operationConvolution(img[1], filter);\n Integer[][] b = operationConvolution(img[2], filter);\n Integer[][] output = new Integer[r.length][r[0].length];\n for (int y = 0; y < output.length; y++) {\n for (int x = 0; x < output[0].length; x++) {\n output[y][x] = r[y][x] + g[y][x] + b[y][x];\n }\n }\n return output;\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Integer[][] preformRGBConvolution(Integer[][][] img, Double[][][] filter) {\n Integer[][] r = operationConvolution(img[0], filter[0]);\n Integer[][] g = operationConvolution(img[1], filter[1]);\n Integer[][] b = operationConvolution(img[2], filter[2]);\n Integer[][] output = new Integer[r.length][r[0].length];\n for (int y = 0; y < output.length; y++) {\n for (int x = 0; x < output[0].length; x++) {\n output[y][x] = r[y][x] + g[y][x] + b[y][x];\n }\n }\n return output;\n }",
"ImagePlus getRGBResultImage(double[] values,int width,int height){\r\n \t\tImagePlus tempImage = new ImagePlus(\"Visual results\");\r\n \t\ttempImage.setProcessor(new FloatProcessor(width,height,values));\r\n \t\tnew ImageConverter(tempImage).convertToRGB();\r\n \t\treturn tempImage;\r\n \t}",
"protected abstract void toSpace( float[] rgb );",
"private RealMatrix retrieveImageIntensities(String filename) {\n\t\tBufferedImage img = null;\n\t\tdouble matrixData[][] = null; \n\t\ttry {\n\t\t\t\n\t\t\t// Read in the image.\n\t\t\timg = ImageIO.read(new File(filename));\n\t\t\tmatrixData = new double[img.getWidth()][img.getHeight()];\n\n\t\t\t// Transform the image into a grayscale image.\n\t\t\tRaster raster = img.getData();\n\t\t\tfor (int i=0; i < img.getWidth(); i++) {\n\t\t\t\tfor (int j=0; j < img.getHeight(); j++) {\n\t\t\t\t\tint gray = raster.getPixel(i, j, new int[raster.getNumBands()])[0];\n\t\t\t\t\tdouble convertedGray = (double) gray / 255;\n\t\t\t\t\tif (convertedGray > 255) {\n\t\t\t\t\t\tSystem.out.println(\"wrong2\");\n\t\t\t\t\t}\n\t\t\t\t\tmatrixData[i][j] = convertedGray;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error reading \" + filename);\n\t\t}\n\t\treturn MatrixUtils.createRealMatrix(matrixData);\n\t}",
"private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public void createColorArray(Pixel[][] originalImage, int row, int column) {\n int index = 0;\n\n for (int i = -1; i < 2; i++) {\n for (int k = -1; k < 2; k++) {\n colorArray[index] = originalImage[row + i][column + k];\n index++;\n }\n }\n }",
"RealConstant createRealConstant();",
"public static BufferedImage arrayToBufferedImage(int[][] gray) {\r\n BufferedImage outImage = new BufferedImage(gray.length, gray[0].length,\r\n BufferedImage.TYPE_BYTE_GRAY);\r\n for (int i = 0; i < gray.length; i++) {\r\n for (int j = 0; j < gray[i].length; j++) {\r\n int value = gray[i][j] << 16 | gray[i][j] << 8 | gray[i][j];\r\n outImage.setRGB(i, j, value);\r\n }\r\n }\r\n\r\n return outImage;\r\n }",
"@LargeTest\n public void testIntrinsicsColorMatrixGrey() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX_GREY);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX_GREY.name());\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public void toRed(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public R1toConstantMatrix(Matrix A) {\n this.A = new ImmutableMatrix(A);\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public int[][][] rescaleImage(int[][][] image, float scale) {\r\n int height = image[0].length;\r\n int width = image.length;\r\n BufferedImage result = new BufferedImage(width, height, 1);\r\n //loop through all pixels.\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n int a = image[x][y][0];\r\n int r = image[x][y][1];\r\n int g = image[x][y][2];\r\n int b = image[x][y][3];\r\n\r\n r = (int) (r * scale);\r\n g = (int) (g * scale);\r\n b = (int) (b * scale);\r\n\r\n image[x][y][0] = a;\r\n image[x][y][1] = r;\r\n image[x][y][2] = g;\r\n image[x][y][3] = b;\r\n }\r\n }\r\n return image; //return array\r\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public RawImage(BufferedImage img, int res) {\n boolean[] alpha = new boolean[1];\n m_img = ImageHelper.convertToRGB(img, alpha);\n m_hasAlpha = alpha[0];\n m_height = m_img.length;\n m_width = m_height > 0 ? m_img[0].length : 0;\n m_res = res;\n }",
"public static Mat invert(JPEGCategory[] input) {\n\t\tdouble[] data = new double[64];\n\t\tint k = 0;\n\t\t\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tdouble[] subArr = convertToDouble(input[i]);\n\t\t\tfor (int j = 0; j < subArr.length; j++) {\n\t\t\t\tdata[k] = subArr[j];\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble[] newData = { \n\t\t\t data[0], data[1], data[5], data[6], data[14], data[15], data[27], data[28], \n\t\t\t data[2], data[4], data[7], data[13], data[16], data[26], data[29], data[42], \n\t\t\t data[3], data[8], data[12], data[17], data[25], data[30], data[41], data[43], \n\t\t\t data[9], data[11], data[18], data[24], data[31], data[40], data[44], data[53], \n\t\t\tdata[10], data[19], data[23], data[32], data[39], data[45], data[52], data[54], \n\t\t\tdata[20], data[22], data[33], data[38], data[46], data[51], data[55], data[60], \n\t\t\tdata[21], data[34], data[37], data[47], data[50], data[56], data[59], data[61], \n\t\t\tdata[35], data[36], data[48], data[49], data[57], data[58], data[62], data[63] \n\t\t};\n\n\t\tMat result = new Mat(8, 8, CvType.CV_64FC1);\n\t\tresult.put(0, 0, newData);\n\t\treturn result;\n\t}",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"private Color pixelColor(int i, int j, int res) {\r\n\t\tCamera camera = _scene.get_camera();\r\n\t\tColor background = _scene.get_background();\r\n\t\tdouble distance = _scene.get_screenDistance();\r\n\t\tdouble width = _imageWriter.getWidth();\r\n\t\tdouble height = _imageWriter.getHeight();\r\n\r\n\t\tint nX = _imageWriter.getNx();\r\n\t\tint nY = _imageWriter.getNy();\r\n\r\n\t\tRay ray = camera.constructRayThroughPixel((int) (nX * res), (int) (nY * res), j, i, distance, width, height);\r\n\t\tGeoPoint closestPoint = findClosestIntersection(ray);\r\n\t\tif (closestPoint == null)\r\n\t\t\treturn background;\r\n\r\n\t\telse\r\n\t\t\treturn calcColor(closestPoint, ray);\r\n\r\n\t}",
"public SparseRealMatrix(SparseRealMatrix matrix) {\n this.rowDimension = matrix.rowDimension;\n this.columnDimension = matrix.columnDimension;\n this.entries = new OpenIntToDoubleHashMap(matrix.entries);\n }",
"public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }",
"public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"public static Image aplicarLienzoAoriginal(Image imagenOriginal, int nxn) {\n BufferedImage biNegro = new BufferedImage(nxn, nxn, BufferedImage.TYPE_INT_RGB);\r\n for (int n = 0; n < biNegro.getHeight(); n++) {\r\n for (int n1 = 0; n1 < biNegro.getWidth(); n1++) {\r\n Color color = new Color(0, 0, 0);\r\n biNegro.setRGB(n, n, color.getRGB());\r\n }\r\n }\r\n\r\n BufferedImage bi = herramientas.HerramientasImagen.toBufferedImage(imagenOriginal);\r\n Color color;\r\n\r\n int x, y, aux;\r\n for (y = 0; y < bi.getHeight(); y++) {\r\n for (x = 0; x < bi.getWidth(); x++) {\r\n color = new Color(bi.getRGB(x, y));\r\n\r\n try {\r\n biNegro.setRGB(x, y, color.getRGB());\r\n } catch (Exception e) {\r\n }\r\n\r\n }\r\n }\r\n return herramientas.HerramientasImagen.toImage(biNegro);\r\n\r\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"@Test\r\n public void testDirectMatPainting8UC1() {\n Mat m = new Mat(width, height, CV_8UC1);\r\n assertEquals(1, m.channels());\r\n assertEquals(1, m.capacity());\r\n assertEquals(width, m.step());\r\n assertEquals(width, m.cols());\r\n assertEquals(height, m.rows());\r\n\r\n ByteBuffer bb = m.createBuffer();\r\n for (long i = 0; i < width * height; i++) {\r\n long x = i % width, y = i / width;\r\n // blue to gray:\r\n byte gray = (byte) (pixelFunc(x, y) & 0xff);\r\n bb.put(gray);\r\n }\r\n\r\n // Java's byte is always signed, but opencv seems to treat it as\r\n // unsigned, ie. -1 is maximum luminosity, ie. gray value 255. The total\r\n // (Java byte -> gray value) mapping is then:\r\n // 0..127, -128..-1 -> 0..255\r\n imwrite(new File(TEMP_DIR, \"testDirectMatPainting8UC1.png\").getAbsolutePath(), m);\r\n // @insert:image:testDirectMatPainting8UC1.png@\r\n }",
"public FImage inverse() {\n\t\tfinal int cs = real.getCols();\n\t\tfinal int rs = real.getRows();\n\n\t\tfinal FloatFFT_2D fft = new FloatFFT_2D(rs, cs);\n\t\tfinal float[][] prepared = new float[rs][cs * 2];\n\t\tfor (int y = 0; y < rs; y++) {\n\t\t\tfor (int x = 0; x < cs; x++) {\n\t\t\t\tprepared[y][x * 2] = real.pixels[y][x];\n\t\t\t\tprepared[y][1 + x * 2] = imaginary.pixels[y][x];\n\t\t\t}\n\t\t}\n\n\t\tfft.complexInverse(prepared, true);\n\n\t\tfinal FImage image = new FImage(cs, rs);\n\t\tFourierTransform.unprepareData(prepared, image, centre);\n\n\t\treturn image;\n\t}",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public void codifRLC()\n\t{\n\t\tList<Integer> result= new ArrayList<Integer>();\n\t\tint rgb=0;\n\t\tColor color;\n\t\tint r=0;\n\t\tint ant=-1;\n\t\tint acum=0;\n\t\tfor(int i=this.inicalto;i<=this.alto;i++) {\n\t\t\tfor(int j=this.inicancho;j<=this.ancho;j++)\n\t\t\t{\n\t\t\t\trgb = this.img.getRGB(j, i);\n\t\t\t\tcolor = new Color(rgb, true);\n\t\t\t\tr = color.getRed();\n\t\t\t\t\tif(ant==-1) {\n\t\t\t\t\t\tant=r;\n\t\t\t\t\t\tacum=1;\n\t\t\t\t\t}\n\t\t\t\t\t\tif(r==ant && acum<256)\n\t\t\t\t\t\t\tacum++;\n\t\t\t\t\t\t\tif(r!=ant){\n\t\t\t\t\t\t\t\tresult.add(ant);\n\t\t\t\t\t\t\t\tresult.add(acum);\n\t\t\t\t\t\t\t\tacum=1;\n\t\t\t\t\t\t\t\tant=r;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(acum==255){\n\t\t\t\t\t\t\t\t\tresult.add(ant);\n\t\t\t\t\t\t\t\t\tresult.add(acum);\n\t\t\t\t\t\t\t\t\tacum=1;\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tresult.add(ant);\n\t\tresult.add(acum);\n\t\t\n\t\tthis.CR=new CabeceraRLC(this.inicancho,this.inicalto,this.ancho,this.alto,img.TYPE_INT_RGB);\n\t\tthis.codResultRLC=result;\n\t\tthis.generarArchivoRLC(result);\n\t}",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public Pic greyscale() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Gets average of red, green, and blue values\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n current.setRed(average);\n current.setGreen(average);\n current.setBlue(average);\n }\n }\n return output;\n }"
] | [
"0.8128961",
"0.77349806",
"0.7620562",
"0.752106",
"0.75151896",
"0.7513888",
"0.72435457",
"0.7153744",
"0.67653495",
"0.6580388",
"0.6521188",
"0.6467524",
"0.6343182",
"0.6178535",
"0.61166066",
"0.5785107",
"0.56902254",
"0.5659768",
"0.56292313",
"0.546083",
"0.545965",
"0.545965",
"0.5399696",
"0.53686684",
"0.533552",
"0.5213228",
"0.51938933",
"0.5113888",
"0.5101996",
"0.5018706",
"0.5011367",
"0.49897712",
"0.4989587",
"0.49539208",
"0.49520403",
"0.49490675",
"0.4945404",
"0.49043357",
"0.4892652",
"0.48723063",
"0.4868462",
"0.4774583",
"0.47632796",
"0.47576055",
"0.47512043",
"0.47489682",
"0.47278288",
"0.47260135",
"0.47134894",
"0.471085",
"0.4708377",
"0.4688351",
"0.46820164",
"0.46717018",
"0.46692818",
"0.46679607",
"0.4654095",
"0.46452335",
"0.462507",
"0.46213064",
"0.45834878",
"0.45773876",
"0.45718512",
"0.45681256",
"0.45481092",
"0.45435125",
"0.4515928",
"0.45017526",
"0.4486165",
"0.446741",
"0.4460949",
"0.44594732",
"0.44570524",
"0.44530985",
"0.44386682",
"0.4435865",
"0.44354677",
"0.44289386",
"0.44213128",
"0.4420907",
"0.44088778",
"0.44061932",
"0.44021773",
"0.43973672",
"0.43944803",
"0.43919176",
"0.43918145",
"0.43906277",
"0.43903023",
"0.4387646",
"0.43796015",
"0.4378901",
"0.4375129",
"0.4368071",
"0.4363429",
"0.43586907",
"0.43532062",
"0.4338863",
"0.43354118",
"0.4323251"
] | 0.81740344 | 0 |
Converts a ColorImage to a RealColorImage. | public static RealColorImage toRealColor(ColorImage img) {
int X = img.X();
int Y = img.Y();
float[] color = new float[3];
int[] icolor = new int[3];
RealColorImage newimg = null;
newimg = new RealColorImage(X, Y);
newimg.setColorModel(img.getColorModel());
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
icolor = img.get(x, y);
color[0] = (float) icolor[0];
color[1] = (float) icolor[1];
color[2] = (float) icolor[2];
newimg.set(x, y, color);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public abstract RGBFColor toRGBFColor();",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public abstract RGBIColor toRGBColor();",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"private static BufferedImage colorBird(final BufferedImage refImage,\n final Color color) {\n \n final BufferedImage image = new BufferedImage(BIRD_WIDTH,\n BIRD_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n \n final Color bright = color.brighter().brighter();\n final Color dark = color.darker().darker();\n \n for (int y = 0; y < BIRD_HEIGHT; ++y){\n for (int x = 0; x < BIRD_WIDTH; ++x) {\n int argb = refImage.getRGB(x, y);\n if (argb == 0xffe0802c)\n argb = dark.getRGB();\n else if (argb == 0xfffad78c)\n argb = bright.getRGB();\n else if (argb == 0xfff8b733)\n argb = color.getRGB();\n image.setRGB(x, y, argb);\n }\n } \n return image;\n }",
"void colorize(ObservableValue<? extends Number> ov, Number old_val,\n Number new_val, Color color, BufferedImage myBufferedImage,\n ImageView myImage) {\n double coefColor = (new_val.doubleValue() / 100 + 0.5)\n / (old_val.doubleValue() / 100 + 0.5);\n this.colorizer.setChangeColor(color);\n this.colorizer.setRatio(coefColor);\n myBufferedImage = Utils.clone(this.colorizer.process(myBufferedImage));\n myImage.setImage(SwingFXUtils.toFXImage(myBufferedImage, null));\n }",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"Picture colourComponentImage() throws Exception;",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }",
"public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public static BufferedImage convertToBufferedImage(Image in)\n throws Exception {\n\n Image argb32Image;\n if (in.getFormat() == Format.ARGB32) {\n argb32Image = in;\n } else {\n argb32Image = convert(in, Format.ARGB32);\n }\n\n ConvertorToBufferedImage convertor = Conversion\n .getConvertorToBufferedImage(Format.ARGB32);\n if (convertor == null) {\n throw new UnsupportedFormatException(\"Cannot convert from \"\n + Format.ARGB32 + \" to BufferedImage\");\n }\n return convertor.convert(argb32Image);\n }",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"public HTColorImage(BufferedImage bImage)\n\t{\n\t\tif (bImage == null)\n\t\t{\n\t\t\tthrow new HTException(\"Image is null\");\n\t\t}\t\n\t\timg = HTUtil.getCopy(bImage);\n\t}",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"public void updateImage(ColorImage newImage) {\n currentImage.push(newImage);\n }",
"public interface ColorRemoteService extends RemoteService {\n\n /**\n * Returns color RGB value in hex from its canonical value.\n *\n * @param canonical canonical color, e.g., {@code \"red\"}\n * @return its RGB equivalent, e.g., {@code \"FF0000\"} or if canonical name is invalid, an empty\n * string\n */\n String getRGB(String canonical);\n\n /**\n * Returns canonical name corresponding to an RGB color.\n *\n * @param rgb RGB triplet, e.g., {@code \"FF0000\"}\n * @return canonical name, e.g., {@code \"red\"} or if RGB triplet if there is no such name\n */\n String getCanonicalName(String rgb);\n}",
"public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"public static BufferedImage createBufferedImage(Dimension fieldSize, int color)\n {\n // Creates the image\n BufferedImage image = new BufferedImage(fieldSize.width, fieldSize.height, BufferedImage.TYPE_INT_ARGB);\n\n // For every pixels of the image\n for(int x = 0; x < fieldSize.width; x++)\n {\n for(int y = 0; y < fieldSize.height; y++)\n {\n // Set the pixel black\n image.setRGB(x, y, color);\n }\n }\n return image;\n }",
"private void redGradient(BufferedImage myBufferedImage, ImageView myImage) {\n gradientPainter.setGradientColor(Color.RED);\n BufferedImage img = gradientPainter.process(myBufferedImage);\n myImage.setImage(SwingFXUtils.toFXImage(img, null));\n }",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"public static BufferedImage toBufferedImage(Image image) {\n\t\tif (image instanceof BufferedImage) {\n\t\t\treturn (BufferedImage) image;\n\t\t}\n\n\t\t// This code ensures that all the pixels in the image are loaded\n\t\timage = new ImageIcon(image).getImage();\n\n\t\t// Determine if the image has transparent pixels; for this method's\n\t\t// implementation, see Determining If an Image Has Transparent Pixels\n\t\tboolean hasAlpha = false; // hasAlpha(image);\n\n\t\t// Create a buffered image with a format that's compatible with the\n\t\t// screen\n\t\tBufferedImage bimage = null;\n\t\tGraphicsEnvironment ge = GraphicsEnvironment\n\t\t\t\t.getLocalGraphicsEnvironment();\n\t\ttry {\n\t\t\t// Determine the type of transparency of the new buffered image\n\t\t\tint transparency = Transparency.OPAQUE;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttransparency = Transparency.BITMASK;\n\t\t\t}\n\n\t\t\t// Create the buffered image\n\t\t\tGraphicsDevice gs = ge.getDefaultScreenDevice();\n\t\t\tGraphicsConfiguration gc = gs.getDefaultConfiguration();\n\t\t\tbimage = gc.createCompatibleImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), transparency);\n\t\t} catch (HeadlessException e) {\n\t\t\t// The system does not have a screen\n\t\t}\n\n\t\tif (bimage == null) {\n\t\t\t// Create a buffered image using the default color model\n\t\t\tint type = BufferedImage.TYPE_INT_RGB;\n\t\t\tif (hasAlpha) {\n\t\t\t\ttype = BufferedImage.TYPE_INT_ARGB;\n\t\t\t}\n\t\t\tbimage = new BufferedImage(image.getWidth(null), image\n\t\t\t\t\t.getHeight(null), type);\n\t\t}\n\n\t\t// Copy image to buffered image\n\t\tGraphics g = bimage.createGraphics();\n\n\t\t// Paint the image onto the buffered image\n\t\tg.drawImage(image, 0, 0, null);\n\t\tg.dispose();\n\n\t\treturn bimage;\n\t}",
"public static BufferedImage toBufferedImage(Image image) {\r\n if (image instanceof BufferedImage) {\r\n return (BufferedImage) image;\r\n }\r\n\r\n // This code ensures that all the pixels in the image are loaded\r\n image = new ImageIcon(image).getImage();\r\n\r\n // Determine if the image has transparent pixels; for this method's\r\n // implementation, see Determining If an Image Has Transparent Pixels\r\n boolean hasAlpha = true;\r\n\r\n // Create a buffered image with a format that's compatible with the screen\r\n BufferedImage bimage = null;\r\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\r\n try {\r\n // Determine the type of transparency of the new buffered image\r\n int transparency = Transparency.OPAQUE;\r\n if (hasAlpha) {\r\n transparency = Transparency.BITMASK;\r\n }\r\n\r\n // Create the buffered image\r\n GraphicsDevice gs = ge.getDefaultScreenDevice();\r\n GraphicsConfiguration gc = gs.getDefaultConfiguration();\r\n bimage = gc.createCompatibleImage(\r\n image.getWidth(null), image.getHeight(null), transparency);\r\n } catch (HeadlessException e) {\r\n // The system does not have a screen\r\n }\r\n\r\n if (bimage == null) {\r\n // Create a buffered image using the default color model\r\n int type = BufferedImage.TYPE_INT_RGB;\r\n if (hasAlpha) {\r\n type = BufferedImage.TYPE_INT_ARGB;\r\n }\r\n bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);\r\n }\r\n\r\n // Copy image to buffered image\r\n Graphics g = bimage.createGraphics();\r\n\r\n // Paint the image onto the buffered image\r\n g.drawImage(image, 0, 0, null);\r\n g.dispose();\r\n\r\n return bimage;\r\n }",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public int getRed(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int red = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n red = bdata[0] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n red = sdata[0]&0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n red = idata[0];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[0] != 8) {\n int shift = nBits[0] - 8;\n red = ((shift > 0) \n ? (red>>shift)\n : (red<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (red*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return red;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n // Not TYPE_GRAY or TYPE_RGB ColorSpace\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[0] * 255.0f);\n }",
"@Override\n public native Color getPixelColor(int x, int y);",
"protected abstract float[] getRgbLut();",
"private BufferedImage initImg() throws IOException {\n\t\tint h = 256, w = 256;\n\t\tBufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB);\n\t\t\n\t\t//int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000;\n\t\tshort max = 0, min = 255, c = max;\n\t\tint color = SimpleImageViewer.getIntPixel(c, c, c);\n\t\t\n\t\tfor (int y = 0; y < h; y++) {\n\t\t\tfor (int x = 0; x < w; x++) {\n\t\t\t\timg.setRGB(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn img;\n\t}",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"public RGBColor getColor(){\r\n return this._color;\r\n }",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"void greyscale();",
"void greyscale();",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"abstract Color getColor();",
"RGB getNewColor();",
"public void toRed(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"public native boolean transformRgbImage(int colorspace)\n\t\t\tthrows MagickException;",
"java.awt.Color getColor();",
"public static BufferedImage toImage(VImage vImage) {\n BufferedImage image = new BufferedImage(vImage.getWidth(), vImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n System.arraycopy(vImage.getData(), 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0,\n vImage.getWidth() * vImage.getHeight() * 3);\n return image;\n }",
"public IsColor getColorTo() {\n\t\treturn ColorBuilder.parse(getColorToAsString());\n\t}",
"public static Color fromRGB(int color) {\n\t\treturn Color.rgb(color & 0xFF, (color >> 8) & 0xFF, (color >> 16) & 0xFF);\n\t}",
"public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}",
"BufferedImage getImage(Mat mat){\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR);\n\n //Hue Saturation Lighting to Blue Green Red values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR);\n\n //Re-reverses Blue and Red color values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB);\n\n //Sets colors to grayscale\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY);\n\n\n getSpace(mat);\n WritableRaster raster = img.getRaster();\n DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer();\n byte[] data = dataBuffer.getData();\n mat.get(0, 0, data);\n return img;\n }",
"public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }",
"@Override\n public void setColor(Color newColor) {\n BufferedImage bufferedImage;\n try {\n bufferedImage = ImageIO.read(new URL(this.pieceType.getFileName2D()));\n BufferedImage coloredImage = colorImage(bufferedImage,newColor);\n Image image = SwingFXUtils.toFXImage(coloredImage, null);\n view = new ImageView(image);\n\n //these are temporary\n view.setFitHeight(80);\n view.setFitWidth(80);\n\n } catch (IOException e) {\n System.err.println(\"Error with creating the buffered image\");\n e.printStackTrace();\n }\n }",
"public static double getRGBColorDifference1(int color, int color2) {\r\n if (color == color2) {\r\n return 0;\r\n }\r\n Color c = new Color(color);\r\n Color c2 = new Color(color2);\r\n int dif0 = c.getRed() - c2.getRed();\r\n int dif1 = c.getGreen() - c2.getGreen();\r\n int dif2 = c.getBlue() - c2.getBlue();\r\n return Math.sqrt(dif0 * dif0 + dif1 * dif1 + dif2 * dif2);\r\n }",
"public HTColorImage(HTColorImage htImage)\n\t{\n\t\timg = HTUtil.getCopy(htImage.getImage());\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}"
] | [
"0.8266217",
"0.8046225",
"0.8005178",
"0.80040234",
"0.7923148",
"0.778031",
"0.7536891",
"0.73371065",
"0.70539135",
"0.6772653",
"0.67209786",
"0.66422063",
"0.6574405",
"0.65192604",
"0.65088266",
"0.6485194",
"0.6306829",
"0.6239488",
"0.61997956",
"0.61568946",
"0.61566806",
"0.6057457",
"0.59491014",
"0.5864546",
"0.5615546",
"0.5575875",
"0.5508488",
"0.54953784",
"0.5456911",
"0.5441762",
"0.5431394",
"0.5417515",
"0.5410779",
"0.5395523",
"0.53829074",
"0.53812575",
"0.53805053",
"0.53793526",
"0.5341195",
"0.5326902",
"0.5318695",
"0.5309554",
"0.5271738",
"0.5222995",
"0.5222458",
"0.52140635",
"0.52073973",
"0.5199961",
"0.5193127",
"0.5192231",
"0.5178029",
"0.5173947",
"0.5173627",
"0.5171988",
"0.5170788",
"0.5155245",
"0.5151614",
"0.51491356",
"0.5131828",
"0.51247126",
"0.5120816",
"0.5116496",
"0.5097518",
"0.5072895",
"0.50642145",
"0.5049277",
"0.5048346",
"0.50407076",
"0.5038366",
"0.5037621",
"0.50248265",
"0.5021479",
"0.50126165",
"0.5010748",
"0.5010748",
"0.5009968",
"0.5001664",
"0.4998525",
"0.4988976",
"0.49876583",
"0.4974099",
"0.49681193",
"0.49602732",
"0.49599496",
"0.49529865",
"0.49478358",
"0.49466375",
"0.4941871",
"0.49386075",
"0.4920655",
"0.49157116",
"0.49108735",
"0.49062732",
"0.4900961",
"0.48873252",
"0.48740685",
"0.48727775",
"0.48635194",
"0.4859561",
"0.48585013"
] | 0.8526883 | 0 |
Converts a RealColorImage to a RealColorImage | public static RealColorImage toRealColor(RealColorImage img) {
int X = img.X();
int Y = img.Y();
RealColorImage newimg = null;
newimg = new RealColorImage(X, Y);
newimg.setColorModel(img.getColorModel());
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
newimg.set(x, y, img.get(x, y));
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public abstract RGBFColor toRGBFColor();",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public abstract RGBIColor toRGBColor();",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"private native int grayToRgb(byte src[],int dst[]);",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"void greyscale();",
"void greyscale();",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private BufferedImage getRGBImage (BufferedImage orig) {\n\tBufferedImage newImage = \n\t new BufferedImage (orig.getWidth (), orig.getHeight (), \n\t\t\t BufferedImage.TYPE_3BYTE_BGR);\n\ttry {\n\t Graphics g2 = newImage.getGraphics (); \n\t try {\n\t\tg2.setColor (Color.WHITE);\n\t\tg2.fillRect (0, 0, orig.getWidth (), orig.getHeight ());\n\t\tg2.drawImage (orig, 0, 0, null);\n\t } finally {\n\t\tg2.dispose ();\n\t }\n\t} finally {\n\t orig.flush ();\n\t}\n\treturn newImage;\n }",
"private void pix2img() {\r\n int g;\r\n img = new BufferedImage(pixels[0].length, pixels.length, BufferedImage.TYPE_INT_ARGB);\r\n // copy the pixels values\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length; ++col) {\r\n g = pixels[row][col];\r\n img.setRGB(col, row, ((255 << 24) | (g << 16) | (g << 8) | g));\r\n }\r\n }\r\n }",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public void toRed(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"public static BufferedImage toBufferedImage(final Image img) {\n if (img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n BufferedImage bimage = new BufferedImage(\n img.getWidth(null),\n img.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n return bimage;\n }",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"protected abstract void toSpace( float[] rgb );",
"protected abstract float[] getRgbLut();",
"public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"Picture colourComponentImage() throws Exception;",
"private BufferedImage initImg() throws IOException {\n\t\tint h = 256, w = 256;\n\t\tBufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB);\n\t\t\n\t\t//int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000;\n\t\tshort max = 0, min = 255, c = max;\n\t\tint color = SimpleImageViewer.getIntPixel(c, c, c);\n\t\t\n\t\tfor (int y = 0; y < h; y++) {\n\t\t\tfor (int x = 0; x < w; x++) {\n\t\t\t\timg.setRGB(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn img;\n\t}",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }",
"private static BufferedImage toBufferedImage(final Image image) {\n final BufferedImage buffered = new BufferedImage(image.getWidth(null),\n image.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n buffered.getGraphics().drawImage(image, 0, 0, null);\n return buffered;\n }",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static BufferedImage toBufferedImage(Image img)\n {\n if (img instanceof BufferedImage)\n {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Draw the image on to the buffered image\n Graphics bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static BufferedImage convertToBufferedImage(Image in)\n throws Exception {\n\n Image argb32Image;\n if (in.getFormat() == Format.ARGB32) {\n argb32Image = in;\n } else {\n argb32Image = convert(in, Format.ARGB32);\n }\n\n ConvertorToBufferedImage convertor = Conversion\n .getConvertorToBufferedImage(Format.ARGB32);\n if (convertor == null) {\n throw new UnsupportedFormatException(\"Cannot convert from \"\n + Format.ARGB32 + \" to BufferedImage\");\n }\n return convertor.convert(argb32Image);\n }",
"public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"private static BufferedImage colorBird(final BufferedImage refImage,\n final Color color) {\n \n final BufferedImage image = new BufferedImage(BIRD_WIDTH,\n BIRD_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n \n final Color bright = color.brighter().brighter();\n final Color dark = color.darker().darker();\n \n for (int y = 0; y < BIRD_HEIGHT; ++y){\n for (int x = 0; x < BIRD_WIDTH; ++x) {\n int argb = refImage.getRGB(x, y);\n if (argb == 0xffe0802c)\n argb = dark.getRGB();\n else if (argb == 0xfffad78c)\n argb = bright.getRGB();\n else if (argb == 0xfff8b733)\n argb = color.getRGB();\n image.setRGB(x, y, argb);\n }\n } \n return image;\n }",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"void colorize(ObservableValue<? extends Number> ov, Number old_val,\n Number new_val, Color color, BufferedImage myBufferedImage,\n ImageView myImage) {\n double coefColor = (new_val.doubleValue() / 100 + 0.5)\n / (old_val.doubleValue() / 100 + 0.5);\n this.colorizer.setChangeColor(color);\n this.colorizer.setRatio(coefColor);\n myBufferedImage = Utils.clone(this.colorizer.process(myBufferedImage));\n myImage.setImage(SwingFXUtils.toFXImage(myBufferedImage, null));\n }",
"public static BufferedImage convertImageToBufferedImage(Image image)\n {\n // Convert Image to BufferedImage\n BufferedImage bImage = new BufferedImage(image.getWidth(null),\n image.getHeight(null),\n BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = bImage.createGraphics();\n g2d.drawImage(image, 0, 0, null);\n g2d.dispose();\n\n return bImage;\n }",
"public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"public static BufferedImage toBufferedImage(final Image img, final int type) {\n if (img == null || img instanceof BufferedImage) {\n return (BufferedImage) img;\n }\n\n // Create a buffered image with transparency\n final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), type);\n\n // Draw the image on to the buffered image\n final Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n // Return the buffered image\n return bimage;\n }",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"public static BufferedImage convert(Grid grid, float minVal, float maxVal, int voidColor) {\n GridToImageOperator op = new GridToImageOperator(null, minVal, maxVal);\n op.setVoidColor(voidColor);\n op.operate(grid);\n return op.getImage();\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"public static VImage toVImage(BufferedImage image) {\n if (image.getType() != BufferedImage.TYPE_3BYTE_BGR) {\n throw new IllegalArgumentException(\"Only BufferedImages of type TYPE_3BYTE_BGR can currently be converted to VImage\");\n }\n\n byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n return ValueFactory.newVImage(image.getHeight(), image.getWidth(), buffer);\n }",
"private Color pixelColor(int i, int j, int res) {\r\n\t\tCamera camera = _scene.get_camera();\r\n\t\tColor background = _scene.get_background();\r\n\t\tdouble distance = _scene.get_screenDistance();\r\n\t\tdouble width = _imageWriter.getWidth();\r\n\t\tdouble height = _imageWriter.getHeight();\r\n\r\n\t\tint nX = _imageWriter.getNx();\r\n\t\tint nY = _imageWriter.getNy();\r\n\r\n\t\tRay ray = camera.constructRayThroughPixel((int) (nX * res), (int) (nY * res), j, i, distance, width, height);\r\n\t\tGeoPoint closestPoint = findClosestIntersection(ray);\r\n\t\tif (closestPoint == null)\r\n\t\t\treturn background;\r\n\r\n\t\telse\r\n\t\t\treturn calcColor(closestPoint, ray);\r\n\r\n\t}",
"public BufferedImage convertToBimage(int[][][] TmpArray) {\n\n int width = TmpArray.length;\n int height = TmpArray[0].length;\n\n BufferedImage tmpimg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int a = TmpArray[x][y][0];\n int r = TmpArray[x][y][1];\n int g = TmpArray[x][y][2];\n int b = TmpArray[x][y][3];\n\n //set RGB value\n\n int p = (a << 24) | (r << 16) | (g << 8) | b;\n tmpimg.setRGB(x, y, p);\n\n }\n }\n return tmpimg;\n }",
"RGB getNewColor();",
"public void image_toGrey(int my_id) {\n int y1;\n //int offset = size;\n int myInitRow = (int)(((float)my_id/(float)nThreads)*((float)height/2.0f));\n int nextThreadRow = (int)(((float)(my_id+1)/(float)nThreads)*((float)height/2.0f));\n int myEnd, myOff;\n myOff = 2*width*myInitRow;\n myEnd = 2*width*nextThreadRow;\n for(int i=myOff; i < myEnd;i++) {\n y1 = data[i]&0xff;\n image[i] = 0xff000000 | (y1<<16) | (y1<<8) | y1;\n }\n }",
"public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }",
"BufferedImage getImage(Mat mat){\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR);\n\n //Hue Saturation Lighting to Blue Green Red values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR);\n\n //Re-reverses Blue and Red color values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB);\n\n //Sets colors to grayscale\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY);\n\n\n getSpace(mat);\n WritableRaster raster = img.getRaster();\n DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer();\n byte[] data = dataBuffer.getData();\n mat.get(0, 0, data);\n return img;\n }",
"ImagePlus getRGBResultImage(double[] values,int width,int height){\r\n \t\tImagePlus tempImage = new ImagePlus(\"Visual results\");\r\n \t\ttempImage.setProcessor(new FloatProcessor(width,height,values));\r\n \t\tnew ImageConverter(tempImage).convertToRGB();\r\n \t\treturn tempImage;\r\n \t}",
"public BufferedImage transpose(BufferedImage img) {\n if (img == null) {\n return null;\n }\n BufferedImage sink = new BufferedImage(img.getHeight(), img.getWidth(), img.getType());\n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = new Color(img.getRGB(j, i));\n sink.setRGB(i, j, color.getRGB());\n }\n }\n return sink;\n }",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public void ToImage(){\n\t\tint row=SL.length;\n\t\tint col=SL[0].length;\n\t\tint cr=0;\n\t\tint cb=0;\n\t\t// System.out.println(row+\" \"+col);\n\t\tint[] intArray = new int[3*row*col];\n\t\tint w=row;\n\t int h=col;\n\t BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);\n\t\tint pixel = 0;\n\t\tfor(int x=0;x<row;x++){\n\t\t\tfor(int y=0;y<col;y++){\n\t\t\t\tint rByte = (int)(SL[x][y]);\n\t\t int gByte = (int)(SL[x][y]);\n\t\t int bByte = (int)(SL[x][y]);\n\t\t \n\t\t // int rByte = (int)(SL[x][y]+1.402*(cr-128));\n\t\t // int gByte = (int)(SL[x][y]-0.3414*(cb-128)-0.71414*(cr-128));\n\t\t // int bByte = (int)(SL[x][y]+1.772*(cb-128));\n\t\t int rgb = (rByte *65536) + (gByte * 256) + bByte;\n\t\t image.setRGB(x,y,rgb);\n\t \t}\n\t\t}\n\t try {\n\t ImageIO.write(image, \"bmp\", new File(\"\"+picture_num+\".png\"));\n\t } catch (Exception e) {\n\t e.printStackTrace();\n\t }\n\t}",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public void updateImage(ColorImage newImage) {\n currentImage.push(newImage);\n }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public static BufferedImage toImage(VImage vImage) {\n BufferedImage image = new BufferedImage(vImage.getWidth(), vImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n System.arraycopy(vImage.getData(), 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0,\n vImage.getWidth() * vImage.getHeight() * 3);\n return image;\n }",
"@Override\n public native Color getPixelColor(int x, int y);",
"BufferedImage getImage();",
"BufferedImage getImage();",
"BufferedImage getImage();",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public HTColorImage(BufferedImage bImage)\n\t{\n\t\tif (bImage == null)\n\t\t{\n\t\t\tthrow new HTException(\"Image is null\");\n\t\t}\t\n\t\timg = HTUtil.getCopy(bImage);\n\t}",
"private static Image Transform1ColorToTransparency2ToColors(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor1,\n\t\t\tfinal Color c5, final Color c6, final int otherColor2){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\t\tfinal int r5 = c5.getRed();\n\t\tfinal int g5 = c5.getGreen();\n\t\tfinal int b5 = c5.getBlue();\n\t\tfinal int r6 = c6.getRed();\n\t\tfinal int g6 = c6.getGreen();\n\t\tfinal int b6 = c6.getBlue();\n\n\t\tfinal ImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor1;\n\t\t}\n\t\tif (r >= r5 && r <= r6 &&\n\t\t\t\tg >= g5 && g <= g6 &&\n\t\t\t\tb >= b5 && b <= b6){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor2;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }",
"public static BufferedImage copyImage(final BufferedImage original) {\r\n\t\tif (original==null) return new BufferedImage(0,0,BufferedImage.TYPE_4BYTE_ABGR);\r\n\t\tfinal ColorModel cm=original.getColorModel();\r\n\t\tboolean isAlphaPremultiplied=cm.isAlphaPremultiplied();\r\n\t\tfinal WritableRaster raster=original.copyData(null);\r\n\t\treturn new BufferedImage(cm,raster,isAlphaPremultiplied,null);\r\n\t}"
] | [
"0.8454933",
"0.8141358",
"0.8123837",
"0.81220204",
"0.80963147",
"0.76031613",
"0.7497332",
"0.7171662",
"0.70333153",
"0.6803495",
"0.6774284",
"0.6751344",
"0.6679906",
"0.6557685",
"0.6475548",
"0.6383899",
"0.6343021",
"0.6318003",
"0.63014793",
"0.62806773",
"0.615159",
"0.61472315",
"0.6055813",
"0.58696896",
"0.5842877",
"0.5828521",
"0.5826468",
"0.5826468",
"0.5813544",
"0.57245916",
"0.5719401",
"0.5688662",
"0.5685711",
"0.562763",
"0.55656826",
"0.55562544",
"0.5550447",
"0.55345386",
"0.5508474",
"0.55057085",
"0.55009913",
"0.5489485",
"0.54878455",
"0.5474516",
"0.5468624",
"0.5466465",
"0.54565716",
"0.545331",
"0.5451549",
"0.54499304",
"0.54223704",
"0.54075646",
"0.5390865",
"0.5390441",
"0.5390311",
"0.5384666",
"0.5373709",
"0.53664225",
"0.5364893",
"0.5363747",
"0.535644",
"0.5355454",
"0.53381777",
"0.53314227",
"0.5328602",
"0.5323374",
"0.5320099",
"0.5307215",
"0.5306136",
"0.5305288",
"0.5303209",
"0.5295331",
"0.52761626",
"0.5274264",
"0.523251",
"0.5222632",
"0.52137816",
"0.5200385",
"0.5199217",
"0.51865673",
"0.5184791",
"0.517976",
"0.517107",
"0.5163656",
"0.5163271",
"0.51536715",
"0.5127976",
"0.5108684",
"0.5088971",
"0.5082672",
"0.5081953",
"0.5078119",
"0.5074188",
"0.5074188",
"0.5074188",
"0.5062567",
"0.50605375",
"0.50502235",
"0.50371426",
"0.5033091"
] | 0.8505006 | 0 |
Converts a ComplexImage to a RealColorImage. Uses only the real plane of the complex image. | public static RealColorImage toRealColor(ComplexImage img) {
int X = img.X();
int Y = img.Y();
RealColorImage newimg = null;
newimg = new RealColorImage(X, Y);
float[] color = new float[3];
float gray;
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
gray = img.getReal(x, y);
color[0] = gray;
color[1] = gray;
color[2] = gray;
newimg.set(x, y, color);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex(float real, float imag) {\n this.re = real;\n this.im = imag;\n }",
"Complex(double r, double i) {\n real = r;\n imag = i;\n }",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public ComplexNumber(double real, double imaginary) {\n this.real = real;\n this.imaginary = imaginary;\n }",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public Complex(double real, double imaginary) {\r\n this.real = real;\r\n this.imaginary = imaginary;\r\n }",
"public Complex(double real, double imaginary) {\n r = real;\n i = imaginary;\n }",
"public static ComplexNumber fromReal(double real) {\n\t\treturn new ComplexNumber(real, 0);\n\t}",
"public ComplexNumber(double real, double imaginary) {\n\t\tsuper();\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"Complex() {\n real = 0.0;\n imag = 0.0;\n }",
"public MComplex(MReal real) {\r\n\t\ta = r = real.getValue();\r\n\t\tb = phi = 0;\r\n\t\tpolar = cartesian = true;\r\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public ComplexNumber(ComplexNumber cn) {\n\t\treal = cn.getReal();\n\t\timag = cn.getImag();\n\t}",
"public Complex(double real, double imaginary) {\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public static ComplexNumber fromImaginary(double imaginary) {\n\t\treturn new ComplexNumber(0, imaginary);\n\t}",
"public ComplexNumber(double re, double im) {\n\t\treal = re;\n\t\timag = im;\n\t}",
"public FImage inverse() {\n\t\tfinal int cs = real.getCols();\n\t\tfinal int rs = real.getRows();\n\n\t\tfinal FloatFFT_2D fft = new FloatFFT_2D(rs, cs);\n\t\tfinal float[][] prepared = new float[rs][cs * 2];\n\t\tfor (int y = 0; y < rs; y++) {\n\t\t\tfor (int x = 0; x < cs; x++) {\n\t\t\t\tprepared[y][x * 2] = real.pixels[y][x];\n\t\t\t\tprepared[y][1 + x * 2] = imaginary.pixels[y][x];\n\t\t\t}\n\t\t}\n\n\t\tfft.complexInverse(prepared, true);\n\n\t\tfinal FImage image = new FImage(cs, rs);\n\t\tFourierTransform.unprepareData(prepared, image, centre);\n\n\t\treturn image;\n\t}",
"public Complex(double real, double imag) {\r\n this.real_part = real;\r\n this.imaginary_part = imag;\r\n }",
"RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public abstract RGBFColor toRGBFColor();",
"public ComplexFrame toComplexFrame(float[] fftValues) {\n int length = resolution / 2 + 1;\n float[] real = new float[length];\n float[] imag = new float[length];\n\n //bin 0 and n/2 always have an imaginary value of 0\n real[0] = fftValues[0];\n imag[0] = 0;\n real[length - 1] = fftValues[1];\n imag[length - 1] = 0;\n for (int i = 1; i < resolution / 2; i++) {\n real[i] = fftValues[2 * i];\n imag[i] = fftValues[2 * i + 1];\n }\n return new ComplexFrame(real, imag);\n }",
"public ComplexNumber(double re, double im) {\r\n this.re = re;\r\n this.im = im;\r\n }",
"boolean equals (ComplexNum c) //compares two complex numbers and produces\n {\n\tif (c.real == real && im == c.im)\n\t return true;\n\treturn false;\n }",
"public Complex(double r, double i){\r\n\t\tthis.setReal(r);\r\n\t\tthis.setImag(i);\r\n setCounter();\r\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void getVal(Complex c) {\n\t\tc.re =re;\n\t\tc.im = im;\n\t}",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"public Complex(double re, double im) {\n this.re = re;\n this.im = im;\n }",
"public Complex multiply(Complex complex) {\r\n double real =\r\n this.real_part * complex.real_part - this.imaginary_part\r\n * complex.imaginary_part;\r\n double imag =\r\n this.real_part * complex.imaginary_part + this.imaginary_part\r\n * complex.real_part;\r\n return new Complex(real, imag);\r\n }",
"public Complex(Complex c) {\n r = c.r;\n i = c.i;\n }",
"public Complex() {\r\n real = 0;\r\n imaginary = 0;\r\n }",
"public void mul(Complex c){\n\t\tdouble tempRe = re*c.getRe() - im*c.getIm();\n\t\tim = im*c.getRe() + re*c.getIm();\n\t\tre = tempRe;\n\t}",
"public Complex multiply(Complex param) {\r\n\t\tMyDouble r1r2 = this.getReal().multiply(param.getReal());\r\n\t\tMyDouble r1i2 = this.getReal().multiply(param.getImag());\r\n\t\tMyDouble i1r2 = this.getImag().multiply(param.getReal());\r\n\t\tMyDouble i1i2 = this.getImag().multiply(param.getImag());\r\n\t\tMyDouble prodImg = MyDouble.zero.subtract(i1i2);\r\n\t\tMyDouble sum1 = r1r2.add(prodImg);\r\n\t\tMyDouble sum2 = r1i2.add(i1r2);\r\n\t\tComplex multiplyed = new Complex(sum1, sum2);\r\n\t\treturn multiplyed;\r\n\t}",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public Complex_Number(double realPart,double imaginaryPart)\n {\n this(realPart,imaginaryPart,1);\n }",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"private Complex nextRandomComplex() {\n return new Complex(rand.nextDouble() - 0.5, rand.nextDouble() - 0.5);\n }",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex getComplex() {return this;}",
"@Override\r\n public int compareTo(Complex o) {\r\n if (this.getReal() == o.getReal()) {\r\n return Double.compare(this.getImaginary(), o.getImaginary());\r\n } else {\r\n return Double.compare(this.getReal(), o.getReal());\r\n }\r\n }",
"public Complex(double real) {\n this(real, 0);\n }",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"void showComplex(ImagePlus impl,double pValue, double rCutoff){\n RegionBoundaryAnalyzer cRBA=CommonMethods.buildRegionComplex(impl,pValue);\n ArrayList<RegionComplexNode> cvComplexes=cRBA.m_cvComplexNodes;\n int len=cvComplexes.size(),i;\n ArrayList<Roi> cvROIs=new ArrayList();\n ImageShape cIS;\n for(i=0;i<len;i++){\n cIS=cRBA.getRegionComplexShape(cvComplexes.get(i));\n cvROIs.add(ImageShapeHandler.getRoi(cIS));\n }\n RoiHighlighter.addRoi(impl, cvROIs);\n RoiHighlighter.highLight();\n }",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public void setVal(Complex c) {\n\t\tif (c == null) {\n\t\t\tthis.re = 0;\n\t\t\tthis.im = 0;\n\t\t}\n\t\telse {\n\t\t\tthis.re = c.re;\n\t\t\tthis.im = c.im;\n\t\t}\n\t}",
"public ComplexNum copy() {\n /*\n * returns a deep copy of this complex number\n * */\n\n return new ComplexNum(realPart, imaginaryPart);\n }",
"public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }",
"public ComplexNumber mul(ComplexNumber c) {\n\t\tdouble real = getReal() * c.getReal();\n\t\treal -= getImaginary() * c.getImaginary();\n\n\t\tdouble imaginary = getReal() * c.getImaginary();\n\t\timaginary += c.getReal() * getImaginary();\n\n\t\treturn new ComplexNumber(real, imaginary);\n\t}",
"public void testComplex2() {\n Scalar scalar = GCD.of(ComplexScalar.of(9, 3), ComplexScalar.of(123, 9));\n assertEquals(scalar, ComplexScalar.of(-3, 3));\n }",
"public void add(Complex c){\n\t\tre += c.getRe();\n\t\tim += c.getIm();\n\t}",
"public Complex plus(Complex a){\n float real = this.re + a.re;\n float imag = this.im + a.im;\n return new Complex(real, imag);\n }",
"void greyscale();",
"void greyscale();",
"private double[][] normalize255(RealMatrix realMatrix) {\n\t\tdouble[][] input = realMatrix.getData();\n\t\tdouble[][] normalized = new double[realMatrix.getRowDimension()][realMatrix.getColumnDimension()];\n\t\tdouble minimum = 99999.99;\n\t\tdouble maximum = -9999.99;\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tminimum = Math.min(minimum, input[i][j]);\n\t\t\t\tmaximum = Math.max(maximum, input[i][j]);\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i < realMatrix.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < realMatrix.getColumnDimension(); j++) {\n\t\t\t\tnormalized[i][j] = ((input[i][j] - minimum)*(255/(maximum-minimum)));\n\t\t\t}\n\t\t}\n\t\treturn normalized;\n\t}",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public Complex subtract(Complex complex) {\r\n double real = this.real_part - complex.real_part;\r\n double imag = this.imaginary_part - complex.imaginary_part;\r\n return new Complex(real, imag);\r\n }",
"public final Constant complex_constant() throws RecognitionException {\r\n Constant constant = null;\r\n\r\n\r\n LLVMParser.structure_constant_return structure_constant192 =null;\r\n\r\n LLVMParser.array_constant_return array_constant193 =null;\r\n\r\n LLVMParser.vector_constant_return vector_constant194 =null;\r\n\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:5: ( structure_constant | array_constant | vector_constant )\r\n int alt266=3;\r\n switch ( input.LA(1) ) {\r\n case 93:\r\n {\r\n alt266=1;\r\n }\r\n break;\r\n case 49:\r\n {\r\n alt266=2;\r\n }\r\n break;\r\n case 46:\r\n {\r\n alt266=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 266, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt266) {\r\n case 1 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:7: structure_constant\r\n {\r\n pushFollow(FOLLOW_structure_constant_in_complex_constant7999);\r\n structure_constant192=structure_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.structure, (structure_constant192!=null?input.toString(structure_constant192.start,structure_constant192.stop):null));\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1060:7: array_constant\r\n {\r\n pushFollow(FOLLOW_array_constant_in_complex_constant8009);\r\n array_constant193=array_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.array, (array_constant193!=null?input.toString(array_constant193.start,array_constant193.stop):null));\r\n\r\n }\r\n break;\r\n case 3 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1061:7: vector_constant\r\n {\r\n pushFollow(FOLLOW_vector_constant_in_complex_constant8019);\r\n vector_constant194=vector_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.vector, (vector_constant194!=null?input.toString(vector_constant194.start,vector_constant194.stop):null));\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return constant;\r\n }",
"public Complex minus(Complex a) {\n float real = this.re - a.re;\n float imag = this.im - a.im;\n return new Complex(real, imag);\n }",
"public Complex(String cStr){\r\n\t\tthis(cStr.replaceAll(\" \", \"\").split(\"(?=\\\\+)|(?=\\\\-)\")); // splits cStr at + or - into an array of strings having two elements\r\n\t\t// The first element of the resultant array will be the real portion, \r\n\t\t// while the second is the imaginary portion. This array is passed to the next constructor.\r\n\t}",
"public RealNumber(float realNumber){\n\t\t//set value\n\t\tthis.realNumber = realNumber;\n\t}",
"public int[][][] rescaleImage(int[][][] image, float scale) {\r\n int height = image[0].length;\r\n int width = image.length;\r\n BufferedImage result = new BufferedImage(width, height, 1);\r\n //loop through all pixels.\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n int a = image[x][y][0];\r\n int r = image[x][y][1];\r\n int g = image[x][y][2];\r\n int b = image[x][y][3];\r\n\r\n r = (int) (r * scale);\r\n g = (int) (g * scale);\r\n b = (int) (b * scale);\r\n\r\n image[x][y][0] = a;\r\n image[x][y][1] = r;\r\n image[x][y][2] = g;\r\n image[x][y][3] = b;\r\n }\r\n }\r\n return image; //return array\r\n }",
"public abstract BufferedImage transform();",
"public Complex divide(Complex param) {\r\n\t\tMyDouble ac = this.getReal().multiply(param.getReal());\r\n\t\tMyDouble bd = this.getImag().multiply(param.getImag());\r\n\t\tMyDouble sum1 = ac.add(bd);\r\n\t\tMyDouble cSquar = param.getReal().square();\r\n\t\tMyDouble dSquar = param.getImag().square();\r\n\t\tMyDouble cd = cSquar.add(dSquar);\r\n\t\tMyDouble real1 = sum1.divide(cd);\r\n\t\tMyDouble bc = this.getImag().multiply(param.getReal());\r\n\t\tMyDouble ad = this.getReal().multiply(param.getImag());\r\n\t\tMyDouble bcMinsad = bc.subtract(ad);\r\n\t\tMyDouble image1 = bcMinsad.divide(cd);\r\n\t\tComplex divided = new Complex(real1, image1);\r\n\t\treturn divided;\r\n\t}",
"public ComplexVariable(double re, double im) {\n\t\tthis.re = re;\n\t\tthis.im = im;\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex add(Complex complex) {\r\n double real = this.real_part + complex.real_part;\r\n double imag = this.imaginary_part + complex.imaginary_part;\r\n return new Complex(real, imag);\r\n }",
"public MComplex() {\r\n\t\ta = b = r = phi = 0;\r\n\t\tcartesian = polar = true;\r\n\t}",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"static PointDouble complex(double r, double arg) {\n return new PointDouble(r * Math.cos(arg), r * Math.sin(arg));\n }",
"public static BufferedImage imageToBufferedImage(Image image) {\r\n BufferedImage bufImageARGB = SwingFXUtils.fromFXImage(image, null);\r\n BufferedImage bufImageRGB = new BufferedImage(bufImageARGB.getWidth(), \r\n bufImageARGB.getHeight(), BufferedImage.OPAQUE);\r\n\r\n Graphics2D graphics = bufImageRGB.createGraphics();\r\n graphics.drawImage(bufImageARGB, 0, 0, null);\r\n \r\n graphics.dispose();\r\n \r\n return bufImageRGB;\r\n }",
"public void multiply(Complex other) {\n double r = (this.real * other.real) - (this.imag * other.imag);\n double i = (this.real * other.imag) + (this.imag * other.real);\n this.real = r;\n this.imag = i;\n }",
"public void transform() {\r\n\r\n\t\tint x, y, i;\r\n\t\tComplex[] row = new Complex[width];\r\n\t\tfor (x = 0; x < width; ++x)\r\n\t\t\trow[x] = new Complex();\r\n\t\tComplex[] column = new Complex[height];\r\n\t\tfor (y = 0; y < height; ++y)\r\n\t\t\tcolumn[y] = new Complex();\r\n\r\n\t\tint direction;\r\n\t\tif (spectral)\r\n\t\t\tdirection = -1; // inverse transform\r\n\t\telse\r\n\t\t\tdirection = 1; // forward transform\r\n\r\n\t\t// Perform FFT on each row\r\n\r\n\t\tfor (y = 0; y < height; ++y) {\r\n\t\t\tfor (i = y * width, x = 0; x < width; ++x, ++i) {\r\n\t\t\t\trow[x].re = data[i].re;\r\n\t\t\t\trow[x].im = data[i].im;\r\n\t\t\t}\r\n\t\t\treorder(row, width);\r\n\t\t\tfft(row, width, log2w, direction);\r\n\t\t\tfor (i = y * width, x = 0; x < width; ++x, ++i) {\r\n\t\t\t\tdata[i].re = row[x].re;\r\n\t\t\t\tdata[i].im = row[x].im;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Perform FFT on each column\r\n\r\n\t\tfor (x = 0; x < width; ++x) {\r\n\t\t\tfor (i = x, y = 0; y < height; ++y, i += width) {\r\n\t\t\t\tcolumn[y].re = data[i].re;\r\n\t\t\t\tcolumn[y].im = data[i].im;\r\n\t\t\t}\r\n\t\t\treorder(column, height);\r\n\t\t\tfft(column, height, log2h, direction);\r\n\t\t\tfor (i = x, y = 0; y < height; ++y, i += width) {\r\n\t\t\t\tdata[i].re = column[y].re;\r\n\t\t\t\tdata[i].im = column[y].im;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (spectral)\r\n\t\t\tspectral = false;\r\n\t\telse\r\n\t\t\tspectral = true;\r\n\r\n\t}",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"public abstract RGBIColor toRGBColor();",
"private Complex2[][] imgWithOtherMagnitude(Complex2[][] img_1, Complex2[][] img_2) {\n Complex2[][] result = new Complex2[M][N];\n\n for(int x = 0; x < M; x++) {\n for (int y = 0; y < N; y++) {\n double img_1Magnitude = img_1[x][y].Betrag();\n double img_2Phase = img_2[x][y].Phase();\n\n double newReal = img_1Magnitude * Math.cos(img_2Phase);\n double newImag = img_1Magnitude * Math.sin(img_2Phase);\n\n result[x][y] = new Complex2(newReal, newImag);\n }\n }\n\n return result;\n }",
"RealConstant createRealConstant();"
] | [
"0.7576511",
"0.750887",
"0.7417605",
"0.7365594",
"0.7285409",
"0.70667523",
"0.70044553",
"0.70002806",
"0.6931345",
"0.6879771",
"0.68603826",
"0.6692845",
"0.659409",
"0.6461868",
"0.6146472",
"0.6077373",
"0.6050742",
"0.58781105",
"0.57560164",
"0.5649987",
"0.55791146",
"0.55432487",
"0.5529746",
"0.54895824",
"0.5469699",
"0.5423619",
"0.5397037",
"0.53970224",
"0.5383638",
"0.53740335",
"0.5356531",
"0.5334178",
"0.5324275",
"0.53089213",
"0.5280687",
"0.52110636",
"0.52030003",
"0.5133205",
"0.51114",
"0.5107293",
"0.5084734",
"0.505632",
"0.50468767",
"0.5041662",
"0.49386612",
"0.49313828",
"0.48944655",
"0.48851287",
"0.48791626",
"0.48721758",
"0.48531556",
"0.4829545",
"0.47867113",
"0.47524574",
"0.47318792",
"0.47221458",
"0.47203153",
"0.4667758",
"0.4638018",
"0.46344548",
"0.460167",
"0.45830503",
"0.45806628",
"0.45538387",
"0.4544924",
"0.45444465",
"0.45403853",
"0.45397165",
"0.4539393",
"0.453211",
"0.4517908",
"0.45153248",
"0.4513665",
"0.45083287",
"0.45055822",
"0.45020857",
"0.45020857",
"0.4499239",
"0.44955322",
"0.4468404",
"0.44650063",
"0.4459745",
"0.44529107",
"0.44464168",
"0.44352236",
"0.44324902",
"0.44299626",
"0.4425927",
"0.4425123",
"0.4417874",
"0.44082716",
"0.4403134",
"0.43954986",
"0.43939272",
"0.439243",
"0.43886256",
"0.43729824",
"0.43639785",
"0.43579358",
"0.4357144"
] | 0.8557981 | 0 |
Converts a GrayImage to a ComplexImage | public static ComplexImage toComplex(GrayImage img) {
int X = img.X();
int Y = img.Y();
float gray;
ComplexImage newimg = new ComplexImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
gray = (float) img.get(x, y);
newimg.setReal(x, y, gray);
newimg.setImag(x, y, 0f);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"void greyscale();",
"void greyscale();",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public static Mat invert(JPEGCategory[] input) {\n\t\tdouble[] data = new double[64];\n\t\tint k = 0;\n\t\t\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tdouble[] subArr = convertToDouble(input[i]);\n\t\t\tfor (int j = 0; j < subArr.length; j++) {\n\t\t\t\tdata[k] = subArr[j];\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble[] newData = { \n\t\t\t data[0], data[1], data[5], data[6], data[14], data[15], data[27], data[28], \n\t\t\t data[2], data[4], data[7], data[13], data[16], data[26], data[29], data[42], \n\t\t\t data[3], data[8], data[12], data[17], data[25], data[30], data[41], data[43], \n\t\t\t data[9], data[11], data[18], data[24], data[31], data[40], data[44], data[53], \n\t\t\tdata[10], data[19], data[23], data[32], data[39], data[45], data[52], data[54], \n\t\t\tdata[20], data[22], data[33], data[38], data[46], data[51], data[55], data[60], \n\t\t\tdata[21], data[34], data[37], data[47], data[50], data[56], data[59], data[61], \n\t\t\tdata[35], data[36], data[48], data[49], data[57], data[58], data[62], data[63] \n\t\t};\n\n\t\tMat result = new Mat(8, 8, CvType.CV_64FC1);\n\t\tresult.put(0, 0, newData);\n\t\treturn result;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"@Test\n public void testGray16BitIntoRGB() {\n BufferedImage im16bit = new BufferedImage(100, 100, BufferedImage.TYPE_USHORT_GRAY);\n WritableRaster raster16bit = im16bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 1000);\n raster16bit.setSamples(0, 0, 100, 50, 0, fill);\n Arrays.fill(fill, 30000);\n raster16bit.setSamples(0, 50, 100, 50, 0, fill);\n\n // mosaic setting the nodata\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData1000 = RangeFactory.create(1000, 1000);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im16bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData1000, null }, null);\n\n // RenderedImageBrowser.showChain(mosaic);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow (nodata in the gray one)\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be yellow (nodata in the gray one)\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom left quadrant, should be 30000 scaled down to byte\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 117, 117, 117 }, pixel);\n // check bottom right quadrant, should be 30000 scaled down to byte\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 117, 117, 117 }, pixel);\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public abstract BufferedImage transform();",
"public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private Image bitmap2JPEG(Bitmap bit) {\n\n Image baseImage = new Image();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bit.compress(Bitmap.CompressFormat.JPEG, 90, stream);\n byte[] imageBytes = stream.toByteArray();\n baseImage.encodeContent(imageBytes);\n\n return baseImage;\n }",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexNumber fromImaginary(double imaginary) {\n\t\treturn new ComplexNumber(0, imaginary);\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public native MagickImage enhanceImage() throws MagickException;",
"Compress(double[][][] Image){\n \n /** Step 1 */\n R1 = new Reduce(Image);\n A1 = R1.Nearest(2);\n // A1 = R1.Bilinear(2);\n \n /** Step 2 */ \n R2 = new Reduce(A1);\n A2 = R2.Nearest(2);\n //A2 = R2.Bilinear(2);\n \n /** Step 3 */\n R3 = new Reduce(A2);\n A3 = R3.Nearest(2);\n //A3 = R3.Bilinear(2);\n \n /** Step 4 */\n R4 = new Reduce(A3);\n A4 = R4.Nearest(2);\n //A4 = R4.Bilinear(2);\n\n }",
"BufferedImage outputImage();",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"int[][][] greyscaleImage(int[][][] imageArray, int height, int width);",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"public Bitmap toGrayscale(Bitmap bmpOriginal)\n\t { \n\t int width, height;\n\t height = bmpOriginal.getHeight();\n\t width = bmpOriginal.getWidth(); \n\n\t Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);\n\t Canvas c = new Canvas(bmpGrayscale);\n\t Paint paint = new Paint();\n\t ColorMatrix cm = new ColorMatrix();\n\t cm.setSaturation(0);\n\t ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n\t paint.setColorFilter(f);\n\t c.drawBitmap(bmpOriginal, 0, 0, paint);\n\t return bmpGrayscale;\n\t }",
"public static Image filtroGrisRojo(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red;\n red = color.getRed();\n red *= 255;\n pixelw.setColor(j, i, Color.rgb((int)red, (int)red, (int)red));\n }\n }\n \n return resultImg;\n }",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"public static void convert( ImageBase input, ImageBase output ) {\n\n\t\tImageType typeIn = input.getImageType();\n\t\tImageType typeOut = output.getImageType();\n\n\t\tif (input instanceof ImageGray) {\n\t\t\tImageGray sb = (ImageGray)input;\n\t\t\tif (output instanceof ImageGray) {\n\t\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\t\toutput.setTo(input);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (output instanceof Planar) {\n\t\t\t\tPlanar ms = (Planar)output;\n\t\t\t\tfor (int i = 0; i < ms.getNumBands(); i++) {\n\t\t\t\t\tconvert(input, ms.getBand(i));\n\t\t\t\t}\n\t\t\t} else if (output instanceof ImageInterleaved) {\n\t\t\t\tImageInterleaved il = (ImageInterleaved)output;\n\t\t\t\tfor (int i = 0; i < il.getNumBands(); i++) {\n\t\t\t\t\tGImageMiscOps.insertBand(sb, i, il);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageInterleaved) {\n\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\toutput.setTo(input);\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageGray) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mi.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mi.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mi, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mi, so);\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageInterleaved) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof Planar) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tPlanar mo = (Planar)output;\n\n\t\t\tif (mi.getBandType() == mo.getBandType()) {\n\t\t\t\tmo.setTo(mi);\n\t\t\t} else {\n\t\t\t\tfor (int i = 0; i < mi.getNumBands(); i++) {\n\t\t\t\t\tconvert(mi.getBand(i), mo.getBand(i));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof Planar) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageGray) {\n\t\t\tImageInterleaved mb = (ImageInterleaved)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mb.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mb.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mb, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mb, so);\n\t\t\t}\n\t\t} else {\n\t\t\tString nameInput = input.getClass().getSimpleName();\n\t\t\tString nameOutput = output.getClass().getSimpleName();\n\t\t\tthrow new IllegalArgumentException(\"Don't know how to convert between input types. \" + nameInput + \" \" + nameOutput);\n\t\t}\n\t}",
"public static Image toGreyscale(Image image) {\n\t\tWritableImage processedImage = new WritableImage(\n\t\t\t\t(int) image.getWidth(), (int) image.getHeight());\n\t\t\n\t\tPixelReader pr = image.getPixelReader();\n\t\tPixelWriter pw = processedImage.getPixelWriter();\n\t\t\n\t\t// Iterates through every pixel in the image\n\t\tfor (int y = 0; y < image.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < image.getWidth(); x++) {\n\t\t\t\t\n\t\t\t\t// Gets the average red, green, and blue values of the pixel\n\t\t\t\tColor pixelColor = pr.getColor(x, y);\n\t\t\t\tdouble pixelRed = pixelColor.getRed();\n\t\t\t\tdouble pixelGreen = pixelColor.getGreen();\n\t\t\t\tdouble pixelBlue = pixelColor.getBlue();\n\t\t\t\tdouble pixelGrey = (pixelRed + pixelGreen + pixelBlue) / 3;\n\t\t\t\t\n\t\t\t\t// Sets the pixel's red, green, and blue values to the same average value.\n\t\t\t\tColor greyColor = new Color(pixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelGrey,\n\t\t\t\t\t\t\t\t\t\t\tpixelColor.getOpacity());\n\t\t\t\t\n\t\t\t\tpw.setColor(x, y, greyColor);\n\t\t\t}\n\t\t}\n\t\treturn processedImage;\n\t}",
"Picture binaryComponentImage() throws Exception;",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public static GrayImage toGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toGray((ComplexImage) img);\n\t\t}\n\t}",
"public native boolean isGrayImage() throws MagickException;",
"@Override\n public byte[] compress(byte[] imagen) {\n ResetVarC();\n /*\n Declaraciones de variables\n */\n char[] imagenaux = new char[imagen.length];\n for (int j = 0; j < imagen.length; j++) {\n imagenaux[j] = (char) (imagen[j] & 0xFF);\n }\n\n getWidthandHeight(imagenaux);\n\n imagenYCbCr = new int[height][width][3];\n for (int i = 0; i < height; ++i) {\n for (int j = 0; j < width; ++j) {\n int[] RGB = {(int) imagenaux[iterator], (int) imagenaux[iterator + 1], (int) imagenaux[iterator + 2]};\n imagenYCbCr[i][j] = RGBtoYCbCr(RGB);\n iterator += 3;\n }\n }\n\n CreateCompression();\n\n\n Huffman comprimirY = new Huffman();\n Huffman comprimirCB = new Huffman();\n Huffman comprimirCR = new Huffman();\n\n String Yen = comprimirY.compressHuffman(Yencoding);\n String Cben = comprimirCB.compressHuffman(Cbencoding);\n String Cren = comprimirCR.compressHuffman(Crencoding);\n\n\n Map<Integer, Integer> freqY = comprimirY.getFrequencies();\n Map<Integer, Integer> freqCb = comprimirCB.getFrequencies();\n Map<Integer, Integer> freqCr = comprimirCR.getFrequencies();\n\n\n CreateFreq(freqY, freqCb, freqCr);\n\n return JPEGFile(freqY, freqCb, freqCr, Yen, Cben, Cren);\n }",
"public static int[][] getMatrizBin(BufferedImage img){\n int largura = img.getWidth();\r\n int altura = img.getHeight();\r\n \r\n //Imagem de saida\r\n BufferedImage outImage = new BufferedImage(largura, altura, BufferedImage.TYPE_3BYTE_BGR);\r\n \r\n //matriz de saida\r\n int[][] output = new int[largura][altura];\r\n \r\n //calculando os valores do CIVE\r\n for (int x = 0; x < largura; x++) {\r\n for (int y = 0; y < altura; y++) {\r\n double red = Color.getColor(\"red\", img.getRGB(x, y)).getRed();\r\n double green = Color.getColor(\"green\", img.getRGB(x, y)).getGreen();\r\n \r\n if (green > red ) {\r\n output[x][y] = 1;\r\n } else {\r\n output[x][y] = 0;\r\n }\r\n \r\n }\r\n }\r\n\r\n return output;\r\n }",
"public FourierTransformComplex(FImage image, boolean centre) {\n\t\tthis.centre = centre;\n\n\t\tprocess(image);\n\t}",
"public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }",
"List<List<Pixel>> transform(Image img, String operation);",
"public native MagickImage magnifyImage() throws MagickException;",
"@Test\n public void testGrayExpandNoData() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n // and now a ushort one, top half 1000, bottom half 30000\n BufferedImage im16bit = new BufferedImage(100, 100, BufferedImage.TYPE_USHORT_GRAY);\n WritableRaster raster16bit = im16bit.getRaster();\n Arrays.fill(fill, 1000);\n raster16bit.setSamples(0, 0, 100, 50, 0, fill);\n Arrays.fill(fill, 30000);\n raster16bit.setSamples(0, 50, 100, 50, 0, fill);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n Range noData1000 = RangeFactory.create(1000, 1000);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, im16bit },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, noData1000 }, null);\n\n // RenderedImageBrowser.showChain(mosaic);\n\n assertGray(mosaic, DataBuffer.TYPE_USHORT);\n\n // check top left quadrant, should 0, the output nodata\n int[] pixel = new int[1];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 0 }, pixel);\n // check top right quadrant, should be 50 expanded to ushort\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 12850 }, pixel);\n // check bottom left quadrant, should be 30000\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 30000 }, pixel);\n // check bottom right quadrant, should be 50 expanded to ushort\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 12850 }, pixel);\n }",
"private Complex2[][] imgWithOtherMagnitude(Complex2[][] img_1, Complex2[][] img_2) {\n Complex2[][] result = new Complex2[M][N];\n\n for(int x = 0; x < M; x++) {\n for (int y = 0; y < N; y++) {\n double img_1Magnitude = img_1[x][y].Betrag();\n double img_2Phase = img_2[x][y].Phase();\n\n double newReal = img_1Magnitude * Math.cos(img_2Phase);\n double newImag = img_1Magnitude * Math.sin(img_2Phase);\n\n result[x][y] = new Complex2(newReal, newImag);\n }\n }\n\n return result;\n }",
"public static BufferedImage toGrayScale(BufferedImage img) {\n BufferedImage grayscale = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());\n for (int i = 0; i < img.getWidth(); ++i) {\n for (int j = 0; j < img.getHeight(); ++j) {\n int rgb = img.getRGB(i, j);\n int r = (rgb >> 16) & 255;\n int g = (rgb >> 8) & 255;\n int b = (rgb & 255);\n int graylevel = (int)(0.2125*r + 0.7154*g + 0.0721*b);\n int gray = (graylevel << 16) + (graylevel << 8) + graylevel;\n grayscale.setRGB(i, j, gray);\n }\n }\n return grayscale;\n }",
"public Coloca_imagen(){\n \n \n }",
"void process(Mat image);",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }",
"Image createImage(List<List<Pixel>> pixelArray);",
"public static BufferedImage matrizToImagen(int[][] m) {\n int ancho = m[0].length;\n int alto = m.length;\n BufferedImage image = new BufferedImage(ancho, alto, BufferedImage.TYPE_BYTE_GRAY);\n for (int i = 0; i < alto; i++) {\n for (int j = 0; j < ancho; j++) {\n int gray = m[i][j];\n Color c = new Color(gray, gray, gray);\n image.setRGB(j, i, c.getRGB());\n }\n }\n return image;\n }",
"public static GrayImage toGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) ((double) color[0] * 0.299 + (double) color[1] * 0.587 + (double) color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public void mul(Complex c){\n\t\tdouble tempRe = re*c.getRe() - im*c.getIm();\n\t\tim = im*c.getRe() + re*c.getIm();\n\t\tre = tempRe;\n\t}",
"public native void blobToImage(ImageInfo imageInfo, byte[] blob)\n\t\t\tthrows MagickException;",
"public ComplexNumber(ComplexNumber cn) {\n\t\treal = cn.getReal();\n\t\timag = cn.getImag();\n\t}",
"static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}",
"public BufferedImage RGB2GRAYSCALE() {\r\n\t\t\r\n\t\tdestImg = new BufferedImage(W, H, BufferedImage.TYPE_BYTE_GRAY);\r\n\t\tdestRaster = destImg.getRaster();\r\n\t\t\r\n\t\tfor(int row=0; row < H; row++) {\r\n\t\t\tfor(int col=0; col < W; col++) {\r\n\t\t\t\tfloat gray = 0;\r\n\t\t\t\tfor(int band=0; band<srcRaster.getNumBands(); band++) {\r\n\t\t\t\t\tint sample = srcRaster.getSample(col, row, band);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (band == 0) { //red\r\n\t\t\t\t\t\tgray += 0.299 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (band == 1) {\t//green\r\n\t\t\t\t\t\tgray += 0.587 * sample;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (band == 2) {\t//blue\r\n\t\t\t\t\t\tgray += 0.114 * sample;\r\n\t\t\t\t\t\tgray = Math.round(gray);\r\n\t\t\t\t\t\tdestRaster.setSample(col, row, 0, gray);\t//gray\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn destImg;\r\n\t}",
"public static BinaryMatrix fromImage(BufferedImage image){\n\t\tint height=image.getHeight();\n\t\tint width=image.getWidth();\n\t\t\n\t\tboolean[][] array=new boolean[height][width];\n\t\tfor(int h=0; h<height; h++){\n\t\t\tfor(int w=0; w<width; w++){\n\t\t\t\tif(image.getRGB(w, h)==Constants.COLOR_BLACK)\n\t\t\t\t\tarray[h][w]=true;\n\t\t\t\telse\n\t\t\t\t\tarray[h][w]=false;\n\t\t\t}\n\t\t}\n\t\treturn new BinaryMatrix(array);\n\t}",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"public SbMatrix\ngetObjectToImage( SoNode node) \n//\n////////////////////////////////////////////////////////////////////////\n{\n getMatrix(node);\n return matrixAction.getTextureMatrix();\n}",
"@Test\n public void testGrayFilter() {\n System.out.println(\"grayFilter\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.grayFilter();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"private static double [][][] convertToArray1(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n double [][][] result = new double [width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }",
"public int[][][] rescaleImage(int[][][] image, float scale) {\r\n int height = image[0].length;\r\n int width = image.length;\r\n BufferedImage result = new BufferedImage(width, height, 1);\r\n //loop through all pixels.\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n int a = image[x][y][0];\r\n int r = image[x][y][1];\r\n int g = image[x][y][2];\r\n int b = image[x][y][3];\r\n\r\n r = (int) (r * scale);\r\n g = (int) (g * scale);\r\n b = (int) (b * scale);\r\n\r\n image[x][y][0] = a;\r\n image[x][y][1] = r;\r\n image[x][y][2] = g;\r\n image[x][y][3] = b;\r\n }\r\n }\r\n return image; //return array\r\n }",
"public ComplexNumber(double re, double im) {\r\n this.re = re;\r\n this.im = im;\r\n }",
"public BufferedImage rescaleImage(BufferedImage image, float scale) {\r\n int[][][] arr = convertToArray(image);\r\n return convertToBimage(rescaleImage(arr, scale));//return array\r\n }",
"@Override\r\n\tpublic BufferedImage transform(BufferedImage image){\n\t\tMat mat = Mat2BufImg.BufImg2Mat(image, BufferedImage.TYPE_3BYTE_BGR, CvType.CV_8UC3);\r\n\t\t//人脸识别\r\n\t\ttry {\r\n\t\t\t//mat --> bufferimage\r\n\t\t\treturn Mat2BufImg.Mat2BufImg(detectFace(mat),\".png\");\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn image;\r\n\t}",
"Complex() {\n real = 0.0;\n imag = 0.0;\n }",
"public interface ImageOperation {\n\tpublic Color[][] doOperation(Color[][] imageArray);\n}",
"public Mat2Image() {\n }",
"public Mat convertToEdges(Mat img) {\n\n return img;\n }",
"public static BufferedImage scaleImage(BufferedImage image, double scale){\n\t\tWritableRaster inRaster = image.getRaster();\n\t\t\n\t\tint w = (int)Math.round(image.getWidth() * scale);\n\t\tint h = (int)Math.round(image.getHeight() * scale);\n\t\tWritableRaster outRaster = inRaster.createCompatibleWritableRaster(w, h);\n\t\t\n\t\tObject outData = null;\n\t\tfor(int j=0; j<h; j++){\n\t\t\tfor(int i=0; i<w; i++){\n\t\t\t\toutData = inRaster.getDataElements((int)(i/scale), (int)(j/scale), outData);\n\t\t\t\toutRaster.setDataElements(i, j, outData);\n\t\t\t}\n\t\t}\n\t\t\n\t\tBufferedImage outImage = new BufferedImage(image.getColorModel(), outRaster, image.isAlphaPremultiplied(), null);\n\t\treturn outImage;\n\t}",
"public Mat getConvertedImage() {\n return this.convertedImage;\n }",
"@Test\r\n public void testDirectMatPainting8SC1() {\n Mat m = new Mat(width, height, CV_8SC1);\r\n assertEquals(1, m.channels());\r\n assertEquals(1, m.capacity());\r\n assertEquals(width, m.step());\r\n assertEquals(width, m.cols());\r\n assertEquals(height, m.rows());\r\n\r\n ByteBuffer bb = m.createBuffer();\r\n for (long i = 0; i < width * height; i++) {\r\n long x = i % width, y = i / width;\r\n // blue to gray:\r\n byte gray = (byte) (pixelFunc(x, y) & 0xff);\r\n bb.put(gray);\r\n }\r\n\r\n // negative gray values get ignored/mapped to black/0. The total\r\n // (Java byte -> gray value) mapping is then:\r\n // -128..127 -> 128x 0, 0..127\r\n imwrite(new File(TEMP_DIR, \"testDirectMatPainting8SC1.png\").getAbsolutePath(), m);\r\n // @insert:image:testDirectMatPainting8SC1.png@\r\n }",
"public static BufferedImage convertRGBtoGray(Image image)\n {\n // Converts the Image to a Buffered image\n BufferedImage bfImage = convertImageToBufferedImage(image);\n\n // Gets the main color of the image\n int mainColor = getMainColor(bfImage);\n\n // For every pixels of the image\n for(int x = 0; x < bfImage.getWidth(null); x++)\n {\n for(int y = 0; y < bfImage.getHeight(null); y++)\n {\n // get the pixel\n int pixel = bfImage.getRGB(x, y);\n\n // If the pixel is not the main color, compute its gray value\n if(pixel != mainColor)\n {\n int gray = getGray(pixel);\n bfImage.setRGB(x, y, gray);\n }\n\n // If the pixel is the main color, set it to black\n else\n {\n bfImage.setRGB(x, y, 0xFF000000);\n }\n }\n }\n return bfImage;\n }",
"public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}"
] | [
"0.8140584",
"0.76192933",
"0.74958545",
"0.7409401",
"0.7267628",
"0.7234217",
"0.70498854",
"0.6689444",
"0.6680128",
"0.5827828",
"0.56823575",
"0.56533676",
"0.56522334",
"0.56393266",
"0.5623768",
"0.56230646",
"0.56132334",
"0.56132334",
"0.5581499",
"0.55788094",
"0.5570354",
"0.5521573",
"0.54975164",
"0.5472467",
"0.5452497",
"0.539499",
"0.5362866",
"0.5358565",
"0.53451467",
"0.5337538",
"0.531242",
"0.52976173",
"0.5284248",
"0.5274253",
"0.52669525",
"0.52556545",
"0.5247456",
"0.52413756",
"0.52287996",
"0.5216231",
"0.52090526",
"0.5173012",
"0.50703067",
"0.50665927",
"0.50463337",
"0.50456434",
"0.50275725",
"0.5005028",
"0.4999766",
"0.49926817",
"0.49855483",
"0.49624658",
"0.49568996",
"0.4955994",
"0.49537823",
"0.49510333",
"0.4943079",
"0.4921176",
"0.4918285",
"0.49124837",
"0.48700285",
"0.48678806",
"0.486268",
"0.48607254",
"0.48583624",
"0.48152977",
"0.48026904",
"0.47973993",
"0.4792686",
"0.47921318",
"0.47873354",
"0.4780779",
"0.47807717",
"0.47772062",
"0.4767457",
"0.47610614",
"0.47594526",
"0.4755103",
"0.47549567",
"0.47538403",
"0.47537696",
"0.47327697",
"0.4723543",
"0.47228223",
"0.47213212",
"0.47213197",
"0.47113892",
"0.47038624",
"0.4699044",
"0.4694329",
"0.46937996",
"0.4681158",
"0.46781346",
"0.46767694",
"0.46743587",
"0.4666277",
"0.46622425",
"0.46581894",
"0.46569413",
"0.46428615"
] | 0.81940806 | 0 |
Converts a RealGrayImage to a ComplexImage | public static ComplexImage toComplex(RealGrayImage img) {
int X = img.X();
int Y = img.Y();
float gray;
ComplexImage newimg = new ComplexImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
gray = img.get(x, y);
newimg.setReal(x, y, gray);
newimg.setImag(x, y, 0f);
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexNumber fromImaginary(double imaginary) {\n\t\treturn new ComplexNumber(0, imaginary);\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex(float real, float imag) {\n this.re = real;\n this.im = imag;\n }",
"Complex(double r, double i) {\n real = r;\n imag = i;\n }",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"Complex() {\n real = 0.0;\n imag = 0.0;\n }",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public ComplexNumber(double real, double imaginary) {\n this.real = real;\n this.imaginary = imaginary;\n }",
"public Complex(double real, double imaginary) {\r\n this.real = real;\r\n this.imaginary = imaginary;\r\n }",
"public ComplexNumber(double re, double im) {\n\t\treal = re;\n\t\timag = im;\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public ComplexNumber(double re, double im) {\r\n this.re = re;\r\n this.im = im;\r\n }",
"public ComplexNumber(double real, double imaginary) {\n\t\tsuper();\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public Complex(double real, double imaginary) {\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public Complex(double real, double imaginary) {\n r = real;\n i = imaginary;\n }",
"public Complex(double re, double im) {\n this.re = re;\n this.im = im;\n }",
"public Complex(double real, double imag) {\r\n this.real_part = real;\r\n this.imaginary_part = imag;\r\n }",
"public static ComplexNumber fromReal(double real) {\n\t\treturn new ComplexNumber(real, 0);\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void mul(Complex c){\n\t\tdouble tempRe = re*c.getRe() - im*c.getIm();\n\t\tim = im*c.getRe() + re*c.getIm();\n\t\tre = tempRe;\n\t}",
"public ComplexNumber(ComplexNumber cn) {\n\t\treal = cn.getReal();\n\t\timag = cn.getImag();\n\t}",
"public final Constant complex_constant() throws RecognitionException {\r\n Constant constant = null;\r\n\r\n\r\n LLVMParser.structure_constant_return structure_constant192 =null;\r\n\r\n LLVMParser.array_constant_return array_constant193 =null;\r\n\r\n LLVMParser.vector_constant_return vector_constant194 =null;\r\n\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:5: ( structure_constant | array_constant | vector_constant )\r\n int alt266=3;\r\n switch ( input.LA(1) ) {\r\n case 93:\r\n {\r\n alt266=1;\r\n }\r\n break;\r\n case 49:\r\n {\r\n alt266=2;\r\n }\r\n break;\r\n case 46:\r\n {\r\n alt266=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 266, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt266) {\r\n case 1 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:7: structure_constant\r\n {\r\n pushFollow(FOLLOW_structure_constant_in_complex_constant7999);\r\n structure_constant192=structure_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.structure, (structure_constant192!=null?input.toString(structure_constant192.start,structure_constant192.stop):null));\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1060:7: array_constant\r\n {\r\n pushFollow(FOLLOW_array_constant_in_complex_constant8009);\r\n array_constant193=array_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.array, (array_constant193!=null?input.toString(array_constant193.start,array_constant193.stop):null));\r\n\r\n }\r\n break;\r\n case 3 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1061:7: vector_constant\r\n {\r\n pushFollow(FOLLOW_vector_constant_in_complex_constant8019);\r\n vector_constant194=vector_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.vector, (vector_constant194!=null?input.toString(vector_constant194.start,vector_constant194.stop):null));\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return constant;\r\n }",
"public static void testGrayscale()\n {\n\t Picture wall = new Picture(\"wall.jpg\");\n\t wall.toGrayscale();\n\t wall.explore();\n }",
"public FourierTransformComplex(FImage image, boolean centre) {\n\t\tthis.centre = centre;\n\n\t\tprocess(image);\n\t}",
"public Complex multiply(Complex complex) {\r\n double real =\r\n this.real_part * complex.real_part - this.imaginary_part\r\n * complex.imaginary_part;\r\n double imag =\r\n this.real_part * complex.imaginary_part + this.imaginary_part\r\n * complex.real_part;\r\n return new Complex(real, imag);\r\n }",
"boolean equals (ComplexNum c) //compares two complex numbers and produces\n {\n\tif (c.real == real && im == c.im)\n\t return true;\n\treturn false;\n }",
"void greyscale();",
"void greyscale();",
"public void getVal(Complex c) {\n\t\tc.re =re;\n\t\tc.im = im;\n\t}",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public ComplexFrame toComplexFrame(float[] fftValues) {\n int length = resolution / 2 + 1;\n float[] real = new float[length];\n float[] imag = new float[length];\n\n //bin 0 and n/2 always have an imaginary value of 0\n real[0] = fftValues[0];\n imag[0] = 0;\n real[length - 1] = fftValues[1];\n imag[length - 1] = 0;\n for (int i = 1; i < resolution / 2; i++) {\n real[i] = fftValues[2 * i];\n imag[i] = fftValues[2 * i + 1];\n }\n return new ComplexFrame(real, imag);\n }",
"public Complex multiply(Complex param) {\r\n\t\tMyDouble r1r2 = this.getReal().multiply(param.getReal());\r\n\t\tMyDouble r1i2 = this.getReal().multiply(param.getImag());\r\n\t\tMyDouble i1r2 = this.getImag().multiply(param.getReal());\r\n\t\tMyDouble i1i2 = this.getImag().multiply(param.getImag());\r\n\t\tMyDouble prodImg = MyDouble.zero.subtract(i1i2);\r\n\t\tMyDouble sum1 = r1r2.add(prodImg);\r\n\t\tMyDouble sum2 = r1i2.add(i1r2);\r\n\t\tComplex multiplyed = new Complex(sum1, sum2);\r\n\t\treturn multiplyed;\r\n\t}",
"public Complex conjugate() {\r\n return new Complex(this.getReal(), this.getImag() * -1);\r\n }",
"public void add(Complex c){\n\t\tre += c.getRe();\n\t\tim += c.getIm();\n\t}",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static void main(String[] args) {\n\tComplex c1 = new Complex(1,2);\r\n\tComplex c2 = new Complex(-2,-1);\r\n\t\r\n\t//Calculates the product of c1 and c2\r\n\tComplex product_c1c2 = Complex.multiply(c1, c2);\r\n\tSystem.out.println(\"The product of c1 and c2 is: \"+product_c1c2);\r\n \t\r\n\t//Calculates the ratio of c1 to c2 (c1/c2)\r\n\tComplex ratio_c1c2 = Complex.divide(c1, c2);\r\n\tSystem.out.println(\"The ratio of c1 to c2 is: \"+ratio_c1c2);\r\n\t\r\n\t//Calculates the product of c1 and I\r\n\tComplex product_c1I = Complex.multiply(c1, Complex.I);\r\n\tSystem.out.println(\"The product of c1 and I is: \"+product_c1I);\r\n\t\r\n\t//Calculates the ratio of c1 to 0\r\n\tComplex ratio_c1Zero = Complex.divide(c1, Complex.Zero);\r\n\tSystem.out.println(\"The ratio of c1 and 0 is: \"+ratio_c1Zero);\r\n\t\r\n\t//Calculates the product of c1 with the conjugate of c1\r\n\tComplex c1_conj = Complex.conj(c1);\r\n\tComplex product_c1c1conj = Complex.multiply(c1,c1_conj);\r\n\tSystem.out.println(\"The product of c1 and c1* is: \"+product_c1c1conj);\r\n\t\r\n\t//Calculates the product of c1 with the conjugate of c1\r\n\tComplex c2_conj = Complex.conj(c2);\r\n\tComplex product_c2c2conj = Complex.multiply(c2,c2_conj);\r\n\tSystem.out.println(\"The product of c1 and c1* is: \"+product_c2c2conj);\r\n\t}",
"private void convoluteMatrix(){\n\t\tDoubleFFT_2D fft = new DoubleFFT_2D(CELL_SIDE_COUNT,CELL_SIDE_COUNT);\n\t\tdouble[][] convolutedDoubles = Complex.complexToDoubleArray2D(convolutedMatrix);\n\t\tfft.complexForward(convolutedDoubles);\n\t\tconvolutedMatrix = Complex.doubleToComplexArray2D(convolutedDoubles); //F(B C F^-1(Q)) Pg. 182 Lee[05]\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"void showComplex(ImagePlus impl,double pValue, double rCutoff){\n RegionBoundaryAnalyzer cRBA=CommonMethods.buildRegionComplex(impl,pValue);\n ArrayList<RegionComplexNode> cvComplexes=cRBA.m_cvComplexNodes;\n int len=cvComplexes.size(),i;\n ArrayList<Roi> cvROIs=new ArrayList();\n ImageShape cIS;\n for(i=0;i<len;i++){\n cIS=cRBA.getRegionComplexShape(cvComplexes.get(i));\n cvROIs.add(ImageShapeHandler.getRoi(cIS));\n }\n RoiHighlighter.addRoi(impl, cvROIs);\n RoiHighlighter.highLight();\n }",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public Complex getConjugate() {\n\t\treturn new Complex(real, -imaginary);\n\t}",
"public Complex(String cStr){\r\n\t\tthis(cStr.replaceAll(\" \", \"\").split(\"(?=\\\\+)|(?=\\\\-)\")); // splits cStr at + or - into an array of strings having two elements\r\n\t\t// The first element of the resultant array will be the real portion, \r\n\t\t// while the second is the imaginary portion. This array is passed to the next constructor.\r\n\t}",
"public Complex_Number(double realPart,double imaginaryPart)\n {\n this(realPart,imaginaryPart,1);\n }",
"public Complex() {\r\n real = 0;\r\n imaginary = 0;\r\n }",
"public Complex getComplex() {return this;}",
"public void testComplex2() {\n Scalar scalar = GCD.of(ComplexScalar.of(9, 3), ComplexScalar.of(123, 9));\n assertEquals(scalar, ComplexScalar.of(-3, 3));\n }",
"public MComplex(MReal real) {\r\n\t\ta = r = real.getValue();\r\n\t\tb = phi = 0;\r\n\t\tpolar = cartesian = true;\r\n\t}",
"public void multiply(Complex other) {\n double r = (this.real * other.real) - (this.imag * other.imag);\n double i = (this.real * other.imag) + (this.imag * other.real);\n this.real = r;\n this.imag = i;\n }",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"public static Mat invert(JPEGCategory[] input) {\n\t\tdouble[] data = new double[64];\n\t\tint k = 0;\n\t\t\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tdouble[] subArr = convertToDouble(input[i]);\n\t\t\tfor (int j = 0; j < subArr.length; j++) {\n\t\t\t\tdata[k] = subArr[j];\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble[] newData = { \n\t\t\t data[0], data[1], data[5], data[6], data[14], data[15], data[27], data[28], \n\t\t\t data[2], data[4], data[7], data[13], data[16], data[26], data[29], data[42], \n\t\t\t data[3], data[8], data[12], data[17], data[25], data[30], data[41], data[43], \n\t\t\t data[9], data[11], data[18], data[24], data[31], data[40], data[44], data[53], \n\t\t\tdata[10], data[19], data[23], data[32], data[39], data[45], data[52], data[54], \n\t\t\tdata[20], data[22], data[33], data[38], data[46], data[51], data[55], data[60], \n\t\t\tdata[21], data[34], data[37], data[47], data[50], data[56], data[59], data[61], \n\t\t\tdata[35], data[36], data[48], data[49], data[57], data[58], data[62], data[63] \n\t\t};\n\n\t\tMat result = new Mat(8, 8, CvType.CV_64FC1);\n\t\tresult.put(0, 0, newData);\n\t\treturn result;\n\t}",
"public ComplexVariable(double re, double im) {\n\t\tthis.re = re;\n\t\tthis.im = im;\n\t}",
"public static Complex converter(String arg) {\r\n int real = 0;\r\n int imaginar = 0;\r\n for(int i = 1; i < arg.length(); i++)\r\n if (arg.charAt(i) == '+' || arg.charAt(i) == '-') {\r\n real = Integer.parseInt(arg.substring(0, i));\r\n imaginar = Integer.parseInt(arg.substring(i, arg.length()-1));\r\n }\r\n return new Complex(real, imaginar);\r\n }",
"public void ConvertToGray()\n {\n int in_imgWidth = image.getWidth();\n int in_imgHeight = image.getHeight();\n int i,j;\n Raster in_raster = image.getRaster();\n BufferedImage out_img = new BufferedImage(in_imgWidth, in_imgHeight, \n BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster out_raster = (WritableRaster)out_img.getRaster();\n for(j = 0; j < in_imgHeight; j++)\n {\n for(i = 0; i < in_imgWidth; i++)\n {\n /*int rgb = image.getRGB(i, j);\n int alpha = (rgb >> 24) & 0xFF;\n int red = (rgb >> 16) & 0xFF;\n int green = (rgb >> 8) & 0xFF;\n int blue = (rgb & 0xFF);\n int grayLevel = (red + green + blue)/3;\n int gray = (alpha << 24)|(grayLevel << 16)|(grayLevel << 8)|grayLevel; \n System.out.println(gray);\n out_img.setRGB(i, j, gray);*/\n float gray = (in_raster.getSample(i, j, 0)+\n in_raster.getSample(i, j, 1)+\n in_raster.getSample(i, j, 2))/3;\n out_raster.setSample(i, j, 0, gray);\n }\n }\n out_img.setData(out_raster);\n image = out_img;\n //SaveImage(out_img,\"color\");\n }",
"public void set( int row, int col, double real, double imaginary ) {\n if (imaginary == 0) {\n set(row, col, real);\n } else {\n ops.set(mat, row, col, real, imaginary);\n }\n }",
"public FImage inverse() {\n\t\tfinal int cs = real.getCols();\n\t\tfinal int rs = real.getRows();\n\n\t\tfinal FloatFFT_2D fft = new FloatFFT_2D(rs, cs);\n\t\tfinal float[][] prepared = new float[rs][cs * 2];\n\t\tfor (int y = 0; y < rs; y++) {\n\t\t\tfor (int x = 0; x < cs; x++) {\n\t\t\t\tprepared[y][x * 2] = real.pixels[y][x];\n\t\t\t\tprepared[y][1 + x * 2] = imaginary.pixels[y][x];\n\t\t\t}\n\t\t}\n\n\t\tfft.complexInverse(prepared, true);\n\n\t\tfinal FImage image = new FImage(cs, rs);\n\t\tFourierTransform.unprepareData(prepared, image, centre);\n\n\t\treturn image;\n\t}",
"public ComplexNumber mul(ComplexNumber c) {\n\t\tdouble real = getReal() * c.getReal();\n\t\treal -= getImaginary() * c.getImaginary();\n\n\t\tdouble imaginary = getReal() * c.getImaginary();\n\t\timaginary += c.getReal() * getImaginary();\n\n\t\treturn new ComplexNumber(real, imaginary);\n\t}",
"public double getImaginary() {\r\n return imaginary;\r\n }",
"private Complex nextRandomComplex() {\n return new Complex(rand.nextDouble() - 0.5, rand.nextDouble() - 0.5);\n }",
"public Complex_Number(double realPart,double imaginaryPart,int power)\n {\n this.realPart = realPart;\n this.imaginaryPart = imaginaryPart;\n this.powerOfIi = power;\n }",
"public Complex(double r, double i){\r\n\t\tthis.setReal(r);\r\n\t\tthis.setImag(i);\r\n setCounter();\r\n\t}",
"@Override\r\n public boolean isComplex()\r\n {\n return false;\r\n }",
"private Complex2[][] imgWithOtherMagnitude(Complex2[][] img_1, Complex2[][] img_2) {\n Complex2[][] result = new Complex2[M][N];\n\n for(int x = 0; x < M; x++) {\n for (int y = 0; y < N; y++) {\n double img_1Magnitude = img_1[x][y].Betrag();\n double img_2Phase = img_2[x][y].Phase();\n\n double newReal = img_1Magnitude * Math.cos(img_2Phase);\n double newImag = img_1Magnitude * Math.sin(img_2Phase);\n\n result[x][y] = new Complex2(newReal, newImag);\n }\n }\n\n return result;\n }",
"private Bitmap convertToGrayscale(Bitmap bmpOriginal) {\n int height = bmpOriginal.getHeight();\n int width = bmpOriginal.getWidth();\n Log.e(TAG, \"width=\" + width + \" height=\" + height);//default size is 640*480 px\n Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);//\n Canvas c = new Canvas(bmpGrayscale);\n Paint paint = new Paint();\n ColorMatrix cm = new ColorMatrix();\n cm.setSaturation(0);\n ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);\n paint.setColorFilter(f);\n c.drawBitmap(bmpOriginal, 0, 0, paint);\n return bmpGrayscale;\n }",
"public void add(ComplexNumber one){\n this.real += one.real;\n this.imaginary += one.imaginary;\n }",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"public Complex getConjugate() {\n return new Complex(r, -i);\n }",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public void setVal(Complex c) {\n\t\tif (c == null) {\n\t\t\tthis.re = 0;\n\t\t\tthis.im = 0;\n\t\t}\n\t\telse {\n\t\t\tthis.re = c.re;\n\t\t\tthis.im = c.im;\n\t\t}\n\t}",
"static PointDouble complex(double r, double arg) {\n return new PointDouble(r * Math.cos(arg), r * Math.sin(arg));\n }",
"public Complex(Complex c) {\n r = c.r;\n i = c.i;\n }",
"public Complex plus(Complex a){\n float real = this.re + a.re;\n float imag = this.im + a.im;\n return new Complex(real, imag);\n }",
"private static BufferedImage getGrayScale(BufferedImage inputImage) {\n BufferedImage img = new BufferedImage(inputImage.getWidth(), inputImage.getHeight(),\n BufferedImage.TYPE_BYTE_GRAY);\n Graphics g = img.getGraphics();\n g.drawImage(inputImage, 0, 0, null);\n g.dispose();\n return img;\n }",
"public static GrayImage toGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }",
"public double getImaginary() {\n\t\treturn imaginary;\n\t}",
"public double getImaginary() {\n\t\treturn imaginary;\n\t}",
"private Complex getComplex(double x, double y) {\n return this.mainWindow.getCurrentFractal().getComplexFromPoint(x, y);\n }",
"public final EObject ruleComplexTypeSpecifier() throws RecognitionException {\n EObject current = null;\n\n EObject lv_unit_3_0 = null;\n\n EObject lv_dimensions_6_0 = null;\n\n EObject lv_dimensions_8_0 = null;\n\n\n EObject temp=null; setCurrentLookahead(); resetLookahead(); \n \n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1859:6: ( ( () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:1: ( () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:1: ( () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:2: () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:2: ()\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1861:5: \n {\n \n temp=factory.create(grammarAccess.getComplexTypeSpecifierAccess().getComplexTypeSpecifierAction_0().getType().getClassifier());\n current = temp; \n temp = null;\n CompositeNode newNode = createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getComplexTypeSpecifierAction_0(), currentNode.getParent());\n newNode.getChildren().add(currentNode);\n moveLookaheadInfo(currentNode, newNode);\n currentNode = newNode; \n associateNodeWithAstElement(currentNode, current); \n \n\n }\n\n match(input,36,FOLLOW_36_in_ruleComplexTypeSpecifier3278); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getComplexKeyword_1(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1875:1: ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )?\n int alt26=2;\n int LA26_0 = input.LA(1);\n\n if ( (LA26_0==25) ) {\n alt26=1;\n }\n switch (alt26) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1875:3: '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')'\n {\n match(input,25,FOLLOW_25_in_ruleComplexTypeSpecifier3289); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getLeftParenthesisKeyword_2_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1879:1: ( (lv_unit_3_0= ruleUnitExpression ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1880:1: (lv_unit_3_0= ruleUnitExpression )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1880:1: (lv_unit_3_0= ruleUnitExpression )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1881:3: lv_unit_3_0= ruleUnitExpression\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getUnitUnitExpressionParserRuleCall_2_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleUnitExpression_in_ruleComplexTypeSpecifier3310);\n lv_unit_3_0=ruleUnitExpression();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getComplexTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"unit\",\n \t \t\tlv_unit_3_0, \n \t \t\t\"UnitExpression\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n match(input,26,FOLLOW_26_in_ruleComplexTypeSpecifier3320); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getRightParenthesisKeyword_2_2(), null); \n \n\n }\n break;\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1907:3: ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n int alt28=2;\n int LA28_0 = input.LA(1);\n\n if ( (LA28_0==33) ) {\n alt28=1;\n }\n switch (alt28) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1907:5: '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']'\n {\n match(input,33,FOLLOW_33_in_ruleComplexTypeSpecifier3333); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getLeftSquareBracketKeyword_3_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1911:1: ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1912:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1912:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1913:3: lv_dimensions_6_0= ruleArrayDimensionSpecification\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleComplexTypeSpecifier3354);\n lv_dimensions_6_0=ruleArrayDimensionSpecification();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getComplexTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"dimensions\",\n \t \t\tlv_dimensions_6_0, \n \t \t\t\"ArrayDimensionSpecification\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1935:2: ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )*\n loop27:\n do {\n int alt27=2;\n int LA27_0 = input.LA(1);\n\n if ( (LA27_0==14) ) {\n alt27=1;\n }\n\n\n switch (alt27) {\n \tcase 1 :\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1935:4: ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t {\n \t match(input,14,FOLLOW_14_in_ruleComplexTypeSpecifier3365); \n\n \t createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getCommaKeyword_3_2_0(), null); \n \t \n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1939:1: ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1940:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t {\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1940:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1941:3: lv_dimensions_8_0= ruleArrayDimensionSpecification\n \t {\n \t \n \t \t currentNode=createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_2_1_0(), currentNode); \n \t \t \n \t pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleComplexTypeSpecifier3386);\n \t lv_dimensions_8_0=ruleArrayDimensionSpecification();\n \t _fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = factory.create(grammarAccess.getComplexTypeSpecifierRule().getType().getClassifier());\n \t \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t \t }\n \t \t try {\n \t \t \t\tadd(\n \t \t \t\t\tcurrent, \n \t \t \t\t\t\"dimensions\",\n \t \t \t\tlv_dimensions_8_0, \n \t \t \t\t\"ArrayDimensionSpecification\", \n \t \t \t\tcurrentNode);\n \t \t } catch (ValueConverterException vce) {\n \t \t\t\t\thandleValueConverterException(vce);\n \t \t }\n \t \t currentNode = currentNode.getParent();\n \t \t \n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop27;\n }\n } while (true);\n\n match(input,34,FOLLOW_34_in_ruleComplexTypeSpecifier3398); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getRightSquareBracketKeyword_3_3(), null); \n \n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n resetLookahead(); \n \tlastConsumedNode = currentNode;\n \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }",
"public void transform() {\r\n\r\n\t\tint x, y, i;\r\n\t\tComplex[] row = new Complex[width];\r\n\t\tfor (x = 0; x < width; ++x)\r\n\t\t\trow[x] = new Complex();\r\n\t\tComplex[] column = new Complex[height];\r\n\t\tfor (y = 0; y < height; ++y)\r\n\t\t\tcolumn[y] = new Complex();\r\n\r\n\t\tint direction;\r\n\t\tif (spectral)\r\n\t\t\tdirection = -1; // inverse transform\r\n\t\telse\r\n\t\t\tdirection = 1; // forward transform\r\n\r\n\t\t// Perform FFT on each row\r\n\r\n\t\tfor (y = 0; y < height; ++y) {\r\n\t\t\tfor (i = y * width, x = 0; x < width; ++x, ++i) {\r\n\t\t\t\trow[x].re = data[i].re;\r\n\t\t\t\trow[x].im = data[i].im;\r\n\t\t\t}\r\n\t\t\treorder(row, width);\r\n\t\t\tfft(row, width, log2w, direction);\r\n\t\t\tfor (i = y * width, x = 0; x < width; ++x, ++i) {\r\n\t\t\t\tdata[i].re = row[x].re;\r\n\t\t\t\tdata[i].im = row[x].im;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Perform FFT on each column\r\n\r\n\t\tfor (x = 0; x < width; ++x) {\r\n\t\t\tfor (i = x, y = 0; y < height; ++y, i += width) {\r\n\t\t\t\tcolumn[y].re = data[i].re;\r\n\t\t\t\tcolumn[y].im = data[i].im;\r\n\t\t\t}\r\n\t\t\treorder(column, height);\r\n\t\t\tfft(column, height, log2h, direction);\r\n\t\t\tfor (i = x, y = 0; y < height; ++y, i += width) {\r\n\t\t\t\tdata[i].re = column[y].re;\r\n\t\t\t\tdata[i].im = column[y].im;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (spectral)\r\n\t\t\tspectral = false;\r\n\t\telse\r\n\t\t\tspectral = true;\r\n\r\n\t}",
"public T caseComplexNode(ComplexNode object) {\r\n\t\treturn null;\r\n\t}",
"@Override\r\n public int compareTo(Complex o) {\r\n if (this.getReal() == o.getReal()) {\r\n return Double.compare(this.getImaginary(), o.getImaginary());\r\n } else {\r\n return Double.compare(this.getReal(), o.getReal());\r\n }\r\n }",
"@Test\n public void testGray16BitIntoRGB() {\n BufferedImage im16bit = new BufferedImage(100, 100, BufferedImage.TYPE_USHORT_GRAY);\n WritableRaster raster16bit = im16bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 1000);\n raster16bit.setSamples(0, 0, 100, 50, 0, fill);\n Arrays.fill(fill, 30000);\n raster16bit.setSamples(0, 50, 100, 50, 0, fill);\n\n // mosaic setting the nodata\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData1000 = RangeFactory.create(1000, 1000);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im16bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData1000, null }, null);\n\n // RenderedImageBrowser.showChain(mosaic);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow (nodata in the gray one)\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be yellow (nodata in the gray one)\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom left quadrant, should be 30000 scaled down to byte\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 117, 117, 117 }, pixel);\n // check bottom right quadrant, should be 30000 scaled down to byte\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 117, 117, 117 }, pixel);\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}"
] | [
"0.8203175",
"0.79286426",
"0.7546187",
"0.74606276",
"0.7356178",
"0.7347126",
"0.71912694",
"0.7029324",
"0.6320435",
"0.6265357",
"0.62297976",
"0.61983865",
"0.6148434",
"0.600013",
"0.59273815",
"0.58313185",
"0.5783946",
"0.577646",
"0.5747295",
"0.57461685",
"0.5664116",
"0.56202984",
"0.5565757",
"0.55621564",
"0.5551503",
"0.55439705",
"0.5470714",
"0.5456937",
"0.5446184",
"0.5442104",
"0.5432638",
"0.5421716",
"0.52734673",
"0.5273076",
"0.5272614",
"0.5264081",
"0.5243007",
"0.5239513",
"0.5230621",
"0.5171125",
"0.5163004",
"0.51560706",
"0.51484066",
"0.51351976",
"0.51351976",
"0.5096605",
"0.5081734",
"0.5079889",
"0.50615156",
"0.5046752",
"0.50448203",
"0.5044805",
"0.5010326",
"0.5000726",
"0.50001556",
"0.4984368",
"0.49819058",
"0.49808103",
"0.4966638",
"0.49467847",
"0.49467596",
"0.4935257",
"0.48727092",
"0.48605067",
"0.48402354",
"0.4823716",
"0.48230606",
"0.48114052",
"0.48066097",
"0.48032427",
"0.48015484",
"0.4796519",
"0.47609973",
"0.4726099",
"0.47251567",
"0.47211927",
"0.47205305",
"0.47151563",
"0.4712981",
"0.46998167",
"0.46868303",
"0.46834522",
"0.46777466",
"0.46714857",
"0.46599978",
"0.46525586",
"0.46498293",
"0.46346486",
"0.4630195",
"0.4627355",
"0.46199718",
"0.4613733",
"0.4613733",
"0.46096072",
"0.46043056",
"0.46028063",
"0.45993775",
"0.45848918",
"0.45820987",
"0.45792323"
] | 0.85089844 | 0 |
Converts a ColorImage to a ComplexImage. The ColorImage is first converted to a RealGrayImage object and then to a ComplexImage object. | public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,
ColorModelUnknownException {
int X = img.X();
int Y = img.Y();
int[] color = new int[3];
float real;
ComplexImage newimg = null;
switch (img.getColorModel()) {
case ColorImage.RGB:
newimg = new ComplexImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
color = img.get(x, y);
real = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]
* 0.114f;
newimg.setReal(x, y, real);
newimg.setImag(x, y, 0f);
}
}
break;
case ColorImage.CMY:
case ColorImage.YIQ:
case ColorImage.HSV:
case ColorImage.HLS:
throw new ColorModelNotSupportedException();
default:
throw new ColorModelUnknownException();
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexNumber fromImaginary(double imaginary) {\n\t\treturn new ComplexNumber(0, imaginary);\n\t}",
"public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }",
"public ComplexNumber(double real, double imaginary) {\n this.real = real;\n this.imaginary = imaginary;\n }",
"public ComplexNumber(ComplexNumber cn) {\n\t\treal = cn.getReal();\n\t\timag = cn.getImag();\n\t}",
"public final Constant complex_constant() throws RecognitionException {\r\n Constant constant = null;\r\n\r\n\r\n LLVMParser.structure_constant_return structure_constant192 =null;\r\n\r\n LLVMParser.array_constant_return array_constant193 =null;\r\n\r\n LLVMParser.vector_constant_return vector_constant194 =null;\r\n\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:5: ( structure_constant | array_constant | vector_constant )\r\n int alt266=3;\r\n switch ( input.LA(1) ) {\r\n case 93:\r\n {\r\n alt266=1;\r\n }\r\n break;\r\n case 49:\r\n {\r\n alt266=2;\r\n }\r\n break;\r\n case 46:\r\n {\r\n alt266=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 266, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt266) {\r\n case 1 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:7: structure_constant\r\n {\r\n pushFollow(FOLLOW_structure_constant_in_complex_constant7999);\r\n structure_constant192=structure_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.structure, (structure_constant192!=null?input.toString(structure_constant192.start,structure_constant192.stop):null));\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1060:7: array_constant\r\n {\r\n pushFollow(FOLLOW_array_constant_in_complex_constant8009);\r\n array_constant193=array_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.array, (array_constant193!=null?input.toString(array_constant193.start,array_constant193.stop):null));\r\n\r\n }\r\n break;\r\n case 3 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1061:7: vector_constant\r\n {\r\n pushFollow(FOLLOW_vector_constant_in_complex_constant8019);\r\n vector_constant194=vector_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.vector, (vector_constant194!=null?input.toString(vector_constant194.start,vector_constant194.stop):null));\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return constant;\r\n }",
"Complex(double r, double i) {\n real = r;\n imag = i;\n }",
"public Complex(String cStr){\r\n\t\tthis(cStr.replaceAll(\" \", \"\").split(\"(?=\\\\+)|(?=\\\\-)\")); // splits cStr at + or - into an array of strings having two elements\r\n\t\t// The first element of the resultant array will be the real portion, \r\n\t\t// while the second is the imaginary portion. This array is passed to the next constructor.\r\n\t}",
"private static Image TransformColorToTransparency(BufferedImage image, Color c1, Color c2){\n\t\t\t final int r1 = c1.getRed();\n\t\t\t final int g1 = c1.getGreen();\n\t\t\t final int b1 = c1.getBlue();\n\t\t\t final int r2 = c2.getRed();\n\t\t\t final int g2 = c2.getGreen();\n\t\t\t final int b2 = c2.getBlue();\n\t\t\t ImageFilter filter = new RGBImageFilter()\n\t\t\t {\n\t\t\t public final int filterRGB(int x, int y, int rgb)\n\t\t\t {\n\t\t\t int r = (rgb & 0xFF0000) >> 16;\n\t\t\t int g = (rgb & 0xFF00) >> 8;\n\t\t\t int b = rgb & 0xFF;\n\t\t\t if (r >= r1 && r <= r2 &&\n\t\t\t g >= g1 && g <= g2 &&\n\t\t\t b >= b1 && b <= b2)\n\t\t\t {\n\t\t\t // Set fully transparent but keep color\n\t\t\t return rgb & 0xFFFFFF;\n\t\t\t }\n\t\t\t return rgb;\n\t\t\t }\n\t\t\t };\n\n\t\t\t ImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\t\t return Toolkit.getDefaultToolkit().createImage(ip);\n\t\t\t }",
"public FourierTransformComplex(FImage image, boolean centre) {\n\t\tthis.centre = centre;\n\n\t\tprocess(image);\n\t}",
"public ComplexNumber(double re, double im) {\r\n this.re = re;\r\n this.im = im;\r\n }",
"public ComplexNumber mul(ComplexNumber c) {\n\t\tdouble real = getReal() * c.getReal();\n\t\treal -= getImaginary() * c.getImaginary();\n\n\t\tdouble imaginary = getReal() * c.getImaginary();\n\t\timaginary += c.getReal() * getImaginary();\n\n\t\treturn new ComplexNumber(real, imaginary);\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public ComplexNumber(double real, double imaginary) {\n\t\tsuper();\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public Complex(double real, double imaginary) {\r\n this.real = real;\r\n this.imaginary = imaginary;\r\n }",
"public static ComplexNumber parse(String s) {\n\t\tif (s == null) {\n\t\t\tthrow new NullPointerException(\"The given string is null!\");\n\t\t}\n\t\t// remove all the blank spaces from s\n\t\ts = s.toLowerCase().replaceAll(\" \", \"\");\n\n\t\tif (s.equals(\"i\") || s.equals(\"+i\")){\n\t\t\treturn new ComplexNumber(0, 1);\n\t\t}\n\t\tif (s.equals(\"-i\")){\n\t\t\treturn new ComplexNumber(0, -1);\n\t\t}\n\t\t\n\t\t\n\t\tint endingPosition = 1;\n\t\tint size = s.length();\n\n\t\twhile (endingPosition < size) {\n\t\t\tchar ch = s.charAt(endingPosition);\n\t\t\tif (ch >= '0' && ch <= '9' || ch == '.') {\n\t\t\t\tendingPosition++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tdouble real;\n\t\ttry {\n\t\t\treal = Double.parseDouble(s.substring(0, endingPosition));\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new NumberFormatException(\n\t\t\t\t\"The given number could not be parsed to a Complex Number.\");\n\t\t}\n\n\t\tif (endingPosition == size) {\n\t\t\t// there is no imaginary part of the complex number\n\t\t\treturn ComplexNumber.fromReal(real);\n\t\t} else if (endingPosition == size - 1) {\n\t\t\t// there is no real part of the complex number\n\t\t\treturn ComplexNumber.fromImaginary(real);\n\t\t}\n\n\t\tif (!s.endsWith(\"i\")) {\n\t\t\tthrow new NumberFormatException(\n\t\t\t\t\"The given number could not be parsed to a Complex Number.\");\n\t\t}\n\n\t\ts = s.substring(endingPosition, size - 1);\n\t\tdouble imaginary;\n\n\t\tif (s.equals(\"-\")) {\n\t\t\timaginary = -1;\n\t\t} else if (s.equals(\"+\")) {\n\t\t\timaginary = 1;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\timaginary = Double.parseDouble(s);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tthrow new NumberFormatException(\n\t\t\t\t\t\"The given number could not be parsed to a Complex Number.\");\n\t\t\t}\n\t\t}\n\n\t\treturn new ComplexNumber(real, imaginary);\n\t}",
"public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }",
"public Complex(float real, float imag) {\n this.re = real;\n this.im = imag;\n }",
"public ComplexNumber(double re, double im) {\n\t\treal = re;\n\t\timag = im;\n\t}",
"public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public ComplexFrame toComplexFrame(float[] fftValues) {\n int length = resolution / 2 + 1;\n float[] real = new float[length];\n float[] imag = new float[length];\n\n //bin 0 and n/2 always have an imaginary value of 0\n real[0] = fftValues[0];\n imag[0] = 0;\n real[length - 1] = fftValues[1];\n imag[length - 1] = 0;\n for (int i = 1; i < resolution / 2; i++) {\n real[i] = fftValues[2 * i];\n imag[i] = fftValues[2 * i + 1];\n }\n return new ComplexFrame(real, imag);\n }",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }",
"Complex() {\n real = 0.0;\n imag = 0.0;\n }",
"private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public final EObject ruleComplexTypeSpecifier() throws RecognitionException {\n EObject current = null;\n\n EObject lv_unit_3_0 = null;\n\n EObject lv_dimensions_6_0 = null;\n\n EObject lv_dimensions_8_0 = null;\n\n\n EObject temp=null; setCurrentLookahead(); resetLookahead(); \n \n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1859:6: ( ( () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:1: ( () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:1: ( () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:2: () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:2: ()\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1861:5: \n {\n \n temp=factory.create(grammarAccess.getComplexTypeSpecifierAccess().getComplexTypeSpecifierAction_0().getType().getClassifier());\n current = temp; \n temp = null;\n CompositeNode newNode = createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getComplexTypeSpecifierAction_0(), currentNode.getParent());\n newNode.getChildren().add(currentNode);\n moveLookaheadInfo(currentNode, newNode);\n currentNode = newNode; \n associateNodeWithAstElement(currentNode, current); \n \n\n }\n\n match(input,36,FOLLOW_36_in_ruleComplexTypeSpecifier3278); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getComplexKeyword_1(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1875:1: ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )?\n int alt26=2;\n int LA26_0 = input.LA(1);\n\n if ( (LA26_0==25) ) {\n alt26=1;\n }\n switch (alt26) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1875:3: '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')'\n {\n match(input,25,FOLLOW_25_in_ruleComplexTypeSpecifier3289); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getLeftParenthesisKeyword_2_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1879:1: ( (lv_unit_3_0= ruleUnitExpression ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1880:1: (lv_unit_3_0= ruleUnitExpression )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1880:1: (lv_unit_3_0= ruleUnitExpression )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1881:3: lv_unit_3_0= ruleUnitExpression\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getUnitUnitExpressionParserRuleCall_2_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleUnitExpression_in_ruleComplexTypeSpecifier3310);\n lv_unit_3_0=ruleUnitExpression();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getComplexTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"unit\",\n \t \t\tlv_unit_3_0, \n \t \t\t\"UnitExpression\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n match(input,26,FOLLOW_26_in_ruleComplexTypeSpecifier3320); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getRightParenthesisKeyword_2_2(), null); \n \n\n }\n break;\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1907:3: ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n int alt28=2;\n int LA28_0 = input.LA(1);\n\n if ( (LA28_0==33) ) {\n alt28=1;\n }\n switch (alt28) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1907:5: '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']'\n {\n match(input,33,FOLLOW_33_in_ruleComplexTypeSpecifier3333); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getLeftSquareBracketKeyword_3_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1911:1: ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1912:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1912:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1913:3: lv_dimensions_6_0= ruleArrayDimensionSpecification\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleComplexTypeSpecifier3354);\n lv_dimensions_6_0=ruleArrayDimensionSpecification();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getComplexTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"dimensions\",\n \t \t\tlv_dimensions_6_0, \n \t \t\t\"ArrayDimensionSpecification\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1935:2: ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )*\n loop27:\n do {\n int alt27=2;\n int LA27_0 = input.LA(1);\n\n if ( (LA27_0==14) ) {\n alt27=1;\n }\n\n\n switch (alt27) {\n \tcase 1 :\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1935:4: ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t {\n \t match(input,14,FOLLOW_14_in_ruleComplexTypeSpecifier3365); \n\n \t createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getCommaKeyword_3_2_0(), null); \n \t \n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1939:1: ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1940:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t {\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1940:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1941:3: lv_dimensions_8_0= ruleArrayDimensionSpecification\n \t {\n \t \n \t \t currentNode=createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_2_1_0(), currentNode); \n \t \t \n \t pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleComplexTypeSpecifier3386);\n \t lv_dimensions_8_0=ruleArrayDimensionSpecification();\n \t _fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = factory.create(grammarAccess.getComplexTypeSpecifierRule().getType().getClassifier());\n \t \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t \t }\n \t \t try {\n \t \t \t\tadd(\n \t \t \t\t\tcurrent, \n \t \t \t\t\t\"dimensions\",\n \t \t \t\tlv_dimensions_8_0, \n \t \t \t\t\"ArrayDimensionSpecification\", \n \t \t \t\tcurrentNode);\n \t \t } catch (ValueConverterException vce) {\n \t \t\t\t\thandleValueConverterException(vce);\n \t \t }\n \t \t currentNode = currentNode.getParent();\n \t \t \n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop27;\n }\n } while (true);\n\n match(input,34,FOLLOW_34_in_ruleComplexTypeSpecifier3398); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getRightSquareBracketKeyword_3_3(), null); \n \n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n resetLookahead(); \n \tlastConsumedNode = currentNode;\n \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public void add(Complex c){\n\t\tre += c.getRe();\n\t\tim += c.getIm();\n\t}",
"public Complex(double real, double imaginary) {\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public Complex(Complex c) {\n r = c.r;\n i = c.i;\n }",
"public ComplexNumber add(ComplexNumber c) {\n\t\tif (c == null) {\n\t\t\tthrow new NullPointerException(\"The given complex number is null!\");\n\t\t}\n\t\tdouble real = getReal() + c.getReal();\n\t\tdouble imaginary = getImaginary() + c.getImaginary();\n\n\t\treturn new ComplexNumber(real, imaginary);\n\t}",
"public void mul(Complex c){\n\t\tdouble tempRe = re*c.getRe() - im*c.getIm();\n\t\tim = im*c.getRe() + re*c.getIm();\n\t\tre = tempRe;\n\t}",
"boolean equals (ComplexNum c) //compares two complex numbers and produces\n {\n\tif (c.real == real && im == c.im)\n\t return true;\n\treturn false;\n }",
"public ComplexFractal(String name, FractalType type) {\r\n\t\tif(name == null){\r\n\t\t\tthrow new NullPointerException(\"Argument name is null\");\r\n\t\t}\r\n\t\tthis.name = name;\r\n\t\tthis.type = type;\r\n\t\tformulas = new ArrayList<IComplexFormula>();\r\n\t}",
"public Complex(double real, double imaginary) {\n r = real;\n i = imaginary;\n }",
"public static Object getCompositeImage(Object baseImage, Object overlayImage) {\n\t\tList<Object> images = new ArrayList<Object>(2);\n\t\timages.add(baseImage);\n\t\timages.add(overlayImage);\n\t\t\n\t\tObject image = new ComposedImage(images);\n\t\treturn image;\n\t}",
"public Complex(double re, double im) {\n this.re = re;\n this.im = im;\n }",
"public Complex multiply(Complex param) {\r\n\t\tMyDouble r1r2 = this.getReal().multiply(param.getReal());\r\n\t\tMyDouble r1i2 = this.getReal().multiply(param.getImag());\r\n\t\tMyDouble i1r2 = this.getImag().multiply(param.getReal());\r\n\t\tMyDouble i1i2 = this.getImag().multiply(param.getImag());\r\n\t\tMyDouble prodImg = MyDouble.zero.subtract(i1i2);\r\n\t\tMyDouble sum1 = r1r2.add(prodImg);\r\n\t\tMyDouble sum2 = r1i2.add(i1r2);\r\n\t\tComplex multiplyed = new Complex(sum1, sum2);\r\n\t\treturn multiplyed;\r\n\t}",
"public Complex conjugate() {\r\n return new Complex(this.getReal(), this.getImag() * -1);\r\n }",
"public static void main(String[] args) {\n\tComplex c1 = new Complex(1,2);\r\n\tComplex c2 = new Complex(-2,-1);\r\n\t\r\n\t//Calculates the product of c1 and c2\r\n\tComplex product_c1c2 = Complex.multiply(c1, c2);\r\n\tSystem.out.println(\"The product of c1 and c2 is: \"+product_c1c2);\r\n \t\r\n\t//Calculates the ratio of c1 to c2 (c1/c2)\r\n\tComplex ratio_c1c2 = Complex.divide(c1, c2);\r\n\tSystem.out.println(\"The ratio of c1 to c2 is: \"+ratio_c1c2);\r\n\t\r\n\t//Calculates the product of c1 and I\r\n\tComplex product_c1I = Complex.multiply(c1, Complex.I);\r\n\tSystem.out.println(\"The product of c1 and I is: \"+product_c1I);\r\n\t\r\n\t//Calculates the ratio of c1 to 0\r\n\tComplex ratio_c1Zero = Complex.divide(c1, Complex.Zero);\r\n\tSystem.out.println(\"The ratio of c1 and 0 is: \"+ratio_c1Zero);\r\n\t\r\n\t//Calculates the product of c1 with the conjugate of c1\r\n\tComplex c1_conj = Complex.conj(c1);\r\n\tComplex product_c1c1conj = Complex.multiply(c1,c1_conj);\r\n\tSystem.out.println(\"The product of c1 and c1* is: \"+product_c1c1conj);\r\n\t\r\n\t//Calculates the product of c1 with the conjugate of c1\r\n\tComplex c2_conj = Complex.conj(c2);\r\n\tComplex product_c2c2conj = Complex.multiply(c2,c2_conj);\r\n\tSystem.out.println(\"The product of c1 and c1* is: \"+product_c2c2conj);\r\n\t}",
"public static Complex converter(String arg) {\r\n int real = 0;\r\n int imaginar = 0;\r\n for(int i = 1; i < arg.length(); i++)\r\n if (arg.charAt(i) == '+' || arg.charAt(i) == '-') {\r\n real = Integer.parseInt(arg.substring(0, i));\r\n imaginar = Integer.parseInt(arg.substring(i, arg.length()-1));\r\n }\r\n return new Complex(real, imaginar);\r\n }",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"public static Image convertToGray(Image imageObject) {\n\t\n\t\tint[] rgb = new int[3];\n\t\tfor(int y=0;y<imageObject.getH();y++){\n\t\t\tfor(int x=0;x<imageObject.getW();x++){\n\t\t\t\timageObject.getPixel(x, y, rgb);\n\t\t\t\tint gray = (int) Math.round((0.299 * (rgb[0])) + 0.587 * (rgb[1]) + 0.114 * (rgb[2]));\n\t\t\t\trgb[0] = (0xFF & gray);\n\t\t\t\trgb[1] = (0xFF & gray);\n\t\t\t\trgb[2] = (0xFF & gray);\n\t\t\t\timageObject.setPixel(x, y, rgb);\n\t\t\t}\n\t\t}\n\treturn imageObject;\n}",
"public Complex multiply(Complex complex) {\r\n double real =\r\n this.real_part * complex.real_part - this.imaginary_part\r\n * complex.imaginary_part;\r\n double imag =\r\n this.real_part * complex.imaginary_part + this.imaginary_part\r\n * complex.real_part;\r\n return new Complex(real, imag);\r\n }",
"public Complex_Number(double realPart,double imaginaryPart)\n {\n this(realPart,imaginaryPart,1);\n }",
"public native boolean compositeImage(int compOp, MagickImage compImage,\n\t\t\tint xOff, int yOff) throws MagickException;",
"public Complex plus(Complex a){\n float real = this.re + a.re;\n float imag = this.im + a.im;\n return new Complex(real, imag);\n }",
"public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}",
"public static Complex parseComplex(String thingToParse) {\r\n\t\tString trimed = thingToParse.trim();\r\n\t\tString insidTrim = trimed.replaceAll(\"\\\\s+\", \"\");\r\n\t\tint strlen = insidTrim.length();\r\n\t\tif (strlen == 1) {\r\n\t\t\tString realAndImage = insidTrim.substring(0, strlen);\r\n\t\t\tdouble theImag = Double.parseDouble(realAndImage);\r\n\t\t\tif (theImag == 0) {\r\n\t\t\t\tMyDouble realFinal = new MyDouble(0);\r\n\t\t\t\tMyDouble imageFinal = new MyDouble(0);\r\n\t\t\t\tComplex parse = new Complex(realFinal, imageFinal);\r\n\t\t\t\treturn parse;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tint indeOfPlus = insidTrim.indexOf(\"+\");\r\n\r\n\t\tif (indeOfPlus == -1) {\r\n\t\t\tString stringToAvoidFirstMin = insidTrim.substring(1, strlen);\r\n\r\n\t\t\tint indesofMinus = stringToAvoidFirstMin.indexOf(\"-\");\r\n\t\t\tString realString = insidTrim.substring(0, indesofMinus + 1);\r\n\t\t\tdouble thereal = Double.parseDouble(realString);\r\n\t\t\tString imagString = insidTrim.substring(indesofMinus + 1, strlen - 1);\r\n\t\t\tdouble theImag = Double.parseDouble(imagString);\r\n\t\t\tMyDouble realFinal = new MyDouble(thereal);\r\n\t\t\tMyDouble imageFinal = new MyDouble(theImag);\r\n\t\t\tComplex parse = new Complex(realFinal, imageFinal);\r\n\t\t\treturn parse;\r\n\t\t} else {\r\n\t\t\tString realString = insidTrim.substring(0, indeOfPlus);\r\n\t\t\tdouble thereal = Double.parseDouble(realString);\r\n\t\t\tString imagString = insidTrim.substring(indeOfPlus + 1, strlen - 1);\r\n\t\t\tdouble theImag = Double.parseDouble(imagString);\r\n\t\t\tMyDouble realFinal = new MyDouble(thereal);\r\n\t\t\tMyDouble imageFinal = new MyDouble(theImag);\r\n\t\t\tComplex parse = new Complex(realFinal, imageFinal);\r\n\t\t\treturn parse;\r\n\t\t}\r\n\t}",
"public Complex getComplex() {return this;}",
"public Complex add(Complex c) {\n return new Complex(this.re + c.re, this.im + c.im);\n }",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexTypeMBean getComplexTypeMBean()\n {\n return new ComplexType();\n }",
"public Complex getConjugate() {\n\t\treturn new Complex(real, -imaginary);\n\t}",
"public Complex(double real, double imag) {\r\n this.real_part = real;\r\n this.imaginary_part = imag;\r\n }",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"public static Complex double2Complex(double d) {\r\n\t\treturn new Complex(d, 0);\r\n\t}",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(RealColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint gray;\n\t\tGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new GrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (int) (color[0] * 0.299 + color[1] * 0.587 + color[2] * 0.114);\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"private Complex nextRandomComplex() {\n return new Complex(rand.nextDouble() - 0.5, rand.nextDouble() - 0.5);\n }",
"public void testComplex2() {\n Scalar scalar = GCD.of(ComplexScalar.of(9, 3), ComplexScalar.of(123, 9));\n assertEquals(scalar, ComplexScalar.of(-3, 3));\n }",
"private static Image Transform1ColorToTransparency2ToColors(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor1,\n\t\t\tfinal Color c5, final Color c6, final int otherColor2){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\t\tfinal int r5 = c5.getRed();\n\t\tfinal int g5 = c5.getGreen();\n\t\tfinal int b5 = c5.getBlue();\n\t\tfinal int r6 = c6.getRed();\n\t\tfinal int g6 = c6.getGreen();\n\t\tfinal int b6 = c6.getBlue();\n\n\t\tfinal ImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor1;\n\t\t}\n\t\tif (r >= r5 && r <= r6 &&\n\t\t\t\tg >= g5 && g <= g6 &&\n\t\t\t\tb >= b5 && b <= b6){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor2;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}",
"public Complex() {\r\n real = 0;\r\n imaginary = 0;\r\n }",
"void colorize(ObservableValue<? extends Number> ov, Number old_val,\n Number new_val, Color color, BufferedImage myBufferedImage,\n ImageView myImage) {\n double coefColor = (new_val.doubleValue() / 100 + 0.5)\n / (old_val.doubleValue() / 100 + 0.5);\n this.colorizer.setChangeColor(color);\n this.colorizer.setRatio(coefColor);\n myBufferedImage = Utils.clone(this.colorizer.process(myBufferedImage));\n myImage.setImage(SwingFXUtils.toFXImage(myBufferedImage, null));\n }",
"public Complex(String r, String i){\r\n\t this(Integer.parseInt(r), Integer.parseInt(i.replaceAll(\"i\",\"\")));\r\n\t}",
"@Test\n public void testGray16BitIntoRGB() {\n BufferedImage im16bit = new BufferedImage(100, 100, BufferedImage.TYPE_USHORT_GRAY);\n WritableRaster raster16bit = im16bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 1000);\n raster16bit.setSamples(0, 0, 100, 50, 0, fill);\n Arrays.fill(fill, 30000);\n raster16bit.setSamples(0, 50, 100, 50, 0, fill);\n\n // mosaic setting the nodata\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData1000 = RangeFactory.create(1000, 1000);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im16bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData1000, null }, null);\n\n // RenderedImageBrowser.showChain(mosaic);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow (nodata in the gray one)\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be yellow (nodata in the gray one)\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom left quadrant, should be 30000 scaled down to byte\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 117, 117, 117 }, pixel);\n // check bottom right quadrant, should be 30000 scaled down to byte\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 117, 117, 117 }, pixel);\n }",
"private Mat toGrayMat(Bitmap input) {\n Mat output = new Mat();\n\n // Convert Bitmap to Mat\n input = input.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(input, output);\n\n // Convert to grayscale\n Imgproc.cvtColor(output, output, Imgproc.COLOR_RGB2GRAY, 4);\n\n return output;\n }",
"public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }",
"public void add(ComplexNumber one){\n this.real += one.real;\n this.imaginary += one.imaginary;\n }",
"public interface ImageOperation {\n\tpublic Color[][] doOperation(Color[][] imageArray);\n}",
"public static BufferedImage createBufferedImage(Dimension fieldSize, int color)\n {\n // Creates the image\n BufferedImage image = new BufferedImage(fieldSize.width, fieldSize.height, BufferedImage.TYPE_INT_ARGB);\n\n // For every pixels of the image\n for(int x = 0; x < fieldSize.width; x++)\n {\n for(int y = 0; y < fieldSize.height; y++)\n {\n // Set the pixel black\n image.setRGB(x, y, color);\n }\n }\n return image;\n }",
"public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public BufferedImage getCompositeImage() {\n if (compositeImageUpToDate) {\n return cachedCompositeImage; // this caching is useful for example when using the Color Picker Tool\n }\n\n cachedCompositeImage = calculateCompositeImage();\n\n compositeImageUpToDate = true;\n return cachedCompositeImage;\n }",
"public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;",
"public void getVal(Complex c) {\n\t\tc.re =re;\n\t\tc.im = im;\n\t}",
"public FavouriteImg(ComplexNumber c, String name)\n\t{\n\t\tthis.cn = c;\n\t\tthis.name = name;\n\t}"
] | [
"0.8029156",
"0.80166453",
"0.79665977",
"0.79407096",
"0.7513618",
"0.7449904",
"0.7175501",
"0.64946437",
"0.6418228",
"0.60631603",
"0.6043474",
"0.59818625",
"0.59480006",
"0.5893017",
"0.57747865",
"0.57562965",
"0.56170976",
"0.5600188",
"0.5432954",
"0.5425905",
"0.5425435",
"0.5134536",
"0.5128656",
"0.5081648",
"0.50572914",
"0.5040177",
"0.4989196",
"0.49836233",
"0.49785367",
"0.49552634",
"0.49452242",
"0.49328524",
"0.49209252",
"0.49160138",
"0.49150857",
"0.4889242",
"0.488322",
"0.4853424",
"0.48302084",
"0.4824336",
"0.48158202",
"0.48133788",
"0.4810331",
"0.4804996",
"0.47999293",
"0.47810793",
"0.47774473",
"0.47737026",
"0.47436702",
"0.47329763",
"0.47271675",
"0.47193176",
"0.471489",
"0.4694717",
"0.46875826",
"0.4685869",
"0.4665986",
"0.4651763",
"0.46421325",
"0.4633721",
"0.4619398",
"0.46054578",
"0.46040502",
"0.45813692",
"0.45703942",
"0.45694083",
"0.4566165",
"0.45225015",
"0.45218456",
"0.4516385",
"0.4511017",
"0.45094234",
"0.4478443",
"0.4463568",
"0.44587958",
"0.4457048",
"0.44546673",
"0.444687",
"0.4443864",
"0.443281",
"0.4431623",
"0.44179335",
"0.44140425",
"0.4411421",
"0.44060984",
"0.44046915",
"0.43893734",
"0.43863568",
"0.43567735",
"0.43536457",
"0.4350911",
"0.43490228",
"0.43434626",
"0.43398574",
"0.4331212",
"0.43276784",
"0.43276343",
"0.43261468",
"0.4324033",
"0.43238452"
] | 0.80777407 | 0 |
Converts a RealColorImage to a ComplexImage. The RealColorImage is first converted to a RealGrayImage object and then to a ComplexImage object. | public static ComplexImage toComplex(RealColorImage img)
throws ColorModelNotSupportedException, ColorModelUnknownException {
int X = img.X();
int Y = img.Y();
float[] color = new float[3];
float real;
ComplexImage newimg = null;
switch (img.getColorModel()) {
case ColorImage.RGB:
newimg = new ComplexImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
color = img.get(x, y);
real = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]
* 0.114f;
newimg.setReal(x, y, real);
newimg.setImag(x, y, 0f);
}
}
break;
case ColorImage.CMY:
case ColorImage.YIQ:
case ColorImage.HSV:
case ColorImage.HLS:
throw new ColorModelNotSupportedException();
default:
throw new ColorModelUnknownException();
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static ComplexImage toComplex(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tComplexImage newimg = null;\n\t\tnewimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.setReal(x, y, img.getReal(x, y));\n\t\t\t\tnewimg.setImag(x, y, img.getImag(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex(float real, float imag) {\n this.re = real;\n this.im = imag;\n }",
"Complex(double r, double i) {\n real = r;\n imag = i;\n }",
"public ComplexNumber(double real, double imaginary) {\n this.real = real;\n this.imaginary = imaginary;\n }",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex(double real, double imaginary) {\r\n this.real = real;\r\n this.imaginary = imaginary;\r\n }",
"public static ComplexNumber fromImaginary(double imaginary) {\n\t\treturn new ComplexNumber(0, imaginary);\n\t}",
"public ComplexNumber(double real, double imaginary) {\n\t\tsuper();\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public Complex(double real, double imaginary) {\n\t\tthis.real = real;\n\t\tthis.imaginary = imaginary;\n\t}",
"public static ComplexNumber fromReal(double real) {\n\t\treturn new ComplexNumber(real, 0);\n\t}",
"public Complex(double real, double imaginary) {\n r = real;\n i = imaginary;\n }",
"public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"Complex() {\n real = 0.0;\n imag = 0.0;\n }",
"public static RealGrayImage toRealGray(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (float) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex(double real, double imag) {\r\n this.real_part = real;\r\n this.imaginary_part = imag;\r\n }",
"public ComplexNumber(ComplexNumber cn) {\n\t\treal = cn.getReal();\n\t\timag = cn.getImag();\n\t}",
"public static RealGrayImage toRealGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public ComplexFrame toComplexFrame(float[] fftValues) {\n int length = resolution / 2 + 1;\n float[] real = new float[length];\n float[] imag = new float[length];\n\n //bin 0 and n/2 always have an imaginary value of 0\n real[0] = fftValues[0];\n imag[0] = 0;\n real[length - 1] = fftValues[1];\n imag[length - 1] = 0;\n for (int i = 1; i < resolution / 2; i++) {\n real[i] = fftValues[2 * i];\n imag[i] = fftValues[2 * i + 1];\n }\n return new ComplexFrame(real, imag);\n }",
"public ComplexNumber(double re, double im) {\n\t\treal = re;\n\t\timag = im;\n\t}",
"public static RealGrayImage toRealGray(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealGray((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealGray((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealGray((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealGray((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealGray((ComplexImage) img);\n\t\t}\n\t}",
"public ComplexNumber(double re, double im) {\r\n this.re = re;\r\n this.im = im;\r\n }",
"public final Constant complex_constant() throws RecognitionException {\r\n Constant constant = null;\r\n\r\n\r\n LLVMParser.structure_constant_return structure_constant192 =null;\r\n\r\n LLVMParser.array_constant_return array_constant193 =null;\r\n\r\n LLVMParser.vector_constant_return vector_constant194 =null;\r\n\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:5: ( structure_constant | array_constant | vector_constant )\r\n int alt266=3;\r\n switch ( input.LA(1) ) {\r\n case 93:\r\n {\r\n alt266=1;\r\n }\r\n break;\r\n case 49:\r\n {\r\n alt266=2;\r\n }\r\n break;\r\n case 46:\r\n {\r\n alt266=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 266, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt266) {\r\n case 1 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1059:7: structure_constant\r\n {\r\n pushFollow(FOLLOW_structure_constant_in_complex_constant7999);\r\n structure_constant192=structure_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.structure, (structure_constant192!=null?input.toString(structure_constant192.start,structure_constant192.stop):null));\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1060:7: array_constant\r\n {\r\n pushFollow(FOLLOW_array_constant_in_complex_constant8009);\r\n array_constant193=array_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.array, (array_constant193!=null?input.toString(array_constant193.start,array_constant193.stop):null));\r\n\r\n }\r\n break;\r\n case 3 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:1061:7: vector_constant\r\n {\r\n pushFollow(FOLLOW_vector_constant_in_complex_constant8019);\r\n vector_constant194=vector_constant();\r\n\r\n state._fsp--;\r\n\r\n\r\n constant = valueFactory.createConstantValue(ComplexConstantValue.vector, (vector_constant194!=null?input.toString(vector_constant194.start,vector_constant194.stop):null));\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return constant;\r\n }",
"public MComplex(MReal real) {\r\n\t\ta = r = real.getValue();\r\n\t\tb = phi = 0;\r\n\t\tpolar = cartesian = true;\r\n\t}",
"public Complex multiply(Complex complex) {\r\n double real =\r\n this.real_part * complex.real_part - this.imaginary_part\r\n * complex.imaginary_part;\r\n double imag =\r\n this.real_part * complex.imaginary_part + this.imaginary_part\r\n * complex.real_part;\r\n return new Complex(real, imag);\r\n }",
"public static RealGrayImage toRealGray(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = color[0] * 0.299f + color[1] * 0.587f + color[2] * 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex_Number(double realPart,double imaginaryPart)\n {\n this(realPart,imaginaryPart,1);\n }",
"public Complex(String cStr){\r\n\t\tthis(cStr.replaceAll(\" \", \"\").split(\"(?=\\\\+)|(?=\\\\-)\")); // splits cStr at + or - into an array of strings having two elements\r\n\t\t// The first element of the resultant array will be the real portion, \r\n\t\t// while the second is the imaginary portion. This array is passed to the next constructor.\r\n\t}",
"public static RealGrayImage toRealGray(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tRealGrayImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new RealGrayImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\tgray = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.set(x, y, gray);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex(double re, double im) {\n this.re = re;\n this.im = im;\n }",
"public Complex multiply(Complex param) {\r\n\t\tMyDouble r1r2 = this.getReal().multiply(param.getReal());\r\n\t\tMyDouble r1i2 = this.getReal().multiply(param.getImag());\r\n\t\tMyDouble i1r2 = this.getImag().multiply(param.getReal());\r\n\t\tMyDouble i1i2 = this.getImag().multiply(param.getImag());\r\n\t\tMyDouble prodImg = MyDouble.zero.subtract(i1i2);\r\n\t\tMyDouble sum1 = r1r2.add(prodImg);\r\n\t\tMyDouble sum2 = r1i2.add(i1r2);\r\n\t\tComplex multiplyed = new Complex(sum1, sum2);\r\n\t\treturn multiplyed;\r\n\t}",
"public Complex(double r, double i){\r\n\t\tthis.setReal(r);\r\n\t\tthis.setImag(i);\r\n setCounter();\r\n\t}",
"boolean equals (ComplexNum c) //compares two complex numbers and produces\n {\n\tif (c.real == real && im == c.im)\n\t return true;\n\treturn false;\n }",
"public ComplexNumber mul(ComplexNumber c) {\n\t\tdouble real = getReal() * c.getReal();\n\t\treal -= getImaginary() * c.getImaginary();\n\n\t\tdouble imaginary = getReal() * c.getImaginary();\n\t\timaginary += c.getReal() * getImaginary();\n\n\t\treturn new ComplexNumber(real, imaginary);\n\t}",
"public Complex() {\r\n real = 0;\r\n imaginary = 0;\r\n }",
"public Complex(Complex c) {\n r = c.r;\n i = c.i;\n }",
"public FourierTransformComplex(FImage image, boolean centre) {\n\t\tthis.centre = centre;\n\n\t\tprocess(image);\n\t}",
"public static ColorImage toColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toColor((ComplexImage) img);\n\t\t}\n\t}",
"public static Complex converter(String arg) {\r\n int real = 0;\r\n int imaginar = 0;\r\n for(int i = 1; i < arg.length(); i++)\r\n if (arg.charAt(i) == '+' || arg.charAt(i) == '-') {\r\n real = Integer.parseInt(arg.substring(0, i));\r\n imaginar = Integer.parseInt(arg.substring(i, arg.length()-1));\r\n }\r\n return new Complex(real, imaginar);\r\n }",
"public void mul(Complex c){\n\t\tdouble tempRe = re*c.getRe() - im*c.getIm();\n\t\tim = im*c.getRe() + re*c.getIm();\n\t\tre = tempRe;\n\t}",
"public Complex_Number(double realPart,double imaginaryPart,int power)\n {\n this.realPart = realPart;\n this.imaginaryPart = imaginaryPart;\n this.powerOfIi = power;\n }",
"private Complex nextRandomComplex() {\n return new Complex(rand.nextDouble() - 0.5, rand.nextDouble() - 0.5);\n }",
"public void multiply(Complex other) {\n double r = (this.real * other.real) - (this.imag * other.imag);\n double i = (this.real * other.imag) + (this.imag * other.real);\n this.real = r;\n this.imag = i;\n }",
"public Complex getComplex() {return this;}",
"public void add(Complex c){\n\t\tre += c.getRe();\n\t\tim += c.getIm();\n\t}",
"public void testComplex2() {\n Scalar scalar = GCD.of(ComplexScalar.of(9, 3), ComplexScalar.of(123, 9));\n assertEquals(scalar, ComplexScalar.of(-3, 3));\n }",
"public static void main(String[] args) {\n\tComplex c1 = new Complex(1,2);\r\n\tComplex c2 = new Complex(-2,-1);\r\n\t\r\n\t//Calculates the product of c1 and c2\r\n\tComplex product_c1c2 = Complex.multiply(c1, c2);\r\n\tSystem.out.println(\"The product of c1 and c2 is: \"+product_c1c2);\r\n \t\r\n\t//Calculates the ratio of c1 to c2 (c1/c2)\r\n\tComplex ratio_c1c2 = Complex.divide(c1, c2);\r\n\tSystem.out.println(\"The ratio of c1 to c2 is: \"+ratio_c1c2);\r\n\t\r\n\t//Calculates the product of c1 and I\r\n\tComplex product_c1I = Complex.multiply(c1, Complex.I);\r\n\tSystem.out.println(\"The product of c1 and I is: \"+product_c1I);\r\n\t\r\n\t//Calculates the ratio of c1 to 0\r\n\tComplex ratio_c1Zero = Complex.divide(c1, Complex.Zero);\r\n\tSystem.out.println(\"The ratio of c1 and 0 is: \"+ratio_c1Zero);\r\n\t\r\n\t//Calculates the product of c1 with the conjugate of c1\r\n\tComplex c1_conj = Complex.conj(c1);\r\n\tComplex product_c1c1conj = Complex.multiply(c1,c1_conj);\r\n\tSystem.out.println(\"The product of c1 and c1* is: \"+product_c1c1conj);\r\n\t\r\n\t//Calculates the product of c1 with the conjugate of c1\r\n\tComplex c2_conj = Complex.conj(c2);\r\n\tComplex product_c2c2conj = Complex.multiply(c2,c2_conj);\r\n\tSystem.out.println(\"The product of c1 and c1* is: \"+product_c2c2conj);\r\n\t}",
"public Complex(String r, String i){\r\n\t this(Integer.parseInt(r), Integer.parseInt(i.replaceAll(\"i\",\"\")));\r\n\t}",
"public final EObject ruleComplexTypeSpecifier() throws RecognitionException {\n EObject current = null;\n\n EObject lv_unit_3_0 = null;\n\n EObject lv_dimensions_6_0 = null;\n\n EObject lv_dimensions_8_0 = null;\n\n\n EObject temp=null; setCurrentLookahead(); resetLookahead(); \n \n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1859:6: ( ( () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:1: ( () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:1: ( () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:2: () 'complex' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1860:2: ()\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1861:5: \n {\n \n temp=factory.create(grammarAccess.getComplexTypeSpecifierAccess().getComplexTypeSpecifierAction_0().getType().getClassifier());\n current = temp; \n temp = null;\n CompositeNode newNode = createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getComplexTypeSpecifierAction_0(), currentNode.getParent());\n newNode.getChildren().add(currentNode);\n moveLookaheadInfo(currentNode, newNode);\n currentNode = newNode; \n associateNodeWithAstElement(currentNode, current); \n \n\n }\n\n match(input,36,FOLLOW_36_in_ruleComplexTypeSpecifier3278); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getComplexKeyword_1(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1875:1: ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )?\n int alt26=2;\n int LA26_0 = input.LA(1);\n\n if ( (LA26_0==25) ) {\n alt26=1;\n }\n switch (alt26) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1875:3: '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')'\n {\n match(input,25,FOLLOW_25_in_ruleComplexTypeSpecifier3289); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getLeftParenthesisKeyword_2_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1879:1: ( (lv_unit_3_0= ruleUnitExpression ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1880:1: (lv_unit_3_0= ruleUnitExpression )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1880:1: (lv_unit_3_0= ruleUnitExpression )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1881:3: lv_unit_3_0= ruleUnitExpression\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getUnitUnitExpressionParserRuleCall_2_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleUnitExpression_in_ruleComplexTypeSpecifier3310);\n lv_unit_3_0=ruleUnitExpression();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getComplexTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"unit\",\n \t \t\tlv_unit_3_0, \n \t \t\t\"UnitExpression\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n match(input,26,FOLLOW_26_in_ruleComplexTypeSpecifier3320); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getRightParenthesisKeyword_2_2(), null); \n \n\n }\n break;\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1907:3: ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n int alt28=2;\n int LA28_0 = input.LA(1);\n\n if ( (LA28_0==33) ) {\n alt28=1;\n }\n switch (alt28) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1907:5: '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']'\n {\n match(input,33,FOLLOW_33_in_ruleComplexTypeSpecifier3333); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getLeftSquareBracketKeyword_3_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1911:1: ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1912:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1912:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1913:3: lv_dimensions_6_0= ruleArrayDimensionSpecification\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleComplexTypeSpecifier3354);\n lv_dimensions_6_0=ruleArrayDimensionSpecification();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getComplexTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"dimensions\",\n \t \t\tlv_dimensions_6_0, \n \t \t\t\"ArrayDimensionSpecification\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1935:2: ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )*\n loop27:\n do {\n int alt27=2;\n int LA27_0 = input.LA(1);\n\n if ( (LA27_0==14) ) {\n alt27=1;\n }\n\n\n switch (alt27) {\n \tcase 1 :\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1935:4: ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t {\n \t match(input,14,FOLLOW_14_in_ruleComplexTypeSpecifier3365); \n\n \t createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getCommaKeyword_3_2_0(), null); \n \t \n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1939:1: ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1940:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t {\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1940:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1941:3: lv_dimensions_8_0= ruleArrayDimensionSpecification\n \t {\n \t \n \t \t currentNode=createCompositeNode(grammarAccess.getComplexTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_2_1_0(), currentNode); \n \t \t \n \t pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleComplexTypeSpecifier3386);\n \t lv_dimensions_8_0=ruleArrayDimensionSpecification();\n \t _fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = factory.create(grammarAccess.getComplexTypeSpecifierRule().getType().getClassifier());\n \t \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t \t }\n \t \t try {\n \t \t \t\tadd(\n \t \t \t\t\tcurrent, \n \t \t \t\t\t\"dimensions\",\n \t \t \t\tlv_dimensions_8_0, \n \t \t \t\t\"ArrayDimensionSpecification\", \n \t \t \t\tcurrentNode);\n \t \t } catch (ValueConverterException vce) {\n \t \t\t\t\thandleValueConverterException(vce);\n \t \t }\n \t \t currentNode = currentNode.getParent();\n \t \t \n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop27;\n }\n } while (true);\n\n match(input,34,FOLLOW_34_in_ruleComplexTypeSpecifier3398); \n\n createLeafNode(grammarAccess.getComplexTypeSpecifierAccess().getRightSquareBracketKeyword_3_3(), null); \n \n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n resetLookahead(); \n \tlastConsumedNode = currentNode;\n \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }",
"public Complex plus(Complex a){\n float real = this.re + a.re;\n float imag = this.im + a.im;\n return new Complex(real, imag);\n }",
"public void getVal(Complex c) {\n\t\tc.re =re;\n\t\tc.im = im;\n\t}",
"void showComplex(ImagePlus impl,double pValue, double rCutoff){\n RegionBoundaryAnalyzer cRBA=CommonMethods.buildRegionComplex(impl,pValue);\n ArrayList<RegionComplexNode> cvComplexes=cRBA.m_cvComplexNodes;\n int len=cvComplexes.size(),i;\n ArrayList<Roi> cvROIs=new ArrayList();\n ImageShape cIS;\n for(i=0;i<len;i++){\n cIS=cRBA.getRegionComplexShape(cvComplexes.get(i));\n cvROIs.add(ImageShapeHandler.getRoi(cIS));\n }\n RoiHighlighter.addRoi(impl, cvROIs);\n RoiHighlighter.highLight();\n }",
"public static Complex parseComplex(String thingToParse) {\r\n\t\tString trimed = thingToParse.trim();\r\n\t\tString insidTrim = trimed.replaceAll(\"\\\\s+\", \"\");\r\n\t\tint strlen = insidTrim.length();\r\n\t\tif (strlen == 1) {\r\n\t\t\tString realAndImage = insidTrim.substring(0, strlen);\r\n\t\t\tdouble theImag = Double.parseDouble(realAndImage);\r\n\t\t\tif (theImag == 0) {\r\n\t\t\t\tMyDouble realFinal = new MyDouble(0);\r\n\t\t\t\tMyDouble imageFinal = new MyDouble(0);\r\n\t\t\t\tComplex parse = new Complex(realFinal, imageFinal);\r\n\t\t\t\treturn parse;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tint indeOfPlus = insidTrim.indexOf(\"+\");\r\n\r\n\t\tif (indeOfPlus == -1) {\r\n\t\t\tString stringToAvoidFirstMin = insidTrim.substring(1, strlen);\r\n\r\n\t\t\tint indesofMinus = stringToAvoidFirstMin.indexOf(\"-\");\r\n\t\t\tString realString = insidTrim.substring(0, indesofMinus + 1);\r\n\t\t\tdouble thereal = Double.parseDouble(realString);\r\n\t\t\tString imagString = insidTrim.substring(indesofMinus + 1, strlen - 1);\r\n\t\t\tdouble theImag = Double.parseDouble(imagString);\r\n\t\t\tMyDouble realFinal = new MyDouble(thereal);\r\n\t\t\tMyDouble imageFinal = new MyDouble(theImag);\r\n\t\t\tComplex parse = new Complex(realFinal, imageFinal);\r\n\t\t\treturn parse;\r\n\t\t} else {\r\n\t\t\tString realString = insidTrim.substring(0, indeOfPlus);\r\n\t\t\tdouble thereal = Double.parseDouble(realString);\r\n\t\t\tString imagString = insidTrim.substring(indeOfPlus + 1, strlen - 1);\r\n\t\t\tdouble theImag = Double.parseDouble(imagString);\r\n\t\t\tMyDouble realFinal = new MyDouble(thereal);\r\n\t\t\tMyDouble imageFinal = new MyDouble(theImag);\r\n\t\t\tComplex parse = new Complex(realFinal, imageFinal);\r\n\t\t\treturn parse;\r\n\t\t}\r\n\t}",
"public static GrayImage toGray(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (short) img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex(double real) {\n this(real, 0);\n }",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static ComplexNumber parse(String s) {\n\t\tif (s == null) {\n\t\t\tthrow new NullPointerException(\"The given string is null!\");\n\t\t}\n\t\t// remove all the blank spaces from s\n\t\ts = s.toLowerCase().replaceAll(\" \", \"\");\n\n\t\tif (s.equals(\"i\") || s.equals(\"+i\")){\n\t\t\treturn new ComplexNumber(0, 1);\n\t\t}\n\t\tif (s.equals(\"-i\")){\n\t\t\treturn new ComplexNumber(0, -1);\n\t\t}\n\t\t\n\t\t\n\t\tint endingPosition = 1;\n\t\tint size = s.length();\n\n\t\twhile (endingPosition < size) {\n\t\t\tchar ch = s.charAt(endingPosition);\n\t\t\tif (ch >= '0' && ch <= '9' || ch == '.') {\n\t\t\t\tendingPosition++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tdouble real;\n\t\ttry {\n\t\t\treal = Double.parseDouble(s.substring(0, endingPosition));\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new NumberFormatException(\n\t\t\t\t\"The given number could not be parsed to a Complex Number.\");\n\t\t}\n\n\t\tif (endingPosition == size) {\n\t\t\t// there is no imaginary part of the complex number\n\t\t\treturn ComplexNumber.fromReal(real);\n\t\t} else if (endingPosition == size - 1) {\n\t\t\t// there is no real part of the complex number\n\t\t\treturn ComplexNumber.fromImaginary(real);\n\t\t}\n\n\t\tif (!s.endsWith(\"i\")) {\n\t\t\tthrow new NumberFormatException(\n\t\t\t\t\"The given number could not be parsed to a Complex Number.\");\n\t\t}\n\n\t\ts = s.substring(endingPosition, size - 1);\n\t\tdouble imaginary;\n\n\t\tif (s.equals(\"-\")) {\n\t\t\timaginary = -1;\n\t\t} else if (s.equals(\"+\")) {\n\t\t\timaginary = 1;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\timaginary = Double.parseDouble(s);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tthrow new NumberFormatException(\n\t\t\t\t\t\"The given number could not be parsed to a Complex Number.\");\n\t\t\t}\n\t\t}\n\n\t\treturn new ComplexNumber(real, imaginary);\n\t}",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"public T caseComplexExpr(ComplexExpr object) {\n\t\treturn null;\n\t}",
"public void add(ComplexNumber one){\n this.real += one.real;\n this.imaginary += one.imaginary;\n }",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public Complex add(Complex complex) {\r\n double real = this.real_part + complex.real_part;\r\n double imag = this.imaginary_part + complex.imaginary_part;\r\n return new Complex(real, imag);\r\n }",
"@Override\r\n public int compareTo(Complex o) {\r\n if (this.getReal() == o.getReal()) {\r\n return Double.compare(this.getImaginary(), o.getImaginary());\r\n } else {\r\n return Double.compare(this.getReal(), o.getReal());\r\n }\r\n }",
"public static Complex double2Complex(double d) {\r\n\t\treturn new Complex(d, 0);\r\n\t}",
"public Complex_Number(double realPart)\n {\n this(realPart,0,0);\n }",
"static PointDouble complex(double r, double arg) {\n return new PointDouble(r * Math.cos(arg), r * Math.sin(arg));\n }",
"public void add(Complex other) {\n this.real += other.real;\n this.imag += other.imag;\n }",
"public Complex getConjugate() {\n\t\treturn new Complex(real, -imaginary);\n\t}",
"public ComplexNumber add(ComplexNumber c) {\n\t\tif (c == null) {\n\t\t\tthrow new NullPointerException(\"The given complex number is null!\");\n\t\t}\n\t\tdouble real = getReal() + c.getReal();\n\t\tdouble imaginary = getImaginary() + c.getImaginary();\n\n\t\treturn new ComplexNumber(real, imaginary);\n\t}",
"public ComplexVariable(double re, double im) {\n\t\tthis.re = re;\n\t\tthis.im = im;\n\t}",
"public Number(double realPart, double imaginaryPart) {\n \n /* Initializes the real and imaginary values of the number*/\n this.realPart = realPart;\n this.imaginaryPart = imaginaryPart;\n }",
"public ComplexFractal(String name, FractalType type) {\r\n\t\tif(name == null){\r\n\t\t\tthrow new NullPointerException(\"Argument name is null\");\r\n\t\t}\r\n\t\tthis.name = name;\r\n\t\tthis.type = type;\r\n\t\tformulas = new ArrayList<IComplexFormula>();\r\n\t}",
"public MComplex() {\r\n\t\ta = b = r = phi = 0;\r\n\t\tcartesian = polar = true;\r\n\t}",
"public static ComplexTypeMBean getComplexTypeMBean()\n {\n return new ComplexType();\n }",
"public FImage inverse() {\n\t\tfinal int cs = real.getCols();\n\t\tfinal int rs = real.getRows();\n\n\t\tfinal FloatFFT_2D fft = new FloatFFT_2D(rs, cs);\n\t\tfinal float[][] prepared = new float[rs][cs * 2];\n\t\tfor (int y = 0; y < rs; y++) {\n\t\t\tfor (int x = 0; x < cs; x++) {\n\t\t\t\tprepared[y][x * 2] = real.pixels[y][x];\n\t\t\t\tprepared[y][1 + x * 2] = imaginary.pixels[y][x];\n\t\t\t}\n\t\t}\n\n\t\tfft.complexInverse(prepared, true);\n\n\t\tfinal FImage image = new FImage(cs, rs);\n\t\tFourierTransform.unprepareData(prepared, image, centre);\n\n\t\treturn image;\n\t}",
"public void setVal(Complex c) {\n\t\tif (c == null) {\n\t\t\tthis.re = 0;\n\t\t\tthis.im = 0;\n\t\t}\n\t\telse {\n\t\t\tthis.re = c.re;\n\t\t\tthis.im = c.im;\n\t\t}\n\t}",
"public Complex add(Complex other) {\r\n Complex result = new Complex();\r\n result.real = this.real + other.real;\r\n result.imaginary = this.imaginary + other.imaginary;\r\n return result;\r\n }",
"public Complex conjugate() {\r\n return new Complex(this.getReal(), this.getImag() * -1);\r\n }",
"public T caseComplexNode(ComplexNode object) {\r\n\t\treturn null;\r\n\t}",
"public Complex add(Complex c) {\n return new Complex(this.re + c.re, this.im + c.im);\n }",
"public Complex add(Complex d) {\n\t\tdouble imagSum =this.getImag()+ d.getImag();\n\t\tdouble realSum = this.getReal()+d.getReal();\n\t\tComplex result = new Complex(realSum, imagSum);\n\t\treturn result;\n\t}",
"public ComplexNum copy() {\n /*\n * returns a deep copy of this complex number\n * */\n\n return new ComplexNum(realPart, imaginaryPart);\n }",
"public Complex(int r, int i){\r\n\t this((double) r, (double) i);\r\n\t\t//chain the input from this constructor to the next constructor,\r\n\t\t// which has a (double, double) signature\r\n\t}",
"public void multiply(ComplexNum otherComplexNum) {\n\n double newRealPart = realPart * otherComplexNum.getRealPart() - imaginaryPart * otherComplexNum.getImaginaryPart();\n double newImaginaryPart = realPart * otherComplexNum.getImaginaryPart() + imaginaryPart * otherComplexNum.getRealPart();\n this.realPart = newRealPart;\n this.imaginaryPart = newImaginaryPart;\n }",
"public static ObjectInstance getComplexTypeObjectInstance()\n {\n ObjectName o = null;\n try\n {\n Hashtable<String, String> properties = new Hashtable<String, String>(\n 1);\n properties.put(\"theLabel\", getComplexTypeMBean().getTheLabel());\n properties.put(\"complexitem\", getComplexTypeMBean()\n .getComplexClass().toString());\n o = new ObjectName(_domain, properties);\n }\n catch (Exception e)\n {\n Assert\n .fail(\"Creation of 'ComplexType' ObjectInstance could not be created. \"\n + e.getMessage());\n }\n return new ObjectInstance(o, new ComplexType().getClass().getName());\n }",
"private Complex getComplex(double x, double y) {\n return this.mainWindow.getCurrentFractal().getComplexFromPoint(x, y);\n }"
] | [
"0.8144405",
"0.79233056",
"0.7789587",
"0.74856794",
"0.7441271",
"0.7402692",
"0.7322997",
"0.6779107",
"0.6551032",
"0.64544666",
"0.6411795",
"0.6405162",
"0.6343212",
"0.63135487",
"0.61052024",
"0.6023775",
"0.59965444",
"0.5946286",
"0.5895711",
"0.58566487",
"0.58391553",
"0.5789354",
"0.5775173",
"0.57287914",
"0.5712909",
"0.5630634",
"0.55945766",
"0.55605817",
"0.5539758",
"0.5509864",
"0.5485428",
"0.5461976",
"0.54468125",
"0.5397987",
"0.53836507",
"0.5356636",
"0.5350081",
"0.5309184",
"0.52773297",
"0.52656806",
"0.5229779",
"0.51930517",
"0.51495093",
"0.5145501",
"0.50953376",
"0.50916743",
"0.50868654",
"0.5076732",
"0.50529206",
"0.50522757",
"0.4986169",
"0.49855545",
"0.49522948",
"0.49481162",
"0.4929519",
"0.49267706",
"0.49145508",
"0.4910706",
"0.49064967",
"0.4894008",
"0.48700157",
"0.4860929",
"0.48601118",
"0.4850913",
"0.48490074",
"0.48188895",
"0.48068762",
"0.4806865",
"0.48053548",
"0.47907063",
"0.47865376",
"0.47479704",
"0.47385466",
"0.47376302",
"0.47372782",
"0.47367847",
"0.47209188",
"0.46936458",
"0.4682837",
"0.465417",
"0.46442536",
"0.46174073",
"0.46051463",
"0.46010587",
"0.45927876",
"0.4592239",
"0.45883918",
"0.45829433",
"0.45814362",
"0.4576203",
"0.45740736",
"0.4572386",
"0.45607153",
"0.45526892",
"0.4547767",
"0.45378986",
"0.45269027",
"0.45262063",
"0.4492278",
"0.44922775"
] | 0.80178624 | 1 |
Converts a ComplexImage to a ComplexImage | public static ComplexImage toComplex(ComplexImage img) {
int X = img.X();
int Y = img.Y();
ComplexImage newimg = null;
newimg = new ComplexImage(X, Y);
for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
newimg.setReal(x, y, img.getReal(x, y));
newimg.setImag(x, y, img.getImag(x, y));
}
}
return newimg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ComplexImage toComplex(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat gray;\n\t\tComplexImage newimg = new ComplexImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tnewimg.setReal(x, y, gray);\n\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toComplex((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toComplex((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toComplex((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toComplex((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toComplex((ComplexImage) img);\n\t\t}\n\t}",
"public static ComplexImage toComplex(RealColorImage img)\n\t\t\tthrows ColorModelNotSupportedException, ColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ComplexImage toComplex(ColorImage img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat real;\n\t\tComplexImage newimg = null;\n\t\tswitch (img.getColorModel()) {\n\t\tcase ColorImage.RGB:\n\t\t\tnewimg = new ComplexImage(X, Y);\n\t\t\tfor (int y = 0; y < Y; y++) {\n\t\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\t\tcolor = img.get(x, y);\n\t\t\t\t\treal = (float) color[0] * 0.299f + (float) color[1] * 0.587f + (float) color[2]\n\t\t\t\t\t\t\t* 0.114f;\n\t\t\t\t\tnewimg.setReal(x, y, real);\n\t\t\t\t\tnewimg.setImag(x, y, 0f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ColorImage.CMY:\n\t\tcase ColorImage.YIQ:\n\t\tcase ColorImage.HSV:\n\t\tcase ColorImage.HLS:\n\t\t\tthrow new ColorModelNotSupportedException();\n\t\tdefault:\n\t\t\tthrow new ColorModelUnknownException();\n\t\t}\n\t\treturn newimg;\n\t}",
"public static GrayImage toGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = null;\n\t\tnewimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, (int) img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static RealGrayImage toRealGray(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealGrayImage newimg = null;\n\t\tnewimg = new RealGrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.getReal(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public abstract BufferedImage transform();",
"public native void blobToImage(ImageInfo imageInfo, byte[] blob)\n\t\t\tthrows MagickException;",
"public BufferedImage toImage(BufferedImage image) throws FFTException {\r\n\t\treturn toImage(image, 0);\r\n\t}",
"public static Bitmap convertSingleBitmap (PicObject picOb){\n Bitmap bitmap = decodeBase64(picOb.getImage());\n captionListNews.add(picOb.getCaption());\n return bitmap;\n }",
"private Image bitmap2JPEG(Bitmap bit) {\n\n Image baseImage = new Image();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bit.compress(Bitmap.CompressFormat.JPEG, 90, stream);\n byte[] imageBytes = stream.toByteArray();\n baseImage.encodeContent(imageBytes);\n\n return baseImage;\n }",
"public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }",
"public MagickImage(ImageInfo imageInfo, byte[] blob) throws MagickException {\n\t\tblobToImage(imageInfo, blob);\n\t}",
"public static void convert( ImageBase input, ImageBase output ) {\n\n\t\tImageType typeIn = input.getImageType();\n\t\tImageType typeOut = output.getImageType();\n\n\t\tif (input instanceof ImageGray) {\n\t\t\tImageGray sb = (ImageGray)input;\n\t\t\tif (output instanceof ImageGray) {\n\t\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\t\toutput.setTo(input);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (output instanceof Planar) {\n\t\t\t\tPlanar ms = (Planar)output;\n\t\t\t\tfor (int i = 0; i < ms.getNumBands(); i++) {\n\t\t\t\t\tconvert(input, ms.getBand(i));\n\t\t\t\t}\n\t\t\t} else if (output instanceof ImageInterleaved) {\n\t\t\t\tImageInterleaved il = (ImageInterleaved)output;\n\t\t\t\tfor (int i = 0; i < il.getNumBands(); i++) {\n\t\t\t\t\tGImageMiscOps.insertBand(sb, i, il);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageInterleaved) {\n\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\toutput.setTo(input);\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageGray) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mi.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mi.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mi, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mi, so);\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageInterleaved) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof Planar) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tPlanar mo = (Planar)output;\n\n\t\t\tif (mi.getBandType() == mo.getBandType()) {\n\t\t\t\tmo.setTo(mi);\n\t\t\t} else {\n\t\t\t\tfor (int i = 0; i < mi.getNumBands(); i++) {\n\t\t\t\t\tconvert(mi.getBand(i), mo.getBand(i));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof Planar) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageGray) {\n\t\t\tImageInterleaved mb = (ImageInterleaved)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mb.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mb.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mb, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mb, so);\n\t\t\t}\n\t\t} else {\n\t\t\tString nameInput = input.getClass().getSimpleName();\n\t\t\tString nameOutput = output.getClass().getSimpleName();\n\t\t\tthrow new IllegalArgumentException(\"Don't know how to convert between input types. \" + nameInput + \" \" + nameOutput);\n\t\t}\n\t}",
"public IImage createImage(IImage image, int x, int y, int width, int height, int transform) {\n return null;\r\n }",
"public native MagickImage enhanceImage() throws MagickException;",
"private Bitmap getScaledImage(Bitmap imageBitmap) {\n\t\tBitmap scaledBitmap = null;\n\t\ttry {\n\n\t\t\tMatrix matrix = new Matrix();\n\t\t\tmatrix.postRotate(90);\n\n\t\t\tBitmap rotatedBitmap = Bitmap.createScaledBitmap(imageBitmap, PHOTO_W, PHOTO_H, false);\n\t\t\tscaledBitmap = Bitmap.createBitmap(rotatedBitmap , 0, 0, rotatedBitmap.getWidth(), rotatedBitmap.getHeight(), matrix, true);\n\n\t\t} catch (Throwable e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn scaledBitmap;\n\t}",
"private Complex2[][] imgWithOtherMagnitude(Complex2[][] img_1, Complex2[][] img_2) {\n Complex2[][] result = new Complex2[M][N];\n\n for(int x = 0; x < M; x++) {\n for (int y = 0; y < N; y++) {\n double img_1Magnitude = img_1[x][y].Betrag();\n double img_2Phase = img_2[x][y].Phase();\n\n double newReal = img_1Magnitude * Math.cos(img_2Phase);\n double newImag = img_1Magnitude * Math.sin(img_2Phase);\n\n result[x][y] = new Complex2(newReal, newImag);\n }\n }\n\n return result;\n }",
"public SbMatrix\ngetObjectToImage( SoNode node) \n//\n////////////////////////////////////////////////////////////////////////\n{\n getMatrix(node);\n return matrixAction.getTextureMatrix();\n}",
"private Image getScaledImage(Image image, float x, float y) {\n AffineTransform transform = new AffineTransform();\n transform.scale(x, y);\n transform.translate(\n (x-1) * image.getWidth(null) / 2,\n (y-1) * image.getHeight(null) / 2);\n\n // create a transparent (not translucent) image\n Image newImage = gc.createCompatibleImage(\n image.getWidth(null),\n image.getHeight(null),\n Transparency.BITMASK);\n\n // draw the transformed image\n Graphics2D g = (Graphics2D)newImage.getGraphics();\n g.drawImage(image, transform, null);\n g.dispose();\n\n return newImage;\n }",
"private void enhanceImage(){\n }",
"BufferedImage outputImage();",
"private javaxt.io.Image _transform_simple(javaxt.io.Image src_img, \n double[] src_bbox, int[] dst_size, double[] dst_bbox){\n\n double[] src_quad = new double[]{0, 0, src_img.getWidth(), src_img.getHeight()};\n SRS.transf to_src_px =SRS.make_lin_transf(src_bbox, src_quad);\n\n //minx, miny = to_src_px((dst_bbox[0], dst_bbox[3]));\n double[] min = to_src_px.transf(dst_bbox[0], dst_bbox[3]);\n double minx = min[0];\n double miny = min[1];\n\n //maxx, maxy = to_src_px((dst_bbox[2], dst_bbox[1]));\n double[] max = to_src_px.transf(dst_bbox[2], dst_bbox[1]);\n double maxx = max[0];\n double maxy = max[1];\n\n double src_res = (src_bbox[0]-src_bbox[2])/src_img.getWidth();\n double dst_res = (dst_bbox[0]-dst_bbox[2])/dst_size[0];\n\n double tenth_px_res = Math.abs(dst_res/(dst_size[0]*10));\n javaxt.io.Image img = new javaxt.io.Image(src_img.getBufferedImage());\n if (Math.abs(src_res-dst_res) < tenth_px_res){\n img.crop(cint(minx), cint(miny), dst_size[0], dst_size[1]);\n //src_img.crop(cint(minx), cint(miny), cint(minx)+dst_size[0], cint(miny)+dst_size[1]);\n return img; //src_img;\n }\n else{\n img.crop(cint(minx), cint(miny), cint(maxx)-cint(minx), cint(maxy)-cint(miny));\n img.resize(dst_size[0], dst_size[1]);\n //src_img.crop(cint(minx), cint(miny), cint(maxx), cint(maxy));\n //src_img.resize(dst_size[0], dst_size[1]);\n return img; //src_img;\n }\n //ImageSource(result, size=dst_size, transparent=src_img.transparent)\n }",
"public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"public static Object getCompositeImage(Object baseImage, Object overlayImage) {\n\t\tList<Object> images = new ArrayList<Object>(2);\n\t\timages.add(baseImage);\n\t\timages.add(overlayImage);\n\t\t\n\t\tObject image = new ComposedImage(images);\n\t\treturn image;\n\t}",
"Builder addImage(ImageObject value);",
"List<List<Pixel>> transform(Image img, String operation);",
"public T caseMultiImage(MultiImage object) {\n\t\treturn null;\n\t}",
"private void ScaleImage(){\n\t\tBufferedImage resizedImage = new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);\n\t\tGraphics2D g2 = resizedImage.createGraphics();\n\t\tg2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\t\tg2.drawImage(image, 0, 0, this.getWidth(), this.getHeight(), null);\n\t\tg2.dispose();\n\t\tthis.image = resizedImage;\n\t}",
"public Coloca_imagen(){\n \n \n }",
"public Mat getConvertedImage() {\n return this.convertedImage;\n }",
"public native MagickImage magnifyImage() throws MagickException;",
"public ComplexNumber(ComplexNumber cn) {\n\t\treal = cn.getReal();\n\t\timag = cn.getImag();\n\t}",
"public static ComplexNumber fromImaginary(double imaginary) {\n\t\treturn new ComplexNumber(0, imaginary);\n\t}",
"public native MagickImage minifyImage() throws MagickException;",
"public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}",
"public native byte[] imageToBlob(ImageInfo imageInfo);",
"private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}",
"public static BufferedImage copyImage(BufferedImage bi) {\n ColorModel cm = bi.getColorModel();\n boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n WritableRaster raster = bi.copyData(null);\n return new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n }",
"@Override\r\n\t\tpublic MyImage createMyImage(MyImage myimage) {\r\n\t\t\t\r\n\t\t\treturn myimg.createMyImage(myimage);\r\n\t\t}",
"public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"public static Object getCompositeImage(Object baseImage, Object overlayImage, final int moveX,\n\t\t\tfinal int moveY) {\n\t\tList<Object> images = new ArrayList<Object>(2);\n\t\timages.add(baseImage);\n\t\timages.add(overlayImage);\n\t\t\n\t\tObject image = new ComposedImage(images) {\n\t\t\t@Override\n\t\t\tpublic List<Point> getDrawPoints(Size size) {\n\t\t\t\tList<ComposedImage.Point> result = super.getDrawPoints(size);\n\t\t\t\tresult.get(1).x = moveX;\n\t\t\t\tresult.get(1).y = moveY;\n\t\t\t\treturn result;\n\t\t\t}// getDrawPoints\n\t\t};\n\t\treturn image;\n\t}",
"public static BufferedImage scaleImage(BufferedImage image, double scale){\n\t\tWritableRaster inRaster = image.getRaster();\n\t\t\n\t\tint w = (int)Math.round(image.getWidth() * scale);\n\t\tint h = (int)Math.round(image.getHeight() * scale);\n\t\tWritableRaster outRaster = inRaster.createCompatibleWritableRaster(w, h);\n\t\t\n\t\tObject outData = null;\n\t\tfor(int j=0; j<h; j++){\n\t\t\tfor(int i=0; i<w; i++){\n\t\t\t\toutData = inRaster.getDataElements((int)(i/scale), (int)(j/scale), outData);\n\t\t\t\toutRaster.setDataElements(i, j, outData);\n\t\t\t}\n\t\t}\n\t\t\n\t\tBufferedImage outImage = new BufferedImage(image.getColorModel(), outRaster, image.isAlphaPremultiplied(), null);\n\t\treturn outImage;\n\t}",
"public BufferedImage rescaleImage(BufferedImage image, float scale) {\r\n int[][][] arr = convertToArray(image);\r\n return convertToBimage(rescaleImage(arr, scale));//return array\r\n }",
"private Image getScaledImage(Image sourceImage)\n {\n //create storage for the new image\n BufferedImage resizedImage = new BufferedImage(50, 50,\n BufferedImage.TYPE_INT_ARGB);\n\n //create a graphic from the image\n Graphics2D g2 = resizedImage.createGraphics();\n\n //sets the rendering options\n g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,\n RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\n //copies the source image into the new image\n g2.drawImage(sourceImage, 0, 0, 50, 50, null);\n\n //clean up\n g2.dispose();\n\n //return 50 x 50 image\n return resizedImage;\n }",
"public VCImage getVCImage() throws ImageException {\r\n\tif (originalRGB==null && originalDouble==null){\r\n\t\tthrow new ImageException(\"data is not loaded\");\r\n\t}\r\n\t\r\n\tbyte bytepix[] = null;\r\n\t\r\n\t\r\n\tif (originalRGB!=null){\r\n\t\tint[] uniquePixelValues = getUniquePixelValues();\r\n\t\tif(uniquePixelValues.length >256){\r\n\t\t\tthrow new ImageException(\"VCImage can't have more than 256 pixel values\");\r\n\t\t}\r\n\t\tbytepix = new byte[originalRGB.length];\r\n\t\tfor (int i=0;i<originalRGB.length;i++){\r\n\t\t\tint oRGBIndex = -1;\r\n\t\t\tfor(int j=0;j<uniquePixelValues.length;j+= 1){\r\n\t\t\t\tif(uniquePixelValues[j] == originalRGB[i]){\r\n\t\t\t\t\toRGBIndex = j;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(oRGBIndex >= 0){\r\n\t\t\t\tbytepix[i] = ((byte)oRGBIndex);\r\n\t\t\t}else{\r\n\t\t\t\tthrow new ImageException(\"Unique Pixel value missing in originalRGB array\");\r\n\t\t\t}\r\n\t\t\t//int intPix = 0xffffff&originalRGB[i];\r\n\t\t\t//int red = intPix&0xff;\r\n\t\t\t//int green = (intPix>>8)&0xff;\r\n\t\t\t//int blue = (intPix>>16)&0xff;\r\n\t\t\t//byte pix = (byte)Math.max(red,Math.max(green,blue));\r\n\t\t\t//bytepix[i] = pix;\r\n\t\t}\r\n\t}else{\r\n\t\tbytepix = new byte[originalDouble.length];\r\n\t\tfor (int i=0;i<originalDouble.length;i++){\r\n\t\t\tbytepix[i] = (byte)(0xff&(int)originalDouble[i]);\r\n\t\t}\r\n\t}\r\n\tVCImageUncompressed vci = new VCImageUncompressed(null,bytepix,new Extent(getSizeX(),getSizeY(),getSizeZ()),getSizeX(),getSizeY(),getSizeZ());\r\n\treturn vci;\r\n}",
"private javaxt.io.Image _transform(javaxt.io.Image src_img, double[] src_bbox, int[] dst_size, double[] dst_bbox){\n\n //Use GeoTools to reproject src_img to the output projection.\n try{\n\n //Compute geodetic w/h in degrees (used to specify the Envelope2D)\n double x1 = x(src_bbox[0]);\n double x2 = x(src_bbox[2]);\n double w = 0;\n if (x1>x2) w = x1-x2;\n else w = x2-x1;\n //System.out.println(x1 + \" to \" + x2 + \" = \" + (w));\n\n double y1 = y(src_bbox[1]);\n double y2 = y(src_bbox[3]);\n double h = 0;\n if (y1>y2) h = y1-y2;\n else h = y2-y1;\n //System.out.println(y1 + \" to \" + y2 + \" = \" + (h));\n\n\n System.out.println(src_bbox[0] + \", \" + src_bbox[1] + \", \" + src_bbox[2] + \", \" + src_bbox[3]);\n System.out.println(dst_bbox[0] + \", \" + dst_bbox[1] + \", \" + dst_bbox[2] + \", \" + dst_bbox[3]);\n \n Envelope2D envelope =\n new Envelope2D(this.src_srs.crs, src_bbox[0], src_bbox[1], w, h);\n\n GridCoverage2D gc2d =\n new GridCoverageFactory().create(\"BMImage\", src_img.getBufferedImage(), envelope);\n\n GridCoverage2D gc2dProj =\n (GridCoverage2D)Operations.DEFAULT.resample(gc2d, this.dst_srs.crs);\n\n //TODO: Crop Output?\n /* \n final AbstractProcessor processor = new DefaultProcessor(null);\n final ParameterValueGroup param = processor.getOperation(\"CoverageCrop\").getParameters();\n \n final GeneralEnvelope crop = new GeneralEnvelope( ... ); //<--Define new extents\n param.parameter(\"Source\").setValue( gc2dProj );\n param.parameter(\"Envelope\").setValue( crop );\n\n gc2dProj = (GridCoverage2D) processor.doOperation(param); \n */\n\n src_img = new javaxt.io.Image(gc2dProj.getRenderedImage());\n src_img.resize(dst_size[0], dst_size[1], false);\n\n }\n catch (Exception e){\n e.printStackTrace();\n }\n\n\n /*\n //Start port of original python code...\n src_bbox = this.src_srs.align_bbox(src_bbox);\n dst_bbox = this.dst_srs.align_bbox(dst_bbox);\n int[] src_size = new int[]{src_img.getWidth(), src_img.getHeight()}; //src_img.size\n double[] src_quad = new double[]{0, 0, src_size[0], src_size[1]};\n double[] dst_quad = new double[]{0, 0, dst_size[0], dst_size[1]};\n \n SRS.transf to_src_px = SRS.make_lin_transf(src_bbox, src_quad);\n SRS.transf to_dst_w = SRS.make_lin_transf(dst_quad, dst_bbox);\n\n //This segment still needs to be ported to java\n meshes = []; \n def dst_quad_to_src(quad):\n src_quad = []\n for dst_px in [(quad[0], quad[1]), (quad[0], quad[3]),\n (quad[2], quad[3]), (quad[2], quad[1])]:\n dst_w = to_dst_w(dst_px)\n src_w = self.dst_srs.transform_to(self.src_srs, dst_w)\n src_px = to_src_px(src_w)\n src_quad.extend(src_px)\n return quad, src_quad\n */\n\n /*\n int mesh_div = this.mesh_div;\n while (mesh_div > 1 && ((dst_size[0] / mesh_div) < 10 || (dst_size[1] / mesh_div) < 10))\n mesh_div -= 1;\n for (int[] quad : griddify(dst_quad, mesh_div))\n meshes.append(dst_quad_to_src(quad));\n result = src_img.as_image().transform(dst_size, Image.MESH, meshes,\n image_filter[self.resampling])\n */\n return src_img;\n }",
"public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}",
"@Override\n\tpublic boolean baseToImg() {\n\t\tList<Image> imgList = imageRepository.findAll();\n\t\tfor (Image img : imgList) {\n\t\t\tString base = img.getSource();\n\t\t\tFiles file = new Files(img.getSaegimId(), \"jpg\");\n\t\t\tfile = fileRepository.save(file);\n\t\t\tLong fileId = file.getId();\n\t\t\t\n\t\t\tBase64ToImgDecoder.decoder(base, dir + fileId + '.' + \"jpg\");\n\t\t}\n\t\treturn true;\n\t}",
"public Mat2Image() {\n }",
"Image createImage();",
"Picture binaryComponentImage() throws Exception;",
"public static RealColorImage toRealColor(Image img) throws ColorModelNotSupportedException,\n\t\t\tColorModelUnknownException {\n\t\tif (img instanceof GrayImage) {\n\t\t\treturn toRealColor((GrayImage) img);\n\t\t} else if (img instanceof RealGrayImage) {\n\t\t\treturn toRealColor((RealGrayImage) img);\n\t\t} else if (img instanceof ColorImage) {\n\t\t\treturn toRealColor((ColorImage) img);\n\t\t} else if (img instanceof RealColorImage) {\n\t\t\treturn toRealColor((RealColorImage) img);\n\t\t} else {\n\t\t\treturn toRealColor((ComplexImage) img);\n\t\t}\n\t}",
"public Object convertValue(Object value, TemplateImageResolver imageResolver);",
"public Complex multiply(Complex complex) {\r\n double real =\r\n this.real_part * complex.real_part - this.imaginary_part\r\n * complex.imaginary_part;\r\n double imag =\r\n this.real_part * complex.imaginary_part + this.imaginary_part\r\n * complex.real_part;\r\n return new Complex(real, imag);\r\n }",
"IMG createIMG();",
"public ImageIcon scalePicture(ImageIcon image) {\n\t\tImage transImage = image.getImage();\n\t\tImage scaledImage = transImage.getScaledInstance(140, 190, Image.SCALE_SMOOTH);\t\t\n\t\timage = new ImageIcon(scaledImage);\n\t\treturn image;\n\t}",
"public Image getImagen() {\n\t\tRectangle rootFigureBounds = this.getBounds();\n\t\tGC figureCanvasGC = new GC(this.canvas);\n\n\t\tImage image = new Image(this.canvas.getDisplay(), rootFigureBounds.width,\n\t\t\t\trootFigureBounds.height);\n\t\tGC imageGC = new GC(image);\n\n\t\timageGC.setBackground(figureCanvasGC.getBackground());\n\t\timageGC.setForeground(figureCanvasGC.getForeground());\n\t\timageGC.setFont(figureCanvasGC.getFont());\n\t\timageGC.setLineStyle(figureCanvasGC.getLineStyle());\n\t\timageGC.setLineWidth(figureCanvasGC.getLineWidth());\n\t\t// imageGC.setXORMode(figureCanvasGC.getXORMode());\n\n\t\tGraphics imgGraphics = new SWTGraphics(imageGC);\n\t\tthis.paint(imgGraphics);\n\n\t\treturn image;\n\t}",
"private BufferedImage makeSquare(BufferedImage photo) {\n int width = photo.getWidth();\n int height = photo.getHeight();\n int size = Math.min(width, height);\n\n return photo.getSubimage((width/2) - (size/2), (height/2) - (size/2), size, size);\n }",
"public abstract BufferedImage applyTo(BufferedImage image);",
"public void doScaling() {\n try {\n int orientation = getExifOrientation(file);\n System.out.println(file.getName());\n //Dimension d = Imaging.getImageSize(file);\n ImageInputStream imageInputStream = ImageIO.createImageInputStream(file);\n // Use a subsampled image from the original, avoids read images too large to fit in memory\n BufferedImage bufferedImage = subsampleImage(imageInputStream, TARGET_WIDTH * 2, TARGET_HEIGHT * 2);\n ImageInformation ii=new ImageInformation(orientation, bufferedImage.getWidth(), bufferedImage.getHeight());\n AffineTransform transform=getExifTransformation(ii);\n bufferedImage=transformImage(bufferedImage, transform); \n Scalr.Mode mode;\n // calculate which side will be largest/smaller\n // this works with any image size\n double scaleX=(TARGET_WIDTH*1.0)/(bufferedImage.getWidth()*1.0);\n double scaleY=(TARGET_HEIGHT*1.0)/(bufferedImage.getHeight()*1.0);\n if (scaleX<scaleY) {\n mode = Scalr.Mode.FIT_TO_WIDTH;\n } else {\n mode = Scalr.Mode.FIT_TO_HEIGHT;\n } \n \n BufferedImage thumbnail = Scalr.resize(bufferedImage,\n Scalr.Method.QUALITY,\n mode, TARGET_WIDTH, TARGET_HEIGHT,\n Scalr.OP_ANTIALIAS);\n BufferedImage combined = new BufferedImage(TARGET_WIDTH, TARGET_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n int x = 0, y = 0;\n if (mode == Scalr.Mode.FIT_TO_HEIGHT) {\n x = (TARGET_WIDTH - thumbnail.getWidth()) / 2;\n }\n if (mode == Scalr.Mode.FIT_TO_WIDTH) {\n y = (TARGET_HEIGHT - thumbnail.getHeight()) / 2;\n }\n Graphics g = combined.getGraphics();\n g.setColor(new java.awt.Color(0.0f, 0.0f, 0.0f, 0.0f));\n g.fillRect(0, 0, combined.getWidth(), combined.getHeight());\n g.drawImage(thumbnail, x, y, null);\n g.dispose();\n //Writes test subsampled image taken from original\n if (saveSubSampled) {\n ImageIO.write(bufferedImage, OUTPUT_EXTENSION, new File(output));\n }\n //Writes thumbnail, created from the subsampled image.\n ImageIO.write(combined, OUTPUT_EXTENSION, new File(output_thumb));\n\n } catch (IOException ex) {\n Logger.getLogger(Scaler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (Exception ex) {\n Logger.getLogger(Scaler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"private Bitmap translateImgToBitmap(String filepath){\n File imgFile = new File(filepath);\n\n if (imgFile.exists()) {\n Bitmap bitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());\n\n float imgScale = (float) bitmap.getHeight() / 1620;\n bitmap = Bitmap.createScaledBitmap(bitmap,\n Math.round(bitmap.getWidth() / imgScale),\n Math.round(bitmap.getHeight() / imgScale), true);\n\n return bitmap;\n\n } else {\n Toast.makeText(getApplicationContext(), \"Die Datei wurde nicht gefunden.\", Toast.LENGTH_SHORT).show();\n return null;\n }\n }",
"@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }",
"public ImageConverter() {\n this.source = new Mat();\n this.convertedImage = new Mat();\n }",
"@SuppressWarnings(\"unused\")\n\tprivate void cloneImage() {\n//\t\tColorModel cm = offimg.getColorModel();\n//\t\t boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n//\t\t WritableRaster raster = offimg.copyData(null);\n//\t\t offimg2 = new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n//\t\t BufferedImage currentImage = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);\n\n\t//Fastest method to clone the image (DOES NOT WORK for MACOS)\n//\t\t int[] frame = ((DataBufferInt)offimg.getRaster().getDataBuffer()).getData();\n//\t\t int[] imgData = ((DataBufferInt)offimg2.getRaster().getDataBuffer()).getData();\n//\t\t System.arraycopy(frame,0,imgData,0,frame.length);\n\t}",
"public BufferedImage getScaledImage ( float scale ) {\n\n int oldW = param.Parameters.IMAGEW;\n int oldH = param.Parameters.IMAGEH;\n\n param.Parameters.SCALE = scale;\n param.Parameters.IMAGEW = (int)((float)param.Parameters.IMAGEW * param.Parameters.SCALE);\n param.Parameters.IMAGEH = (int)((float)param.Parameters.IMAGEH * param.Parameters.SCALE);\n\n BufferedImage img =\n param.Parameters.PROBLEM.getData(param.Parameters.STATE, program, 0, 0);\n\n param.Parameters.SCALE = 1.0f;\n param.Parameters.IMAGEW = oldW;\n param.Parameters.IMAGEH = oldH;\n\n System.gc();\n\n return img;\n\n }",
"public void add(Complex c){\n\t\tre += c.getRe();\n\t\tim += c.getIm();\n\t}",
"private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\n }",
"Imagem getImagem();",
"com.yahoo.xpathproto.TransformTestProtos.ContentImage getImageByTransform();",
"private Bitmap getCompressedBitmap(Bitmap bitmap) {\n if (bitmap.getWidth() > MAX_WIDTH || bitmap.getHeight() > MAX_HEIGHT) {\n float scale = Math.min(((float) MAX_WIDTH / bitmap.getWidth()),\n ((float) MAX_HEIGHT / bitmap.getHeight()));\n Matrix matrix = new Matrix();\n matrix.postScale(scale, scale);\n Bitmap resizedImage = Bitmap.createBitmap(bitmap, 0, 0,\n bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n bitmap.recycle();\n return resizedImage;\n }\n return bitmap;\n }",
"ImageTranscoder mo28916a(ImageFormat cVar, boolean z);",
"public native MagickImage despeckleImage() throws MagickException;",
"public SbMatrix\ngetImageToObject(SoNode node)\n//\n////////////////////////////////////////////////////////////////////////\n{\n getMatrix(node);\n return matrixAction.getTextureInverse();\n}",
"private void updateImageSize(float scale) {\n int w = (int) (mImageWidth * scale);\n int h = (int) (mImageHeight * scale);\n mCanvas.setCoordinateSpaceWidth(w);\n mCanvas.setCoordinateSpaceHeight(h);\n mCanvas.getContext2d().drawImage(ImageElement.as(image.getElement()), 0, 0, w, h);\n }",
"Builder addImage(ImageObject.Builder value);",
"public static void ponerImagenConFormatoRedondoEnImageView(Context context, Bitmap bitmap, ImageView imageview) {\n RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.getResources(), bitmap);\n circularBitmapDrawable.setCircular(true);\n imageview.setImageDrawable(circularBitmapDrawable);\n imageview.setScaleType(ImageView.ScaleType.CENTER_CROP);\n }",
"public ModelImage getResultImage() {\r\n return resultImage;\r\n }",
"public ModelImage getResultImage() {\r\n return resultImage;\r\n }",
"public ModelImage getResultImage() {\r\n return resultImage;\r\n }",
"public IplImage toIplImage(BufferedImage bufferedImage){\n IplImage iplImage = new IplImage();\n iplImage = IplImage.createFrom(bufferedImage);\n return iplImage;\n }",
"public void uploadConstructorPhoto(ImageView container, String constructorId){\n\n try{\n container.setImageBitmap(BitmapFactory.decodeStream(getActivity().getAssets().open(\"constructors/\" +\n constructorId + \".gif\")));\n }\n catch (FileNotFoundException fnf){\n container.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.unknown_const));\n }\n catch (IOException io){\n Log.e(\"MyCustmBsAdptr/ConstrPh\", io.getMessage());\n }\n }",
"public Complex getComplex() {return this;}",
"public PlainImage(Image image) {\r\n\t\tthis.image = image;\r\n\t}",
"private Image ConvertirImagen(byte[] bytes) throws IOException {\n ByteArrayInputStream bis = new ByteArrayInputStream(bytes);\n Iterator readers = ImageIO.getImageReadersByFormatName(\"jpeg\");\n ImageReader reader = (ImageReader) readers.next();\n Object source = bis;\n ImageInputStream iis = ImageIO.createImageInputStream(source);\n reader.setInput(iis, true);\n ImageReadParam param = reader.getDefaultReadParam();\n return reader.read(0, param);\n }",
"Image createImage(List<List<Pixel>> pixelArray);",
"public static Complex parseComplex(String thingToParse) {\r\n\t\tString trimed = thingToParse.trim();\r\n\t\tString insidTrim = trimed.replaceAll(\"\\\\s+\", \"\");\r\n\t\tint strlen = insidTrim.length();\r\n\t\tif (strlen == 1) {\r\n\t\t\tString realAndImage = insidTrim.substring(0, strlen);\r\n\t\t\tdouble theImag = Double.parseDouble(realAndImage);\r\n\t\t\tif (theImag == 0) {\r\n\t\t\t\tMyDouble realFinal = new MyDouble(0);\r\n\t\t\t\tMyDouble imageFinal = new MyDouble(0);\r\n\t\t\t\tComplex parse = new Complex(realFinal, imageFinal);\r\n\t\t\t\treturn parse;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tint indeOfPlus = insidTrim.indexOf(\"+\");\r\n\r\n\t\tif (indeOfPlus == -1) {\r\n\t\t\tString stringToAvoidFirstMin = insidTrim.substring(1, strlen);\r\n\r\n\t\t\tint indesofMinus = stringToAvoidFirstMin.indexOf(\"-\");\r\n\t\t\tString realString = insidTrim.substring(0, indesofMinus + 1);\r\n\t\t\tdouble thereal = Double.parseDouble(realString);\r\n\t\t\tString imagString = insidTrim.substring(indesofMinus + 1, strlen - 1);\r\n\t\t\tdouble theImag = Double.parseDouble(imagString);\r\n\t\t\tMyDouble realFinal = new MyDouble(thereal);\r\n\t\t\tMyDouble imageFinal = new MyDouble(theImag);\r\n\t\t\tComplex parse = new Complex(realFinal, imageFinal);\r\n\t\t\treturn parse;\r\n\t\t} else {\r\n\t\t\tString realString = insidTrim.substring(0, indeOfPlus);\r\n\t\t\tdouble thereal = Double.parseDouble(realString);\r\n\t\t\tString imagString = insidTrim.substring(indeOfPlus + 1, strlen - 1);\r\n\t\t\tdouble theImag = Double.parseDouble(imagString);\r\n\t\t\tMyDouble realFinal = new MyDouble(thereal);\r\n\t\t\tMyDouble imageFinal = new MyDouble(theImag);\r\n\t\t\tComplex parse = new Complex(realFinal, imageFinal);\r\n\t\t\treturn parse;\r\n\t\t}\r\n\t}",
"static BufferedImage doBuforowanegoObrazu(Image img)//Konwersja image do BufferedImage\n {\n //Twożenie bitmapy \n BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\n // Rysowanie na bitmapie\n Graphics2D bGr = bimage.createGraphics();\n bGr.drawImage(img, 0, 0, null);\n bGr.dispose();\n\n return bimage;\n }",
"public Complex multiply(Complex param) {\r\n\t\tMyDouble r1r2 = this.getReal().multiply(param.getReal());\r\n\t\tMyDouble r1i2 = this.getReal().multiply(param.getImag());\r\n\t\tMyDouble i1r2 = this.getImag().multiply(param.getReal());\r\n\t\tMyDouble i1i2 = this.getImag().multiply(param.getImag());\r\n\t\tMyDouble prodImg = MyDouble.zero.subtract(i1i2);\r\n\t\tMyDouble sum1 = r1r2.add(prodImg);\r\n\t\tMyDouble sum2 = r1i2.add(i1r2);\r\n\t\tComplex multiplyed = new Complex(sum1, sum2);\r\n\t\treturn multiplyed;\r\n\t}",
"private Image scaleImage(Image image) { \n\t\treturn image.getScaledInstance(700, 500, Image.SCALE_SMOOTH); //Going to Scale the Image to the Size and Width Specified with the Highest Smoothness Possible \n\t}",
"@Override\r\n\tpublic BufferedImage transform(BufferedImage image){\n\t\tMat mat = Mat2BufImg.BufImg2Mat(image, BufferedImage.TYPE_3BYTE_BGR, CvType.CV_8UC3);\r\n\t\t//人脸识别\r\n\t\ttry {\r\n\t\t\t//mat --> bufferimage\r\n\t\t\treturn Mat2BufImg.Mat2BufImg(detectFace(mat),\".png\");\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn image;\r\n\t}",
"public ImageProcessor(Pic a) {\n image = a;\n }",
"public int[][][] rescaleImage(int[][][] image, float scale) {\r\n int height = image[0].length;\r\n int width = image.length;\r\n BufferedImage result = new BufferedImage(width, height, 1);\r\n //loop through all pixels.\r\n for (int y = 0; y < height; y++) {\r\n for (int x = 0; x < width; x++) {\r\n int a = image[x][y][0];\r\n int r = image[x][y][1];\r\n int g = image[x][y][2];\r\n int b = image[x][y][3];\r\n\r\n r = (int) (r * scale);\r\n g = (int) (g * scale);\r\n b = (int) (b * scale);\r\n\r\n image[x][y][0] = a;\r\n image[x][y][1] = r;\r\n image[x][y][2] = g;\r\n image[x][y][3] = b;\r\n }\r\n }\r\n return image; //return array\r\n }",
"private static Bitmap getThumbnailImage(Bitmap bm) {\n\n int width = bm.getWidth();\n int height = bm.getHeight();\n\n Bitmap resizedBitmap;\n Bitmap decoded;\n\n if (width > 250 || height > 250) {\n\n float aspectRatio;\n\n //image is too big, resize and compress to 80% quality\n if (width > height) {\n\n aspectRatio = (float) width / (float) height;\n width = 150;\n height = (int) (width / aspectRatio);\n\n } else {\n\n aspectRatio = (float) height / (float) width;\n height = 150;\n width = (int) (height / aspectRatio);\n\n }\n\n resizedBitmap = Bitmap.createScaledBitmap(bm, width, height, false);\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, bytes);\n decoded = BitmapFactory.decodeStream(new ByteArrayInputStream(bytes.toByteArray()));\n bm.recycle();\n resizedBitmap.recycle();\n\n } else {\n\n //image is small, just compress to 90% quality\n resizedBitmap = bm;\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, bytes);\n decoded = BitmapFactory.decodeStream(new ByteArrayInputStream(bytes.toByteArray()));\n bm.recycle();\n resizedBitmap.recycle();\n\n }\n\n return decoded;\n\n }",
"public Image(MyColor [][] myImage) {\n originalImage = myImage; \n }"
] | [
"0.74573886",
"0.7281287",
"0.7230038",
"0.6984901",
"0.6944851",
"0.65357953",
"0.6313489",
"0.62283456",
"0.621007",
"0.58876294",
"0.5565759",
"0.55388135",
"0.55075544",
"0.54613584",
"0.5333835",
"0.52981174",
"0.522691",
"0.5218264",
"0.52069974",
"0.5202413",
"0.5190102",
"0.5133689",
"0.5116214",
"0.5082715",
"0.50488186",
"0.5046602",
"0.50292647",
"0.50185144",
"0.5016018",
"0.5006068",
"0.5000766",
"0.49834993",
"0.49744356",
"0.49576744",
"0.49554092",
"0.49546233",
"0.4948214",
"0.4941565",
"0.49386802",
"0.49185634",
"0.49169496",
"0.49013513",
"0.48999068",
"0.48955604",
"0.48902038",
"0.48857158",
"0.48775104",
"0.48721763",
"0.4867895",
"0.4862448",
"0.485649",
"0.4852057",
"0.4848629",
"0.48384035",
"0.48261747",
"0.48211646",
"0.48148844",
"0.4814786",
"0.4801417",
"0.4789196",
"0.47684777",
"0.47652647",
"0.47619808",
"0.47588894",
"0.47580263",
"0.4747116",
"0.47387728",
"0.47240418",
"0.47187674",
"0.47142205",
"0.47115663",
"0.4709072",
"0.47078687",
"0.4705404",
"0.46893898",
"0.4687399",
"0.46793592",
"0.46722132",
"0.46713394",
"0.4669373",
"0.46529818",
"0.46495137",
"0.46490094",
"0.46490094",
"0.46490094",
"0.46480998",
"0.46447614",
"0.46422645",
"0.4640408",
"0.46397924",
"0.46371454",
"0.46357515",
"0.46335897",
"0.46335784",
"0.4631508",
"0.46257362",
"0.4624279",
"0.4622478",
"0.46193966",
"0.46172702"
] | 0.7872422 | 0 |
NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. | public UpdateFunctionCodeRequest(UpdateFunctionCodeRequest source) {
if (source.FunctionName != null) {
this.FunctionName = new String(source.FunctionName);
}
if (source.Handler != null) {
this.Handler = new String(source.Handler);
}
if (source.CosBucketName != null) {
this.CosBucketName = new String(source.CosBucketName);
}
if (source.CosObjectName != null) {
this.CosObjectName = new String(source.CosObjectName);
}
if (source.ZipFile != null) {
this.ZipFile = new String(source.ZipFile);
}
if (source.Namespace != null) {
this.Namespace = new String(source.Namespace);
}
if (source.CosBucketRegion != null) {
this.CosBucketRegion = new String(source.CosBucketRegion);
}
if (source.InstallDependency != null) {
this.InstallDependency = new String(source.InstallDependency);
}
if (source.EnvId != null) {
this.EnvId = new String(source.EnvId);
}
if (source.Publish != null) {
this.Publish = new String(source.Publish);
}
if (source.Code != null) {
this.Code = new Code(source.Code);
}
if (source.CodeSource != null) {
this.CodeSource = new String(source.CodeSource);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void set(String key, Object value);",
"void set(K key, V value);",
"public setKeyValue_args(setKeyValue_args other) {\n if (other.isSetKey()) {\n this.key = other.key;\n }\n if (other.isSetValue()) {\n this.value = other.value;\n }\n }",
"public abstract void set(String key, T data);",
"Object put(Object key, Object value);",
"public native Map<K, V> set(K key, V value);",
"@Test\n public void testSet() {\n Assert.assertTrue(map.set(\"key-1\", \"value-1\", 10));\n Assert.assertTrue(map.set(\"key-1\", \"value-2\", 10));\n Assert.assertTrue(map.set(\"key-2\", \"value-1\", 10));\n }",
"private void setKeySet(OwnSet<K> st){\n this.keySet = st; \n }",
"void set(K k, V v) throws OverflowException;",
"public Value put(Key key, Value thing) ;",
"@Test\n\tpublic void testPutAccessReodersElement() {\n\t\tmap.put(\"key1\", \"value1\");\n\n\t\tSet<String> keySet = map.keySet();\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key1\",\n\t\t\tkeySet.iterator().next());\n\n\t\t// move 2 to the top/front\n\t\tmap.put(\"key2\", \"value2\");\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key2\",\n\t\t\tkeySet.iterator().next());\n\t}",
"public void set(String key, Object value) {\n set(key, value, 0);\n }",
"final <T> void set(String key, T value) {\n set(key, value, false);\n }",
"public void setObject(final String key, final Object value)\r\n {\r\n if (key == null)\r\n {\r\n throw new NullPointerException();\r\n }\r\n if (value == null)\r\n {\r\n helperObjects.remove(key);\r\n }\r\n else\r\n {\r\n helperObjects.put(key, value);\r\n }\r\n }",
"@Override\n public void put(K key, V value) {\n // Note that the putHelper method considers the case when key is already\n // contained in the set which will effectively do nothing.\n root = putHelper(root, key, value);\n size += 1;\n }",
"@Test\n public void keySetTest()\n {\n map.putAll(getAMap());\n assertNotNull(map.keySet());\n }",
"@Override\n public V put(K key, V value) {\n if (!containsKey(key)) {\n keys.add(key);\n }\n\n return super.put(key, value);\n }",
"public void set(String newKey)\n\t{\n\t\tthis.Key = newKey;\n\t}",
"public void setValue(K key, V value);",
"public Value set(Value key, Value value) {\n\t\tif (get(key) != null)\n\t\t\tput(key, value);\n\t\telse if (parent != null)\n\t\t\tparent.put(key, value);\n\t\telse\n\t\t\tput(key, value);\n\t\treturn value;\n\t}",
"final void set(String key, String value) {\n set(key, value, false);\n }",
"void put(String key, Object obj);",
"public void set(Object key, Object value) {\n if(attributes == null)\n attributes = new HashMap<>();\n attributes.put(key, value);\n }",
"private void put(K key, V value) {\n\t\t\tif (key == null || value == null)\n\t\t\t\treturn;\n\t\t\telse if (keySet.contains(key)) {\n\t\t\t\tvalueSet.set(keySet.indexOf(key), value);\n\t\t\t} else {\n\t\t\t\tkeySet.add(key);\n\t\t\t\tvalueSet.add(keySet.indexOf(key), value);\n\t\t\t\tsize++;\n\t\t\t}\n\t\t}",
"void put(String key, Object value);",
"Object put(Object key, Object value) throws NullPointerException;",
"public void testNormalKeySet()\r\n throws Exception\r\n {\r\n try\r\n {\r\n SCOMapTests.checkKeySet(pmf,\r\n HashMap1.class,\r\n ContainerItem.class,\r\n String.class);\r\n }\r\n finally\r\n {\r\n clean(HashMap1.class);\r\n clean(ContainerItem.class);\r\n }\r\n }",
"@Override\n public synchronized Object put(Object key, Object value) {\n if (value instanceof String) {\n value = ((String) value).trim();\n }\n String strkey = key.toString();\n if (this.ignoreCase) {\n this.keyMap.put(strkey.toLowerCase(), strkey);\n }\n return super.put(strkey, value);\n }",
"@Override\n public V put(K key, V value) {\n reverseMap.put(value, key);\n return super.put(key, value);\n }",
"public void testSet(){\n stringRedisTemplate.opsForSet().add(\"set-key\",\"a\",\"b\",\"c\");\n //srem set-key c d\n stringRedisTemplate.opsForSet().remove(\"set-key\",\"c\",\"d\");\n stringRedisTemplate.opsForSet().remove(\"set-key\",\"c\",\"d\");\n //scard set-key\n stringRedisTemplate.opsForSet().size(\"set-key\");\n //smembers set-key\n stringRedisTemplate.opsForSet().members(\"set-key\");\n //smove set-key set-key2 a\n stringRedisTemplate.opsForSet().move(\"set-key\",\"a\",\"set-key2\");\n stringRedisTemplate.opsForSet().move(\"set-key\",\"c\",\"set-key2\");\n\n //sadd skey1 a b c d\n stringRedisTemplate.opsForSet().add(\"skey1\",\"a\",\"b\",\"c\",\"d\");\n //sadd skey2 c d e f\n stringRedisTemplate.opsForSet().add(\"skey2\",\"c\",\"d\",\"e\",\"f\");\n //sdiff skey1 skey2 //存在与skey1中不存在与skey2中, a b\n stringRedisTemplate.opsForSet().difference(\"skey1\",\"skey2\");\n //sinter skey1 skey2 // c d\n stringRedisTemplate.opsForSet().intersect(\"skey1\",\"skey2\");\n //sunion skey1 skey2 // a b c d e f\n stringRedisTemplate.opsForSet().union(\"skey1\",\"skey2\");\n }",
"protected abstract void put(K key, V value);",
"protected abstract void _set(String key, Object obj, Date expires);",
"Set getLocalKeySet();",
"void setObjectKey(String objectKey);",
"String set(K key, V value, SetOption setOption, long expirationTime, TimeUnit timeUnit);",
"public Object putTransient(Object key, Object value);",
"public JbootVoModel set(String key, Object value) {\n super.put(key, value);\n return this;\n }",
"public abstract void Put(WriteOptions options, Slice key, Slice value) throws IOException, BadFormatException, DecodeFailedException;",
"public void set(String key, Object value) {\r\n\t\tthis.context.setValue(key, value);\r\n\t}",
"public void setKey(K newKey) {\r\n\t\tkey = newKey;\r\n\t}",
"@Override\r\n\tpublic void putObject(Object key, Object value) {\n\t\t\r\n\t}",
"public MapVS(SetVS<T> keys, Map<K, V> entries) {\n this.keys = keys;\n this.entries = entries;\n this.concreteHash = computeConcreteHash();\n }",
"void put(Object indexedKey, Object key);",
"public abstract V put(K key, V value);",
"void setKey(K key);",
"@Override\n\tpublic void put(S key, T val) {\n\t\t\n\t}",
"public void set(String key, Object value)\n {\n if (value == null) remove(key);\n else if (value instanceof Map)\n {\n DataSection section = createSection(key);\n Map map = (Map) value;\n for (Object k : map.keySet())\n {\n section.set(k.toString(), map.get(k));\n }\n }\n else\n {\n data.put(key, value);\n if (!keys.contains(key)) keys.add(key);\n }\n }",
"@Override\n public void put(K key, V value) {\n root = put(root, key, value);\n }",
"public void attach(Object key, Object value);",
"public static interface SetFilter extends KeyValueFilter {\r\n\t\tObject put(String name, Object value);\r\n\t}",
"void put(K key, V value);",
"void put(K key, V value);",
"public void set(K key, V value)\n {\n // If there are too many entries, expand the table.\n if (this.size > (this.buckets.length * LOAD_FACTOR))\n {\n expand();\n } // if there are too many entries\n // Find out where the key belongs.\n int index = this.find(key);\n // Create a new association list, if necessary.\n if (buckets[index] == null)\n {\n this.buckets[index] = new AssociationList<K, V>();\n } // if (buckets[index] == null)\n // Add the entry.\n AssociationList<K, V> bucket = this.get(index);\n int oldsize = bucket.size;\n bucket.set(key, value);\n // Update the size\n this.size += bucket.size - oldsize;\n }",
"public void testCache() {\n MethodKey m = new MethodKey(\"aclass\", \"amethod\", new Object[]{1, \"fads\", new Object()});\n String mValue = \"my fancy value\";\n MethodKey m1 = new MethodKey(\"aclass\", \"amethod1\", new Object[]{1, \"fads\", new Object()});\n String mValue1 = \"my fancy value1\";\n MethodKey m2 = new MethodKey(\"aclass\", \"amethod2\", new Object[]{1, \"fads\", new Object()});\n String mValue2 = \"my fancy value2\";\n\n GenericCache.setValue(m, mValue);\n GenericCache.setValue(m1, mValue1);\n GenericCache.setValue(m2, mValue2);\n\n assertEquals(GenericCache.getValue(m), mValue);\n assertEquals(GenericCache.getValue(m1), mValue1);\n assertEquals(GenericCache.getValue(m2), mValue2);\n }",
"@Override\n public void put(K key, V value) {\n root = putHelper(key,value,root);\n }",
"public void setKey(K newKey) {\n this.key = newKey;\n }",
"@Override\n\tpublic void set(K key, List<V> value) {\n\t\t\n\t}",
"public OwnMap() {\n super();\n keySet = new OwnSet();\n }",
"public void setKey (K k) {\n key = k;\n }",
"public void setItemCollection(HashMap<String, Item> copy ){\n \titemCollection.putAll(copy);\r\n }",
"public void put(Key key, Value val);",
"public void setValue(String key, Object value)\n {\n if (value != null)\n {\n if (otherDetails == null)\n {\n otherDetails = new Hashtable();\n }\n\n otherDetails.put(key, value);\n }\n }",
"ISObject put(String key, ISObject stuff) throws UnexpectedIOException;",
"public void put(Comparable key, Stroke stroke) {\n/* 120 */ ParamChecks.nullNotPermitted(key, \"key\");\n/* 121 */ this.store.put(key, stroke);\n/* */ }",
"public void set(R key, List<S> value){\n map.remove(key);\n map.put(key, value);\n }",
"public V put(K key, V value) throws InvalidKeyException;",
"@SuppressWarnings(\"resource\")\n @Test\n public void testClone() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127625049L), 88,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"18fa817e-9d24-4344-a79a-ab19db23016c\", -15,\n \"7b9ca8ca-2f09-4496-b67e-f3a146e5c741\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127627362L));\n ApiKey apikey2 = apikey1.clone();\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotSame(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }",
"public final void set(final String key, final Object value) {\n try {\n synchronized (jo) {\n if (value == null) {\n jo.remove(key);\n } else {\n jo.put(key, value);\n }\n }\n } catch (JSONException e) {\n }\n }",
"@Test\n public void testPutAll_Existing() {\n Map<String, String> toAdd = fillMap(1, 10, \"\", \"Old \");\n\n map.putAll(toAdd);\n\n Map<String, String> toUpdate = fillMap(1, 10, \"\", \"New \");\n\n configureAnswer();\n testObject.putAll(toUpdate);\n\n for (String k : toAdd.keySet()) {\n String old = toAdd.get(k);\n String upd = toUpdate.get(k);\n\n verify(helper).fireReplace(entry(k, old), entry(k, upd));\n }\n verifyNoMoreInteractions(helper);\n }",
"public T set(T obj);",
"V put(K key, V value);",
"public boolean put(String key, String value);",
"void put(String key, String value) throws StorageException, ValidationException, KeyValueStoreException;",
"public void set(R key, Collection<S> value){\n map.remove(key);\n map.put(key, Collections.synchronizedList(Sugar.listFromCollections(value)));\n }",
"@Before\r\n public void test_change(){\r\n HashTable<String,String> table = new HashTable<>(1);\r\n MySet<String> s = (MySet<String>) table.keySet();\r\n table.put(\"AA\",\"BB\");\r\n table.put(\"AA\",\"CC\");\r\n assertTrue(s.contains(\"AA\"));\r\n table.remove(\"AA\");\r\n assertFalse(s.contains(\"AA\"));\r\n }",
"public void put(String key, Object value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}",
"public boolean put( KEY key, OBJECT object );",
"boolean setValue(String type, String key, String value);",
"public Set<V> put(K key, Collection<V> set) {\n // Remove any possibly existing prior association with the key\n Set<V> result = remove(key);\n\n // Note: The second argument is effectless, as we cannot encounter item type errors here\n NavigableSet<V> navSet = createNavigableSet(set, true);\n Iterator<V> it = navSet.iterator();\n\n SetTrieNode currentNode = superRootNode;\n while(it.hasNext()) {\n V v = it.next();\n\n SetTrieNode nextNode = currentNode.nextValueToChild == null ? null : currentNode.nextValueToChild.get(v);\n if(nextNode == null) {\n nextNode = new SetTrieNode(nextId++, currentNode, v);\n if(currentNode.nextValueToChild == null) {\n currentNode.nextValueToChild = new TreeMap<>(comparator);\n }\n currentNode.nextValueToChild.put(v, nextNode);\n }\n currentNode = nextNode;\n }\n\n if(currentNode.keyToSet == null) {\n currentNode.keyToSet = new HashMap<>();\n }\n\n currentNode.keyToSet.put(key, navSet);\n\n keyToNode.put(key, currentNode);\n\n return result;\n }",
"public K setKey(K key);",
"@SuppressWarnings(\"unchecked\")\n\tpublic Object clone() {\n\t\tLongOpenHashSet c;\n\t\ttry {\n\t\t\tc = (LongOpenHashSet) super.clone();\n\t\t} catch (CloneNotSupportedException cantHappen) {\n\t\t\tthrow new InternalError();\n\t\t}\n\t\tc.key = key.clone();\n\t\tc.state = state.clone();\n\t\treturn c;\n\t}",
"Set keySet(final TCServerMap map) throws AbortedOperationException;",
"boolean canSet(String key);",
"@Test\n public void testBackdoorModificationSameKey()\n {\n testBackdoorModificationSameKey(this);\n }",
"public IDataKey clone() {\n return new IDataKey(this);\n }",
"public abstract void copyFrom(KeyedString src);",
"@Override\n public V put(K key, V value) {\n if ((key == null) || (value == null)) {\n logger.warn(\"NULL key or value key = \" + key + \". value = \" + value);\n System.out.println(StringUtils.join(Thread.currentThread().getStackTrace(), \"\\n\"));\n return null;\n }\n\n // If this map is supposed to be case insensitive, uppercase the key before putting it\n // in the map\n if (caseInsensitive && key instanceof String) {\n return super.put(((K) key.toString().toUpperCase()), value);\n } else {\n return super.put(key, value);\n }\n }",
"public void set(String key, String value){\n\t\tif(first == null){\n\t\t\tfirst = new ListMapEntry(key, value);\n\t\t}\n\t\tListMapEntry temp = first;\n\t\tListMapEntry prev = null;\n\t\twhile(temp!=null && !temp.getKey().equals(key)){\n\t\t\tprev = temp;\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\tif(temp==null){\n\t\t\tprev.setNext(new ListMapEntry(key, value));\n\t\t}\n\t\telse{\n\t\t\ttemp.setValue(value);\n\t\t}\n\t}",
"V put(final K key, final V value);",
"public void set(String key, Object obj) {\n options.put(key, obj);\n }",
"boolean put(K key, V value);",
"@Override\n\tpublic void put(Object key, Object val) {\n\t\tif(st[hash(key)].size()>=k)\n\t\t\tst[hash(key)].clear();\n\t\tst[hash(key)].put(key, st[hash(key)].size());\n\t}",
"protected abstract boolean _setIfAbsent(String key, Object value, Date expires);",
"@Override\n public void putValue(String key, Object value) {\n\n }",
"public DelegateAbstractHashMap(AbstractHashSet set) {\n\t\t\tsuper();\n\t\t\tthis.set = set;\n\t\t}",
"public void changeKey(String key, Object newValue){\n try {\n myJSON.put(key, newValue);\n writeToFile();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public void put(String key, T value);",
"@Override\r\n public V put(K key, V value){\r\n \r\n // Declare a temporay node and instantiate it with the key and\r\n // previous value of that key\r\n TreeNode<K, V> tempNode = new TreeNode<>(key, get(key));\r\n \r\n // Call overloaded put function to either place a new node\r\n // in the tree or update the exisiting value for the key\r\n root = put(root, key, value);\r\n \r\n // Return the previous value of the key through the temporary node\r\n return tempNode.getValue();\r\n }",
"public void set(String key, String value) {\n if (key.indexOf('=') != -1 || key.indexOf(';') != -1) {\n Log.e(TAG, \"Key \\\"\" + key + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n if (value.indexOf('=') != -1 || value.indexOf(';') != -1) {\n Log.e(TAG, \"Value \\\"\" + value + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n\n mMap.put(key, value);\n }",
"@Test\n public void testPutAll_ExistingNoChange() {\n Map<String, String> toAdd = fillMap(1, 10);\n\n map.putAll(toAdd);\n\n Map<String, String> toUpdate = fillMap(1, 10);\n\n configureAnswer();\n testObject.putAll(toUpdate);\n\n verifyZeroInteractions(helper);\n }",
"String setKey(String newKey);"
] | [
"0.64403355",
"0.64156294",
"0.6145026",
"0.6117383",
"0.6094351",
"0.6081591",
"0.6041468",
"0.59901243",
"0.5973955",
"0.5956007",
"0.58388424",
"0.58285606",
"0.5791485",
"0.5705579",
"0.570355",
"0.56879187",
"0.5687801",
"0.5677934",
"0.56090885",
"0.559038",
"0.5582746",
"0.5570273",
"0.55610156",
"0.5553995",
"0.5549449",
"0.55338866",
"0.55283827",
"0.55109584",
"0.5497394",
"0.5490125",
"0.5483331",
"0.5468045",
"0.5430789",
"0.5426447",
"0.54212666",
"0.5414581",
"0.5410838",
"0.5379581",
"0.5377488",
"0.5374671",
"0.5374659",
"0.5357252",
"0.53506136",
"0.53410184",
"0.5329911",
"0.53216016",
"0.52939045",
"0.5285952",
"0.5283849",
"0.52648354",
"0.525831",
"0.525831",
"0.5257396",
"0.5257393",
"0.52565604",
"0.5242243",
"0.523839",
"0.52354896",
"0.5228841",
"0.5227441",
"0.5225834",
"0.5218215",
"0.5216539",
"0.5201421",
"0.51964104",
"0.5188979",
"0.51830816",
"0.5183015",
"0.51772",
"0.51767766",
"0.5176261",
"0.5175613",
"0.5174086",
"0.5171741",
"0.5135767",
"0.5133145",
"0.5129606",
"0.51285577",
"0.5124726",
"0.51211405",
"0.5120927",
"0.51203084",
"0.5104047",
"0.51031584",
"0.5102773",
"0.50994784",
"0.5098674",
"0.5091976",
"0.5075193",
"0.50708413",
"0.5065903",
"0.5064053",
"0.5051961",
"0.50285614",
"0.5024161",
"0.50220007",
"0.50204587",
"0.50198966",
"0.5015302",
"0.5015193",
"0.5014923"
] | 0.0 | -1 |
Internal implementation, normal users should not use it. | public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "FunctionName", this.FunctionName);
this.setParamSimple(map, prefix + "Handler", this.Handler);
this.setParamSimple(map, prefix + "CosBucketName", this.CosBucketName);
this.setParamSimple(map, prefix + "CosObjectName", this.CosObjectName);
this.setParamSimple(map, prefix + "ZipFile", this.ZipFile);
this.setParamSimple(map, prefix + "Namespace", this.Namespace);
this.setParamSimple(map, prefix + "CosBucketRegion", this.CosBucketRegion);
this.setParamSimple(map, prefix + "InstallDependency", this.InstallDependency);
this.setParamSimple(map, prefix + "EnvId", this.EnvId);
this.setParamSimple(map, prefix + "Publish", this.Publish);
this.setParamObj(map, prefix + "Code.", this.Code);
this.setParamSimple(map, prefix + "CodeSource", this.CodeSource);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"public final void mo51373a() {\n }",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n protected void prot() {\n }",
"private stendhal() {\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void init() {\n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"public void smell() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"private void m50366E() {\n }",
"protected boolean func_70814_o() { return true; }",
"protected Problem() {/* intentionally empty block */}",
"@Override\r\n \tpublic void process() {\n \t\t\r\n \t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"@Override\n public int retroceder() {\n return 0;\n }",
"protected Doodler() {\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n public Object preProcess() {\n return null;\n }",
"@Override\n protected void initialize() \n {\n \n }",
"@SuppressWarnings(\"unused\")\n private void _read() {\n }",
"@Override\r\n\tpublic void init() {}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n public void init() {\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n public void apply() {\n }",
"private TestsResultQueueEntry() {\n\t\t}",
"@Override\n void init() {\n }",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"protected void initialize() {}",
"protected void initialize() {}",
"private final void i() {\n }",
"protected void h() {}",
"@Override\r\n\tpublic final void init() {\r\n\r\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"private Unescaper() {\n\n\t}",
"@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}",
"private ArraySetHelper() {\n\t\t// nothing\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"private Util() { }",
"@Override\n public void init() {}",
"@Override public int describeContents() { return 0; }",
"public void method_4270() {}",
"@Override\n\t\tpublic void init() {\n\t\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n\tpublic void apply() {\n\t\t\n\t}",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"protected abstract Set method_1559();",
"@Override\n public void init() {\n\n }",
"private void someUtilityMethod() {\n }",
"private void someUtilityMethod() {\n }",
"protected void init() {\n // to override and use this method\n }",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tprotected void intializeSpecific() {\n\r\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"private TedCorrigendumHandler() {\n throw new AssertionError();\n }",
"private MetallicityUtils() {\n\t\t\n\t}",
"@Override\n\tprotected void prepare() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"protected boolean func_70041_e_() { return false; }",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n public void preprocess() {\n }",
"@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}",
"protected void additionalProcessing() {\n\t}",
"private void getStatus() {\n\t\t\n\t}",
"protected OpinionFinding() {/* intentionally empty block */}",
"@Override\r\n\tpublic void just() {\n\t\t\r\n\t}",
"@Override\n\tpublic void selfValidate() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"private void assignment() {\n\n\t\t\t}"
] | [
"0.62574834",
"0.6217662",
"0.6024768",
"0.5982239",
"0.5965723",
"0.59330684",
"0.5920059",
"0.58351564",
"0.5781645",
"0.57749504",
"0.57749504",
"0.57749504",
"0.57749504",
"0.57749504",
"0.57749504",
"0.57737285",
"0.57054734",
"0.5701363",
"0.56510806",
"0.56491816",
"0.56491816",
"0.5641364",
"0.5636646",
"0.5636101",
"0.5617263",
"0.56129867",
"0.56071395",
"0.56071395",
"0.5604147",
"0.5597464",
"0.5557192",
"0.5547823",
"0.5538959",
"0.5529547",
"0.5527831",
"0.55252886",
"0.5524415",
"0.55170584",
"0.55161196",
"0.55161196",
"0.5508306",
"0.55039597",
"0.5501735",
"0.5498203",
"0.5492665",
"0.54857016",
"0.54857016",
"0.5484164",
"0.5484164",
"0.54709655",
"0.54671437",
"0.5466405",
"0.54586643",
"0.54480445",
"0.5444829",
"0.544423",
"0.5431154",
"0.54291874",
"0.5428321",
"0.5426861",
"0.5424348",
"0.54216623",
"0.54197234",
"0.54126096",
"0.54122156",
"0.5410503",
"0.5408548",
"0.54017633",
"0.5393527",
"0.5393527",
"0.5393108",
"0.53811836",
"0.53811836",
"0.53765255",
"0.53727305",
"0.5371025",
"0.5368476",
"0.53672004",
"0.5362031",
"0.535984",
"0.53585947",
"0.535824",
"0.53558195",
"0.53554994",
"0.53553045",
"0.53553045",
"0.53553045",
"0.5353958",
"0.53527707",
"0.53524756",
"0.5351759",
"0.535174",
"0.53509206",
"0.53348345",
"0.5334606",
"0.533233",
"0.5331985",
"0.5331269",
"0.5331116",
"0.53306353",
"0.5328405"
] | 0.0 | -1 |
Define o atributo tempoMedioSSPB | public void setTempoMedioSSPB(Integer tempoMedioSSPB) {
this.tempoMedioSSPB = tempoMedioSSPB;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setTempo(int tempo);",
"public void setTempoSec(int tempoSec) {\n this.tempoSec = tempoSec;\n }",
"@Override\n public void setTempo(int tempo) {\n }",
"public void setTempoPatrulha(int tempoPatrulha) {\n this.tempoPatrulha = tempoPatrulha;\n }",
"@Override\n public int getTempo() {\n return tempo;\n }",
"public void setTempoMili(int tempoMili) {\n this.tempoMili = tempoMili;\n }",
"public double tempoMedio(String t){\n\t\tt = t.toUpperCase();\n\t\tif(t == \"B\"){\n\t\t\treturn this.tempMB;\n\t\t}else if(t == \"S\"){\n\t\t\treturn this.tempMS;\n\t\t}else if(t == \"I\"){\n\t\t\treturn this.tempMI;\n\t\t}\n\t\n\t\treturn 0;\n\t}",
"public int getTempoPatrulha() {\n return tempoPatrulha;\n }",
"CompositionBuilder<T> setTempo(int tempo);",
"public void setTempo(int tempo) {\n if (tempo < 0) {\n throw new IllegalArgumentException(\"tempo can't be negative\");\n }\n this.tempo = tempo;\n }",
"public void ponerMaximoTiempo() {\n this.timeFi = Long.parseLong(\"2000000000000\");\n }",
"@Override\n public CompositionBuilder<MusicOperation> setTempo(int tempo) {\n this.tempo = tempo;\n return this;\n }",
"public int getTempoSec() {\n return tempoSec;\n }",
"public void setTempoForDrumbeat(double tempo) {\n this.drumBeat.setTempo(tempo);\n }",
"private void setTxtTimeTotal()\n {\n SimpleDateFormat dinhDangGio= new SimpleDateFormat(\"mm:ss\");\n txtTimeTotal.setText(dinhDangGio.format(mediaPlayer.getDuration()));\n //\n skSong.setMax(mediaPlayer.getDuration());\n }",
"public void setTempoVolta() {\n LocalDateTime aux;\n aux = this.tempoFinal.minusHours(this.tempoInit.getHour()).minusMinutes(this.tempoInit.getMinute()).minusSeconds(this.tempoInit.getSecond()).minusNanos(this.tempoInit.getNano());\n int mili = aux.getNano()/1000000;\n this.setTempoMili(mili);\n if(this.tempoMili<10){\n this.tempoVolta = aux.getMinute() + \":\" + aux.getSecond() + \".00\" + mili;\n } else if(this.tempoMili<100){\n this.tempoVolta = aux.getMinute() + \":\" + aux.getSecond() + \".0\" + mili;\n }else{\n this.tempoVolta = aux.getMinute() + \":\" + aux.getSecond() + \".\" + mili;\n }\n this.setTempoSec((aux.getMinute()*60)+aux.getSecond());\n if(this.melhorSec == 0 && this.melhorMili == 0){\n this.melhorSec = this.tempoSec;\n this.melhorMili = this.tempoMili;\n } else {\n if(this.tempoSec<this.melhorSec){\n this.melhorSec = this.tempoSec;\n this.melhorMili = this.tempoMili;\n } else if(this.tempoSec==this.melhorSec && this.melhorMili>this.tempoMili){\n this.melhorMili = this.tempoMili;\n } \n }\n }",
"public void setTesto(){\n \n if(sec < 10){\n this.testo = min + \":0\" + sec + \":\" + deci;\n }\n else{\n this.testo = min + \":\" + sec + \":\" + deci;\n }\n \n }",
"protected void onSetDailyTimerSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}",
"public int getPontosTimeMandante() {\r\n return pontosTimeMandante;\r\n }",
"public void setPontosTimeMandante(int pontosTimeMandante) {\r\n this.pontosTimeMandante = pontosTimeMandante;\r\n }",
"public Mencacao()\r\n {\r\n texto = \"\";\r\n deUtilizador = \"\";\r\n data = new GregorianCalendar();\r\n }",
"void establecerPuntoFM(int pos){\n this.emisoraFMActual = pos;\n }",
"public int getTempoMili() {\n return tempoMili;\n }",
"void establecerPuntoAM(int pos){\n this.emisoraAMActual = pos;\n }",
"protected byte[] getDailyTimerSetting() {return null;}",
"public void daiMedicina() {\n System.out.println(\"Vuoi curare \" + nome + \" per 200 Tam? S/N\");\n String temp = creaturaIn.next();\n if (temp.equals(\"s\") || temp.equals(\"S\")) {\n puntiVita += 60;\n soldiTam -= 200;\n }\n checkStato();\n }",
"public PhanSo(){\n tuSo = 0;\n mauSo = 1;\n }",
"public void setTipoFecha(int tipoFecha)\n {\n tipFecha=tipoFecha;\n }",
"public void setDuration (int sec) {\n String hoursText = \"\", minutesText = \"\", synthez = \"\";\n\n if (sec < 60) {\n synthez = \"less than one minute\";\n synthez = String.format(TEMPLATE, synthez);\n setText(Html.fromHtml(synthez)+\".\", BufferType.SPANNABLE);\n return;\n }\n\n if (sec >= 3600) {\n hoursText += sec/3600+\" Hour\";\n if (sec/3600 > 1) {\n hoursText+=\"s\";\n }\n hoursText+=\" \";\n }\n if (((sec%3600)/ 60) > 0) {\n minutesText+= ((sec%3600)/ 60)+ \" minute\";\n if (((sec%3600)/ 60 ) > 1) {\n minutesText+=\"s\";\n }\n minutesText+=\" \";\n }\n synthez = hoursText+minutesText;\n synthez = String.format(TEMPLATE, synthez);\n setText(Html.fromHtml(synthez)+\".\", BufferType.SPANNABLE);\n }",
"public void setMoTa(String moTa);",
"public void formatoTiempo() {\n String segundos, minutos, hora;\n\n hora = hrs < 10 ? String.valueOf(\"0\" + hrs) : String.valueOf(hrs);\n\n minutos = min < 10 ? String.valueOf(\"0\" + min) : String.valueOf(min);\n\n jLabel3.setText(hora + \" : \" + minutos + \" \" + tarde);\n }",
"@Override\n\tpublic void set(Medicamento novo) {\n\t\t\n\n\t\t\tcon = ConexaoSingleton.getInstance();\n\t\t\ttry {\n\t\t\t\tpst = con.prepareStatement(\"INSERT INTO Medicamento (nome,mg) VALUES (?,?)\");\n\t\t\t\tpst.setString(1, novo.getDesc());\n\t\t\t\tpst.setDouble(2, novo.getmg());\n\t\t\t\tpst.execute();\n\t\t\t}catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t}",
"public void somaTempo(Tempo tempo2) {\n\t\tint tempo1EmSec = this.horas*3600 + this.minutos*60 + this.segundos;\n\t\tint tempo2EmSec = tempo2.horas*3600 + tempo2.minutos*60 + tempo2.segundos; \n\t\tint resultado = tempo1EmSec + tempo2EmSec;\n\t\t\n\t\t//Atribuindo o resultado da soma dos tempos em horas, minutos e segundos.\n\t\tthis.horas = resultado / 3600;\n\t\tint aux = resultado % 3600;\n\t\tthis.minutos = aux / 60;\n\t\tthis.segundos = aux % 60;\n\t}",
"protected void onGetDailyTimerSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}",
"public Transportadora() {\r\n super();\r\n this.nif = \"\";\r\n this.raio = 0;\r\n this.precoKm = 0;\r\n this.classificacao = new Classificacao();\r\n this.estaLivre = true;\r\n this.velocidadeMed = 0;\r\n this.kmsTotal = 0;\r\n this.capacidade = 0;\r\n }",
"public String dimeTuTiempo()\n {\n String cadResultado=\"\";\n if (horas<10)\n {\n cadResultado=cadResultado+\"0\";\n }\n cadResultado=cadResultado+horas;\n cadResultado=cadResultado+\":\";\n if(minutos<10)\n {\n cadResultado=cadResultado+\"0\";\n }\n cadResultado=cadResultado+minutos;\n \n return cadResultado;\n }",
"public mbvConsolidadoPeriodoAnteriores() {\r\n }",
"public Pelicula(String nombre, int anno, int duracionMinutos, int calidad)\n {\n super(nombre,anno);\n this.duracionMinutos = duracionMinutos;\n this.calidad = calidad;\n }",
"public int getminutoStamina(){\n return tiempoReal;\n }",
"public Moto( String nome , float valor , int ano ){\n super( nome , valor ); //define ser uma subclasse\n this.marca = \"Honda\";\n this.ano = ano;\n }",
"public void setTemperatura(String temperatura) {\r\n this.temperatura = temperatura;\r\n }",
"public interface DefaultSettings {\n int SAMPLERATE = 16000;\n int BEAT_LENGTH_IN_MS = 100;\n int BUFFER_SIZE = 4096;\n int MAX_TEMPO_VALUE = 400;\n int MIN_TEMP_VALUE = 1;\n\n int PRESS_TEMPO_CHANGE_TIME_IN_MS = 500;\n}",
"private void setUpFrom(){\n\t\tEPVentanaTemporal ven = new EPVentanaTemporal();\n\t\tEPPropiedad pro = new EPPropiedad();\n\t\t//setemamos la ventana.\n\t\tven.setNombre(\"time_batch\");\n\t\tven.setValor(\"10\");\n\t\tven.setUnidadTemporal(\"seconds\");\n\t\tven.setPseudonombre(\"a1\");\n\t\tpro.setNombre(\"p4\");\n\t\tpro.setPseudonombre(\"\");\n\t\tpro.setVentana(ven);\n\t\texpresionesFrom.add(pro);\n\t}",
"public String tiempoRestanteHMS(Integer segundos) {\n\t\tint hor = segundos / 3600;\n\t\tint min = (segundos - (3600 * hor)) / 60;\n\t\tint seg = segundos - ((hor * 3600) + (min * 60));\n\t\treturn String.format(\"%02d\", hor) + \" : \" + String.format(\"%02d\", min)\n\t\t\t\t+ \" : \" + String.format(\"%02d\", seg);\n\t}",
"public mbvBoletinPeriodo() {\r\n }",
"public void presetTime(long tick,int ento){\r\n\r\n\t}",
"public void indicarTiempoMaximo(Long timeFi) {\n this.timeFi = (timeFi*1000);\n }",
"public musico() {\n\t\tnombre = \" \";\n\t\tsexo = ' ';\n\n\t}",
"public void setTime(long time,int ento){ \r\n\t}",
"@Quando(\"preenche o campo de tempo aplicado com {string} anos\")\n\tpublic void preenche_o_campo_de_tempo_aplicado_com_anos(String tempoAplicadoEmAnos) {\n\t\tSystem.out.println(\"Quando preenche o campo de tempo aplicado com \"+tempoAplicadoEmAnos+ \" anos\");\n\t\tsimulador.preencherTempoAplicado(tempoAplicadoEmAnos);\n\t\tsimulador.selecionarAno();\n\t}",
"@Override\n public void cantidad_Ataque(){\n ataque=5+2*nivel+aumentoT;\n }",
"public int getHora(){\n return minutosStamina;\n }",
"public void setDuracion(java.lang.Integer duracion) {\n this.duracion = duracion;\n }",
"public TemperaturaErradaExcepcion(){\r\n super(\"mensaxe por defecto:temperatura ten que ser naior que 80ºC\");//mensaxe por defecto\r\n }",
"private CreateScanRetentionTimeQCPlotData(){}",
"public Fecha () {\n\t\tthis.ahora = Calendar.getInstance();\n\t\tahora.set(2018, 3, 1, 15, 15, 0);\t \n\t\taño = ahora.get(Calendar.YEAR);\n\t\tmes = ahora.get(Calendar.MONTH) + 1; // 1 (ENERO) y 12 (DICIEMBRE)\n\t\tdia = ahora.get(Calendar.DAY_OF_MONTH);\n\t\thr_12 = ahora.get(Calendar.HOUR);\n\t\thr_24 = ahora.get(Calendar.HOUR_OF_DAY);\n\t\tmin = ahora.get(Calendar.MINUTE);\n\t\tseg = ahora.get(Calendar.SECOND);\n\t\tam_pm = v_am_pm[ahora.get(Calendar.AM_PM)]; //ahora.get(Calendar.AM_PM)=> 0 (AM) y 1 (PM)\n\t\tmes_nombre = v_mes_nombre[ahora.get(Calendar.MONTH)];\n\t\tdia_nombre = v_dia_nombre[ahora.get(Calendar.DAY_OF_WEEK) - 1];\n\n\t}",
"public int getMtu();",
"public void setDuration(int val){this.duration = val;}",
"@RequiresApi(api = Build.VERSION_CODES.O)\n private String obtenerSegundos(){\n try{\n this.minutos = java.time.LocalDateTime.now().toString().substring(17,19);\n }catch (StringIndexOutOfBoundsException sioobe){\n this.segundos = \"00\";\n }\n return this.minutos;\n }",
"public void setTiempo(String tiempo) {\r\n this.tiempo = tiempo;\r\n }",
"public DuploQuantidadeFaturacao(){\r\n faturacao = 0;\r\n quantidade = 0;\r\n }",
"@Override\r\n\tpublic void setOstatu_mota(String ostatu_mota) {\n\t\tsuper.setOstatu_mota(ostatu_mota);\r\n\t}",
"public void setPeriodicidad(java.lang.String periodicidad) {\n this.periodicidad = periodicidad;\n }",
"public void setCodTienda(Integer codTienda);",
"public void setTime(){\r\n \r\n }",
"public void minutoStamina(int minutoStamina){\n tiempoReal = (minutoStamina * 6)+10;\n }",
"@Override\n\tpublic void attributeAdded(ServletContextAttributeEvent evento_sesion) {\n\t\t// CONTROL DEL NOMBRE DEL ATRIBUTO\n\t\tString nombre_atributo = evento_sesion.getName();\n//\t\tSystem.out.println(nombre_atributo);\n\t\tif (this.seguir_Proceso(nombre_atributo)) {\n\t\t\t// PROCESO DE CONTROL DE NUMERO DE ATRIBUTOS\n\t\t\tInteger contador_atributos_aplicacion = (Integer) evento_sesion.getServletContext().getAttribute(\"contador_atributos_aplicacion\");\n\t\t\tif (contador_atributos_aplicacion!=null)\n\t\t\t{\n\t\t\t\tint numero_atributos = (contador_atributos_aplicacion).intValue();\n\t\t\t\tnumero_atributos++;\n\t\t\t\tevento_sesion.getServletContext().setAttribute(\"contador_atributos_aplicacion\",\tnew Integer(numero_atributos));\n\t\t\t\t// PROCESO DE CONTROL DEL VALOR Y TIPO DE ATRIBUTO\n\t\t\t\tObject valor = evento_sesion.getValue();\n\t\t\t\tString valor_texto = this.coger_Valor(valor);\n\t\t\t\tString tipo = null;\n\t\t\t\ttipo = valor.getClass().getSimpleName();\n\t\t\t\tregistro(\"*** Aniadido el atributo de aplicacion del tipo \" + tipo + \" nombre: \" + nombre_atributo + \" valor: \" + valor_texto);\n\t\t\t}\n\t\t}\n\t}",
"public void actualizarMusicaInfo() {\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n int currentDuration;\n //currentDuration = MediaPlayerController.getCurrentDuration();\n currentDuration = mediaPlayerService.getCurrentDuration();\n updateSeekBar(currentDuration);\n handler.postDelayed(this, 1000);\n }\n }, 0); // si delay 0 para arrancar\n }",
"void setTitolo(String titolo);",
"public Integer getTempo() {\n return this.tempoSpeed;\n }",
"public Sablier(Piste piste, Moto moto){\n this.min=min;\n this.sec=sec;\n this.piste=piste;\n this.moto=moto;\n }",
"private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }",
"public void grabarMetaDato (Campo cm) throws IOException\r\n {\r\n cm.fWrite(maestro); \r\n }",
"public Momentum() {\r\n m1 = m2 = v1 = v2 = p1 = p2 = comx = cv = 0.0;\r\n xp1 = 0.0;\r\n xp2 = 900.0;\r\n m1 = 2.0;\r\n m2 = 1.0;\r\n v1 = 1.0;\r\n v2 = -1.0;\r\n\r\n //m1 = m2 = 1.0;\r\n //v1 = 2.0;\r\n //v2 = -4.0;\r\n d = dc = 8.0;\r\n }",
"protected byte[] getOnTimerSetting() {return null;}",
"public String getTempoVolta() {\n return tempoVolta;\n }",
"private void IniciarCronometro() {\n ActionListener action = new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n currentSegundo++;\n\n if (currentSegundo == 60) {\n currentMinuto++;\n currentSegundo = 0;\n }\n\n if (currentMinuto == 60) {\n currentHora++;\n currentMinuto = 0;\n }\n\n String hr = currentHora <= 9 ? \"0\" + currentHora : currentHora + \"\";\n String min = currentMinuto <= 9 ? \"0\" + currentMinuto : currentMinuto + \"\";\n String seg = currentSegundo <= 9 ? \"0\" + currentSegundo : currentSegundo + \"\";\n\n lbcronometro.setText(hr + \":\" + min + \":\" + seg);\n tempo = hr + \":\" + min + \":\" + seg;\n }\n };\n this.timer = new Timer(velocidade, action);\n this.timer.start();\n }",
"@RequiresApi(api = Build.VERSION_CODES.O)\n public String obtenerMinutos(){\n this.minutos = java.time.LocalDateTime.now().toString().substring(14,16);\n return this.minutos;\n }",
"public cola_de_un_banco(){// se crea nuestro metodo costructor \r\n primero=null;//se crea el tipo de indicaciones con valor a null\r\n ultimo=null;\r\n}",
"public void setDataSituacao(DateTimeDB dataSituacao) {\n this.dataSituacao = dataSituacao;\n }",
"protected void onSetOnTimerSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}",
"public Tiempo(int horas, int minutos, int segundos, String displayTiempo) {\r\n\t\tthis.horas = horas;\r\n\t\tif(minutos >= 0 && minutos <= 59){\r\n\t\t\tthis.minutos = minutos;\r\n\t\t}else{\r\n\t\t\tthis.minutos = 0;\r\n\t\t}\r\n\t\tif(segundos >=0 && segundos <=59){\r\n\t\t\tthis.segundos = segundos;\r\n\t\t}else{\r\n\t\t\tthis.segundos = 0;\r\n\t\t}\r\n\t\tthis.displayTiempo = displayTiempo;\r\n\t}",
"public Data() {\n\t\tCalendar now = new GregorianCalendar();\n\t\tthis.anno = now.get(Calendar.YEAR);\n\t\tthis.giorno = now.get(Calendar.DAY_OF_MONTH);\n\t\tthis.mese = Data.MESI[now.get(Calendar.MONTH)];\n\t}",
"public TimeField(SdpField sf) {\n\t\tsuper(sf);\n\t}",
"public Relogio()\n\t{\n \n\t\thora = 0;\n\t\tminuto = 0;\n\t\tsegundo = 0;\n //forma.format(hora);\n if((hora<0 || hora>23) || (minuto<0 || minuto>59) || (segundo<0 || segundo>59)){\n System.out.println(\"Valor de tempo invalido!\");\n }\n\t}",
"public void setMiliSeconds(int nt) {\r\n\t\tthis.milis = nt;\r\n\t}",
"public void setBunga(int tipeBunga){\n }",
"protected void onSetOnTimerReservationSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}",
"protected void onSetOnTimerReservationSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}",
"public void setFechaInicio(Timestamp fechaInicio) {\n this.fechaInicio = fechaInicio;\n }",
"public void atualizarMedicaoHistoricoMovimentoCelular(MovimentoContaPrefaturada movimentoContaPrefaturada) \n\t\tthrows ErroRepositorioException ;",
"public void setMontoSolicitado(double param){\n \n this.localMontoSolicitado=param;\n \n\n }",
"void setSalario(double salario);",
"public void setDato(int dato) {\r\n this.dato = dato;\r\n }",
"AbbayedeTimadeuc(Machecoulais machecoulais, Context context) {\n super(0);\n this.f16558a = machecoulais;\n this.f16559b = context;\n }",
"public void setTempoInit(LocalDateTime tempoInit) {\n this.tempoInit = tempoInit;\n }",
"public Medico() {\r\n\t\tsuper();\r\n\t codmedico = \"\";\r\n\t\tespecialidad = null;\r\n\t}",
"public void setObstaculo(int avenida, int calle);",
"public int getValoracionMedia(){\n return valoracionMedia;\n }",
"protected byte[] getOnTimerReservationSetting() {return null;}"
] | [
"0.62464654",
"0.61461896",
"0.60987294",
"0.5988105",
"0.5968088",
"0.5905644",
"0.58037347",
"0.5684666",
"0.56017566",
"0.5594892",
"0.55688983",
"0.55332726",
"0.55252635",
"0.5524956",
"0.54696476",
"0.54654247",
"0.54522395",
"0.5430999",
"0.5430325",
"0.5418518",
"0.53803617",
"0.53619194",
"0.5347972",
"0.5331477",
"0.53245676",
"0.5318384",
"0.5295686",
"0.52808064",
"0.5224821",
"0.5163212",
"0.5159295",
"0.5150922",
"0.51459306",
"0.51334",
"0.5128982",
"0.5098298",
"0.50938886",
"0.50864345",
"0.50778884",
"0.50735164",
"0.5061133",
"0.5028224",
"0.5026391",
"0.50230306",
"0.50229603",
"0.50167805",
"0.5014102",
"0.500471",
"0.500212",
"0.49964622",
"0.49948728",
"0.49889034",
"0.49821377",
"0.49797305",
"0.49754873",
"0.4974489",
"0.49719095",
"0.49702275",
"0.49619028",
"0.49603286",
"0.4958358",
"0.49497467",
"0.49321505",
"0.49319693",
"0.49274904",
"0.4926451",
"0.49235556",
"0.4923317",
"0.4923122",
"0.4910173",
"0.4908506",
"0.49076355",
"0.49061328",
"0.49031642",
"0.4892033",
"0.48864824",
"0.488425",
"0.4883947",
"0.48787868",
"0.48787028",
"0.4871538",
"0.48707235",
"0.4869872",
"0.48612472",
"0.48496106",
"0.48495802",
"0.4844246",
"0.48421073",
"0.48421073",
"0.4834623",
"0.4821758",
"0.48207763",
"0.48162937",
"0.48116684",
"0.4811522",
"0.4811032",
"0.48105925",
"0.48092735",
"0.47883576",
"0.4782104"
] | 0.6989467 | 0 |
/ blocklocal class not found | public static AccessibilityRecordCompat obtain()
{
class AccessibilityRecordImpl {}
return new AccessibilityRecordCompat(IMPL.obtain());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Object getClass_();",
"Object getClass_();",
"public hk a(String s, a a1)\n {\n class c {}\n\n c c1 = new c(null);\n /* block-local class not found */\n class b {}\n\n b.a(new b(s, a1, c1));\n return c1;\n }",
"void testLocalStaticClass() {\n // static class LocalStaticClass {\n // }\n }",
"@Override\n\tpublic void attendClass() {\n\t\tSystem.out.println(\"Attanding class locally\");\n\t}",
"private stendhal() {\n\t}",
"private ClassUtil() {}",
"private Class<?> findInternalClass(String name){\n Class<?> clazz = null;\n for (int i = 0; i < urls.length; i++) {\n String root = urls[i].getPath();\n clazz = realFindClass(root,name);\n if(clazz != null)\n break;\n }\n if(clazz != null) {\n classes.put(name,clazz);\n return clazz;\n }\n return null;\n }",
"default boolean isClass() {\n return false;\n }",
"@Override\n\tpublic void VisitClassNode(BunClassNode Node) {\n\n\t}",
"public static void\ninitClass()\n//\n////////////////////////////////////////////////////////////////////////\n{\n}",
"private Class<?> defineClass(String paramString, URL paramURL) throws IOException {\n/* 364 */ byte[] arrayOfByte = getBytes(paramURL);\n/* 365 */ CodeSource codeSource = new CodeSource(null, (Certificate[])null);\n/* 366 */ if (!paramString.equals(\"sun.reflect.misc.Trampoline\")) {\n/* 367 */ throw new IOException(\"MethodUtil: bad name \" + paramString);\n/* */ }\n/* 369 */ return defineClass(paramString, arrayOfByte, 0, arrayOfByte.length, codeSource);\n/* */ }",
"public void doClass(String callerName) throws LexemeException {\n\t\tlogMessage(\"<class>--> class ID [extends ID]{{<member>}}\");\n\t\tfunctionStack.push(\"<class>\");\n\t\tconsumeToken(); // consume class token\n\t\t// check ID token\n\t\tif (ifPeekThenConsume(\"ID_\")) {\n\t\t\t// check for optional EXTENDS_ token\n\t\t\tif (ifPeek(\"EXTENDS_\")) {\n\t\t\t\tconsumeToken();\n\t\t\t\tifPeekThenConsume(\"ID_\");\n\t\t\t}\n\t\t\t// check for left curly\n\t\t\tif (ifPeekThenConsume(\"L_CURLY_\")) {\n\n\t\t\t\twhile (ifPeek(\"PUBLIC_\") || ifPeek(\"STATIC_\") || ifPeekIsType()) {\n\t\t\t\t\t// check for optional PUBLIC_ & STATIC_ tokens\n\t\t\t\t\tif (ifPeek(\"PUBLIC_\") || ifPeek(\"STATIC_\")) {\n\t\t\t\t\t\tdoMember(\"<class>\");\n\t\t\t\t\t} else if (ifPeekIsType()) {\n\t\t\t\t\t\tdoMember(\"<class>\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// TODO check for arraytype!!\n\t\t\t\t// CHECK ClOSING CURLY\n\n\t\t\t\t// TODO uncomment line\n\t\t\t\tifPeekThenConsume(\"R_CURLY_\");\n\t\t\t}\n\n\t\t}\n\t\tlogVerboseMessage(callerName);\n\t\tfunctionStack.pop();\n\t}",
"public interface bj\n extends bl\n{\n\n public abstract void a(a a1);\n\n public abstract void b(a a1);\n\n public abstract Ad c();\n\n public abstract String d();\n\n public abstract a e();\n\n public abstract b f();\n\n // Unreferenced inner class com/vungle/publisher/bj$a\n /* block-local class not found */\n class a {}\n\n\n // Unreferenced inner class com/vungle/publisher/bj$b\n /* block-local class not found */\n class b {}\n\n}",
"private EagerlySinleton()\n\t{\n\t}",
"LiveClassLoader()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tthis.defineClassMethod = ClassLoader.class.getDeclaredMethod(\"defineClass\", String.class, byte[].class, int.class, int.class);\r\n\t\t\tthis.defineClassMethod.setAccessible(true);\r\n\t\t}\r\n\t\tcatch (NoSuchMethodException | SecurityException e)\r\n\t\t{\r\n\t\t\t// TODO: debug..\r\n\t\t\tSystem.out.println(\"CLASS LOADER >> Erro ao recuperar o metodo 'ClassLoader.defineClass()'!\");\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void classroom() {\n\t\t\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"static Class _mthclass$(String x0)\r\n\t {\n\t\t\treturn null;\r\n\t //x1;\r\n\t //throw new NoClassDefFoundError(x1.getMessage());\r\n\t }",
"@Override\n public String visit(LocalClassDeclarationStmt n, Object arg) {\n return null;\n }",
"void createLocalClass()\n\t{\n\t\tfinal int localVar = 10;\n\t\t\n\t\t//this is to create local class\n\t\tclass LocalClass{\n\t\t\tpublic void print(){\n\t\t\t\tSystem.out.println(\"THis is local class with Id:\");\n\t\t\t\tSystem.out.println(\"THis is local class with num:\"+nums);\n\t\t\t\tSystem.out.println(\"THis is local class with num:\"+localVar); // localVar must be final. scope is different. the value might change inside local method.\n\t\t\t}\n\t\t}\n\t\t\n\t\tLocalClass l = new LocalClass();\n\t\tl.print();\n\t}",
"public void firstClass(){\n }",
"java.lang.String getClass_();",
"java.lang.String getClass_();",
"public String _class_globals() throws Exception{\n_nativeme = new anywheresoftware.b4j.object.JavaObject();\n //BA.debugLineNum = 7;BA.debugLine=\"End Sub\";\nreturn \"\";\n}",
"private final zzgy zzgb() {\n }",
"west.twouse.language.sparqlas.Class getClass_();",
"private TMCourse() {\n\t}",
"private ModuleSyncHelper() {\n //Private constructor to avoid instances for this helper.\n }",
"public Object visit(Class_ node){\n currentClass = node.getName();\n ClassTreeNode treeNode = classMap.get(currentClass);\n\n treeNode.getMethodSymbolTable().enterScope();\n treeNode.getVarSymbolTable().enterScope();\n\n super.visit(node);\n //treeNode.getMethodSymbolTable().exitScope();\n treeNode.getVarSymbolTable().exitScope();\n return null;\n }",
"private ClassProxy() {\n }",
"private ObjectMacroFront() {\n\n throw new InternalException(\"this class may not have instances\");\n }",
"public void consulterClassement() {\n\t\t\n\t}",
"private Helper() {\r\n // empty\r\n }",
"private ClinicFileLoader() {\n\t}",
"private Obj myFindForClass(String name, DesignatorIdent desIdent) {\n \tObj rez = findInMyScope(name); // provera da li je lokalna promenljiva trenutne funkcije\r\n \tif(rez!= Tab.noObj) {\r\n \t\treturn rez;\r\n \t}\r\n \t\r\n \tStruct classStruct = null;\r\n \tif(currentClass != null) {\r\n \t\tclassStruct = currentClass;\r\n \t}\r\n \telse {\r\n \t\tclassStruct = currentAbsClass;\r\n \t}\r\n \t\r\n \tObj resultObj = null;\r\n \tSymbolDataStructure members = Tab.currentScope().getOuter().getLocals(); // nisu dodati u classStruct, ali se nalaze u scope, vec su sig svi navedeni\r\n \t\r\n \twhile (classStruct != null) { // u sebi ga trazis ...ako si ga nasao pristupas preko implicitnog this!\r\n \t\tif (members != null) {\r\n \t\t\tresultObj = members.searchKey(name);\r\n \t\t\tif (resultObj != null) break;\r\n \t\t}\r\n \t\t\r\n \t\tclassStruct = classStruct.getElemType();\r\n \t\tif (classStruct != null) {\r\n \t\t\tmembers = classStruct.getMembersTable();\r\n \t\t}\r\n \t}\r\n \t\r\n \tif (resultObj != null) {\r\n \t\tStruct trenutna = null;\r\n \t\tif (currentClass != null)\r\n \t\t\ttrenutna = currentClass;\r\n \t\tif (currentAbsClass != null)\r\n \t\t\ttrenutna = currentAbsClass;\r\n// \t\tif (trenutna == null) // dal je moguce? ---> jeste u main-u npr ---> ovde nece moci jel sig zovem iz klase...\r\n// \t\t\treturn;\r\n \t\t// znaci polje sam klase \"klasa\" ; zovem se sa . nesto...sig sam polje ili metoda klase\r\n \t\tif (resultObj.getKind() == Obj.Fld || resultObj.getKind() == Obj.Meth) { \r\n \t\t\tif (resultObj.getFpPos() == 1 || resultObj.getFpPos() == -9) { // public\r\n \t\t\t\tif (resultObj.getKind() == Obj.Meth) {\r\n \t \t\t\treport_info(\"Detektovan poziv metoda unutrasnje klase: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n \t \t\t\tcallFunctionClassField = 1;\r\n \t \t\t}\r\n \t\t\t\treturn resultObj;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif (resultObj.getFpPos() == 2 || resultObj.getFpPos() == -8) { // protected\r\n \t\t\t\tif (resultObj.getKind() == Obj.Meth) {\r\n \t \t\t\treport_info(\"Detektovan poziv metoda unutrasnje klase: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n \t \t\t\tcallFunctionClassField = 1;\r\n \t \t\t}\r\n \t\t\t\treturn resultObj;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif (resultObj.getFpPos() == 3 || resultObj.getFpPos() == -7) { // private\r\n \t\t\t\tif (trenutna != classStruct) {\r\n \t\t\t\t\treport_error(\"Greska na liniji \" + desIdent.getLine()+ \" : polju \"+desIdent.getName()+\" se ne sme pristupati na ovom mestu, private je!\", null);\r\n \t\t\t\t}\r\n \t\t\t\telse {\r\n \t\t\t\t\tif (resultObj.getKind() == Obj.Meth) {\r\n \t\t \t\t\treport_info(\"Detektovan poziv metoda unutrasnje klase: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n \t\t \t\t\tcallFunctionClassField = 1;\r\n \t\t \t\t\treturn resultObj;\r\n \t\t \t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n// \t\tif (resultObj.getKind() == Obj.Meth) {\r\n// \t\t\treport_info(\"Detektovan poziv metoda unutrasnje klase: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n// \t\t\tcallFunctionClassField = 1;\r\n// \t\t}\r\n \t\treturn resultObj;\r\n \t}\r\n \t\r\n \tObj meth = Tab.find(name); // ako je global...\r\n \tif (meth.getKind() == Obj.Meth) {\r\n \t\treport_info(\"Detektovan poziv globalne f-je: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n\t\t\tcallFunctionClassField = 0;\r\n \t}\r\n \t\r\n \treturn meth;\r\n\t}",
"private SparkseeUtils()\n {\n /*\n * Intentionally left empty.\n */\n }",
"public java.lang.Class classForCoder(){\n return null; //TODO codavaj!!\n }",
"private SingletonSyncBlock() {}",
"private NativeSupport() {\n\t}",
"private MetallicityUtils() {\n\t\t\n\t}",
"private Utils() {\n\t}",
"private Utils() {\n\t}",
"public interface AnonymousClass0RF {\n}",
"final void mo6074a(Class cls) {\n if (this.f2339b == null) {\n super.mo6074a(cls);\n }\n }",
"final void mo6074a(Class cls) {\n if (this.f2339b == null) {\n super.mo6074a(cls);\n }\n }",
"private SupplierLoaderUtil() {\n\t}",
"private static boolean classModifiers_1_1_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"classModifiers_1_1_0\")) return false;\n boolean r;\n r = consumeToken(b, BASE);\n if (!r) r = consumeToken(b, INTERFACE);\n if (!r) r = consumeToken(b, FINAL);\n return r;\n }",
"private Infer() {\n\n }",
"public static void initialize(){\r\n\t\tinitialize(new CurrentClassGetter().getClassName());\r\n\t}",
"private CheckingTools() {\r\n super();\r\n }",
"private GraphFileManager() {\n\t}",
"@Override\n\tpublic void extends_(JDefinedClass cls) {\n\n\t}",
"public final C2041fo mo13812b(Class<?> cls) {\n throw new IllegalStateException(\"This should never be called.\");\n }",
"private void init() throws ClassNotFoundException{\n }",
"private HSBC() {\n\t\t\n\t\t\n\t}",
"private ModuleLoader() {\r\n }",
"static void sm() {\n }",
"private Utils() {}",
"private Utils() {}",
"private Utils() {}",
"private Utils() {}",
"public void initializeClass();",
"private HelperLocation() {}",
"private ProcessorUtils() { }",
"private JacobUtils() {}",
"@Override\n\tpublic void setClassMissing() {\n\n\t}",
"@Override\n\tpublic void inAClass(AClass node) {\n\t\tString className = node.getType().getText();\n\t\tcurrentClass = topLevelSymbolTable.get(className);\n\t\tif (currentClass.isAbstract()){\n\t\t\tcg = new ClassGen(className, currentClass.getSuper().getType().className, this.fileName, Constants.ACC_PUBLIC | Constants.ACC_SUPER | Constants.ACC_ABSTRACT, null);\n\t\t}else{\n\t\t\tcg = new ClassGen(className, currentClass.getSuper().getType().className, this.fileName, Constants.ACC_PUBLIC | Constants.ACC_SUPER, null);\n\t\t}\n\t\tcp = cg.getConstantPool(); \n\t}",
"protected void h() {}",
"Reproducible newInstance();",
"void compileClass() throws IOException {\n tagBracketPrinter(CLASS_TAG, OPEN_TAG_BRACKET);\n try {\n compileClassHelper();\n } catch (IOException e) {\n e.printStackTrace();\n }\n tagBracketPrinter(CLASS_TAG, CLOSE_TAG_BRACKET);\n\n }",
"@Override\n public void visitClass(@NotNull PsiClass aClass) {\n }",
"protected Class< ? extends Object > findClass( String name ) throws ClassNotFoundException {\n\t\tfinal Class< ? extends Object > c = load_classes.get( name );\n\t\tif ( c == null ) throw new ClassNotFoundException();\n\t\treturn c;\n\t}",
"public Class getInstanceClass()\n {\n return _cl;\n }",
"public void testJavaClassRepository869() throws Exception {\n\t\tClassPath var2728 = new ClassPathFactory().createFromJVM();\n\t\tJavaClassRepository var2729 = new JavaClassRepository(var2728);\n\t\tString var2727 = \"com.google.test.metric.JavaClassRepositoryTest.MyClass.MyInnerClass\";\n\t\tvar2729.getClass(var2727);\n\t\tString var2722 = \"java.util.Map.Entry\";\n\t\tvar2729.getClass(var2722);\n\t}",
"public void mo63648e(Class cls, long j) {\n }",
"public static void loadClass(String name) {\n\n }",
"public void testJavaClassRepository874() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(Gadget.class.getCanonicalName());\n\t\tvar2730.getClass(LoDStaticCall.class.getCanonicalName());\n\t}",
"private Helper() {\r\n // do nothing\r\n }",
"public ClassNotFoundException () {\n\t\tsuper((Throwable)null); // Disallow initCause\n\t}",
"private AirforceOne_lazy() {\n }",
"ClassLoader getNewTempClassLoader() {\n return new ClassLoader(getClassLoader()) {\n };\n }",
"public OOP_207(){\n\n }",
"private SelfShieldingCalc()\n {\n // This class should just contain static methods. Don't let anyone\n // instantiate it.\n }",
"private static Class<?> tryName(String name) throws ClassNotFoundException {\n return Class.forName(name);\r\n }",
"private SpringBoHelper() {\n\n\t}",
"protected OpinionFinding() {/* intentionally empty block */}",
"private ATCres() {\r\n // prevent to instantiate this class\r\n }",
"ClassType outer();",
"private CommonMethods() {\n }",
"public CharSequence getClassName() {\n/* 1426 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"private Util() { }",
"static boolean classModifiers(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"classModifiers\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = consumeToken(b, SEALED);\n if (!r) r = classModifiers_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }",
"private RubyClass defineClassIfAllowed(String name, RubyClass superClass) {\n if (superClass != null && profile.allowClass(name)) {\n return defineClass(name, superClass, superClass.getAllocator());\n }\n return null;\n }",
"protected abstract Class<?> getActivityClass();",
"private static class <init>\n implements e\n{\n\n public String a()\n {\n return \"\";\n }",
"private LOCFacade() {\r\n\r\n\t}",
"public String _class_globals() throws Exception{\n_abm = new com.ab.abmaterial.ABMaterial();\r\n //BA.debugLineNum = 4;BA.debugLine=\"End Sub\";\r\nreturn \"\";\r\n}",
"@Override\n protected Class \n findClass\n (\n String cname\n ) \n throws ClassNotFoundException\n {\n byte bs[] = pContents.get(cname);\n if(bs == null) \n throw new ClassNotFoundException\n\t(\"Unable to find class (\" + cname + \")!\");\n\n return defineClass(cname, bs, 0, bs.length);\n }",
"AnonymousClass1() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: android.location.GpsClock.1.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.location.GpsClock.1.<init>():void\");\n }",
"private MakeACaptain() {\n }"
] | [
"0.66284907",
"0.66284907",
"0.6452771",
"0.6295108",
"0.60229254",
"0.6019088",
"0.59964263",
"0.5946496",
"0.5838534",
"0.5837066",
"0.5810667",
"0.57805425",
"0.5714481",
"0.57138234",
"0.5696675",
"0.56487906",
"0.5637247",
"0.5632724",
"0.5630983",
"0.5629123",
"0.5624384",
"0.5621895",
"0.56208754",
"0.56208754",
"0.5596858",
"0.5564135",
"0.55381566",
"0.5522619",
"0.55176425",
"0.5510258",
"0.54968476",
"0.5480943",
"0.5477829",
"0.5472417",
"0.5443328",
"0.5443244",
"0.5434023",
"0.5431753",
"0.5426447",
"0.5420982",
"0.5415881",
"0.5414843",
"0.5414843",
"0.5410936",
"0.54104143",
"0.54104143",
"0.5401569",
"0.5396117",
"0.5395971",
"0.539193",
"0.5371571",
"0.5371023",
"0.53679866",
"0.5363343",
"0.5362835",
"0.53542715",
"0.5339851",
"0.533568",
"0.5332752",
"0.5332752",
"0.5332752",
"0.5332752",
"0.5331454",
"0.5322797",
"0.532197",
"0.5314796",
"0.53126824",
"0.5311071",
"0.53007996",
"0.52995217",
"0.5296944",
"0.529148",
"0.52857333",
"0.52834356",
"0.5279164",
"0.5278229",
"0.52765924",
"0.52764314",
"0.526863",
"0.52596927",
"0.5253049",
"0.5251516",
"0.5250718",
"0.5248589",
"0.5246613",
"0.52450114",
"0.52408344",
"0.5211869",
"0.5210775",
"0.5201647",
"0.51965237",
"0.5192423",
"0.5189503",
"0.5187095",
"0.5186228",
"0.5185886",
"0.5185741",
"0.5180635",
"0.517555",
"0.5172817",
"0.5165736"
] | 0.0 | -1 |
"Already a member? Login" Button | @Override
public void onClick(View v) {
// Finish the registration screen and return to the Login activity
Intent intent = new Intent(getApplicationContext(),LoginActivity.class);
// intent.putExtra("firstname", firstname);
// intent.putExtra("lastname", lastname);
// intent.putExtra("id", id);
startActivity(intent);
finish();
overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void LoginButton() {\n\t\t\r\n\t}",
"public void btnLoginClicked() {\n String username = txfUsername.getText();\n String password = txfPassword.getText();\n DatabaseController database = new DatabaseController(new TuDbConnectionFactory());\n Authentication auth = new Authentication(database);\n if (auth.signIn(username, password)) {\n Player player = new Player(username, database.getPersonalTopScore(username));\n game.setScreen(new PreGameScreen(game,\"music/bensound-funkyelement.mp3\", player));\n } else {\n txfUsername.setColor(Color.RED);\n txfPassword.setColor(Color.RED);\n }\n }",
"private void createAccountButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createAccountButtonActionPerformed\n na.setVisible(true);\n boolean isLoggedInNew = uL.isLoggedIn();\n boolean isLoggedIn = na.isLoggedIn();\n if (isLoggedInNew || isLoggedIn) {\n dm.messageMustLogOut();\n na.dispose();\n }\n }",
"void updateButtonLogin() {\n\t\tthis.mButtonLogin.setEnabled(this.mAuthUsername.getText().length() > 0\n\t\t\t\t&& this.mAuthPassword.getText().length() > 0);\n\t}",
"public void LogInOnAction(Event e) {\n\t \t\r\n\t \tif(BookGateway.getInstance().getAuthentication(this.userNameId.getText(), this.passwordId.getText())) {\r\n\t \t\tthis.whiteOutId.setVisible(false);\r\n\t \t\tthis.whiteOutId.setDisable(true);\r\n\t \t\t// TODO: Update label name in the corner.. \r\n\t \t\tthis.nameLabelId.setText(\"Hello, \" + BookGateway.currentUser.getFirstName());\r\n\t \t\r\n\t \t}else {\r\n\t \t\t// true\r\n\t \t\tmessAlert(\"Invalid\",\"Wrong Username or password\");\r\n\t \t\tthis.userNameId.setText(\"\");\r\n\t \t\tthis.passwordId.setText(\"\");\r\n\t \t\te.consume();\r\n\t \t}\r\n\t \t\r\n\t \t\r\n\t }",
"private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed\n uL.setVisible(true);\n boolean isLoggedInNew = uL.isLoggedIn();\n boolean isLoggedIn = na.isLoggedIn();\n if (isLoggedInNew || isLoggedIn) {\n dm.messageMustLogOut();\n uL.dispose();\n }\n }",
"@Override\n\tpublic boolean login(MemberBean param) {\n\t\treturn false;\n\t}",
"public void signInExistingUser(View v) {\n attemptLogin();\n\n }",
"void SubmitButton() {\r\n\t\tint checker = Accounts.checkUser(username.getText(), password.getText());\r\n\t\tif(checker == -1) {\r\n\t\t\tsetVisible(false);\r\n\t\t\tdispose();\r\n\t\t\tAdminScreen adminScreen = new AdminScreen();\r\n\t\t}\r\n\t\telse if(checker >= 0) {\r\n\t\t\tsetVisible(false);\r\n\t\t\tdispose();\r\n\t\t\tStudentScreen studentScreen = new StudentScreen(checker);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Error: username \"\r\n\t\t\t\t\t+ \"and/or password is incorrect.\");\r\n\t\t\tpassword.setText(\"\");\r\n\t\t\tusername.setText(\"\");\r\n\t\t}\r\n\t\t\r\n\t}",
"private void login() {\r\n\r\n if (String.valueOf(login_usernameTextField.getText()).equals(\"\"))\r\n JOptionPane.showMessageDialog\r\n (null, \"Must Enter A Username\");\r\n\r\n else if (String.valueOf(login_passwordField.getPassword()).equals(\"\"))\r\n JOptionPane.showMessageDialog\r\n (null, \"Must Enter A Password\");\r\n\r\n else if (MainGUI.pimsSystem.staff_exists(login_usernameTextField.getText(), String.valueOf(login_passwordField.getPassword()))) {\r\n remove(loginPanel);\r\n add(tabbedPane);\r\n JOptionPane.showMessageDialog\r\n (null, \"Login Successful\");\r\n repaint();\r\n revalidate();\r\n\r\n // reset username and password fields\r\n login_usernameTextField.setText(\"\");\r\n login_passwordField.setText(\"\");\r\n\r\n } else\r\n JOptionPane.showMessageDialog\r\n (null, \"Invalid Password or Username\");\r\n }",
"public void loginButton(View view) {\n EditText userNameInput = (EditText) findViewById(R.id.user_name);\n\n if (userNameInput.getText().toString().trim().length() != 0) {\n LinearLayout loginPage = (LinearLayout) findViewById(R.id.login_page);\n loginPage.setVisibility(View.GONE);\n TextView questionsPane = (TextView) findViewById(R.id.questions_pane);\n questionsPane.setVisibility(View.VISIBLE);\n LinearLayout nextAndSubmitButtons = (LinearLayout) findViewById(R.id.next_and_submit_buttons);\n nextAndSubmitButtons.setVisibility(View.VISIBLE);\n Button nextButton = (Button) findViewById(R.id.next_button);\n nextButton.setEnabled(false);\n userName = userNameInput.getText().toString();\n }\n\n //tells the user that he/she need to provides his/her name\n else {\n Toast userIdNeeded = Toast.makeText(getApplicationContext(), \"USERNAME REQUIRED\", Toast.LENGTH_SHORT);\n userIdNeeded.show();\n }\n }",
"public void inputListenerForLoginButton() throws SQLException, ParseException {\n\t\t// when Login is pressed\n\t\tString email = textField_Email.getText().toLowerCase();\n\t\ttextField_Email.setText(\"\");\n\n\t\t@SuppressWarnings(\"deprecation\")\n\t\tString password = passwordField.getText();\n\t\tpasswordField.setText(\"\");\n\n\t\tMember m = memberRepository.passwordMatchesForLogin(email, password);\n\n\t\tif (!isEmailFormatCorrect(email) || password.equals(\"\")) {\n\t\t\tlblLabel_Invalid.setVisible(true);\n\t\t\tpanel.revalidate();\n\t\t\tpanel.repaint();\n\t\t\treturn;\n\t\t}\n\n\t\tif (m != null) {\n\t\t\tif (m.isAdmin()) {\n\t\t\t\t// view el admin Panel\n\t\t\t\tAdminGUI admin = new AdminGUI();\n\t\t\t\tfrmLibraryManagementSystem.remove(panel11);\n\t\t\t\tfrmLibraryManagementSystem.getContentPane().add(admin);\n\t\t\t\tfrmLibraryManagementSystem.revalidate();\n\t\t\t\tfrmLibraryManagementSystem.repaint();\n\t\t\t} else {\n\t\t\t\t// go to BookGUI panel\n\t\t\t\tBooksGUI p = new BooksGUI(m);\n\t\t\t\tfrmLibraryManagementSystem.remove(panel11);\n\t\t\t\tfrmLibraryManagementSystem.getContentPane().add(p);\n\t\t\t\tfrmLibraryManagementSystem.revalidate();\n\t\t\t\tfrmLibraryManagementSystem.repaint();\n\t\t\t}\n\t\t} else {\n\t\t\tlblLabel_Invalid.setVisible(true);\n\t\t\tpanel.revalidate();\n\t\t\tpanel.repaint();\n\t\t}\n\n\t}",
"private boolean isLoginUnique(int currentUserId){\n\t\tUser user = Main.getMMUser().getUserForLogin(userLoginField.getText());\n\t\tif (user == null) return true;\n\t\telse {\n\t\t\tif (user.getId() == currentUserId) return true;\n\t\t}\t\n\t\tlackUserLoginLabel.setText(\"taki login istnieje w bazie\");\n\t\tlackUserLoginLabel.setVisible(true);\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic void MemberLogin() {\n\r\n\t}",
"@Override\n public void onClick(View v) {\n loginUser(\"999999\");\n }",
"private void logInBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logInBtnActionPerformed\n User theUser = null;\n String[] options = {\"OK\"};\n String userName = userNameTF.getText();\n String password = passwordTF.getText();\n\n theUser = HF.findUser(userName);\n\n if (userNameTF.getText().equals(\"\") || passwordTF.getText().equals(\"\")){\n JOptionPane.showOptionDialog(this, \"Please fill in your username \"\n + \"and password!\",\n \"\", JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE,\n null, options, options[0] );\n }\n else if (theUser == null) {\n JOptionPane.showOptionDialog(this, \"No such username!\",\n \"\", JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE,\n null, options, options[0] );\n }\n else if (!theUser.getPassword().equals(password)) {\n JOptionPane.showOptionDialog(this, \"Invalid password!\",\n \"\", JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE,\n null, options, options[0] );\n }\n else {\n if (theUser instanceof Trainer){\n TrainerMenu tm = new TrainerMenu(this, (Trainer)theUser);\n tm.setVisible(true);\n this.setVisible(false);\n }\n else if (theUser instanceof Member){\n MemberMenu mm = new MemberMenu(this, (Member)theUser);\n mm.setVisible(true);\n this.setVisible(false);\n }\n userNameTF.setText(\"\");\n passwordTF.setText(\"\");\n }\n }",
"public TWTRLogInButton() {}",
"public void clickLogin() {\n\t\tcontinueButton.click();\n\t}",
"public abstract boolean showLogin();",
"public void loggedIn(){\n Button view = findViewById(R.id.buttonView);\n view.setVisibility(View.VISIBLE);\n Button logout = findViewById(R.id.buttonLogout);\n logout.setVisibility(View.VISIBLE);\n EditText username = findViewById(R.id.username);\n username.setVisibility(View.INVISIBLE);\n EditText pass = findViewById(R.id.password);\n pass.setVisibility(View.INVISIBLE);\n Button login = findViewById(R.id.buttonLogin);\n login.setVisibility(View.INVISIBLE);\n Button createAcc = findViewById(R.id.buttonCreateAccount);\n createAcc.setVisibility(View.INVISIBLE);\n TextView accountName = findViewById(R.id.accountName);\n accountName.setVisibility(View.VISIBLE);\n accountName.setText(user);\n }",
"private void LoginOwner() {\n Transaksi.setEnabled(false);\n Transaksi.setVisible(false);\n }",
"private boolean login()\n {\n System.out.print(\"Enter your username: \");\n String userName = keyboard.nextLine().toLowerCase();\n currentUser = fs.getUser(userName);\n System.out.println();\n\n return currentUser != null;\n }",
"public void ClickLogin()\n\t{\n\t\t\n\t\tbtnLogin.submit();\n\t}",
"private void connectMembers() {\r\n userText = findViewById(R.id.usernameEditText);\r\n passText = findViewById(R.id.editTextPassword);\r\n submitButton = findViewById(R.id.loginButton);\r\n\r\n submitButton.setOnClickListener(new View.OnClickListener() {\r\n @Override\r\n public void onClick(View view) {\r\n String passedInUser = userText.getText().toString();\r\n String passedInPass = passText.getText().toString();\r\n\r\n //We clear the field colors to get rid of any red fields.\r\n resetFieldColors();\r\n //This function checks to see if the values typed in by the user are valid.\r\n checkValidLogin(passedInUser, passedInPass);\r\n }\r\n });\r\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"333333\");\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"666666\");\n }",
"boolean hasLogin();",
"boolean hasLogin();",
"private void showLogin() {\n \t\tLogin.actionHandleLogin(this);\n \t}",
"private void checkIfAtLogin(){\n checkIfIdDisplayed(R.id.login_main_view);\n checkIfIdDisplayed(R.id.username_text_input);\n checkIfIdDisplayed(R.id.password_text_input);\n checkIfIdDisplayed(R.id.login_button);\n }",
"public void onClick(DialogInterface dialog, int id) {\n prefs.edit().putBoolean(\"Islogin\", false).commit();\n prefs.edit().putString(\"role\", \"\").commit();\n item.setTitle(\"Login\");\n }",
"public void onSignUpClick() {\n\t\tString uid = regview.getUsername();\n\t\tString pw = regview.getPassword();\n\t\tString na = regview.getName();\n\t\tString em = regview.getEmail();\n\t\tString text = \"\";\n\t\tif(uid.equals(\"\") || pw.equals(\"\") || na.equals(\"\")|| em.equals(\"\")){\n\t\t\ttext = \"Please fill out all fields!\";\n\t\t} else if(regview.findUser(uid)!=User.NULL_USER){\n\t\t\ttext = \"The username already exsit, please try another one!\";\n\t\t} else {\n\t\t\tregview.addUser(new User(uid,pw,na,em));\n\t\t\tregview.goLoginPage();\n\t\t}\n\t\tregview.setRegisterText(text);\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(v==buttonlogin)\n\t\t\t\t{\n\t\t\t\t\tloginUser();\n\t\t\t\t}\n\t\t\t}",
"private boolean AlreadyLogin() {\n\t\tString usn = uPreferences.getString(\"username\", null);\n\t\tString pwd = uPreferences.getString(\"password\", null);\n\t\tif((usn == null) || ((pwd == null))){\n\t\t\treturn false;\n\t\t}\n\t\telse \n\t\t\treturn true;\n\t}",
"public void login() {\n\t\tloggedIn = true;\n\t}",
"public void onClickLogin(View v){\n //If the login was correct\n if (checkLogIn()) {\n // If the loggin is successfoul, save the user as a logged user into a shared preferences\n\n String username=etUser.getText().toString();\n SharedPreferences.Editor editor = sharedpreferences.edit();\n editor.putString(\"username\", username);\n editor.commit();\n\n //Create and launch a new activity\n Intent myIntent = new Intent(getApplicationContext(), EmMessage1.class);\n startActivity(myIntent);\n }\n //Wrong login\n else {\n //Change the retries text view\n tvFailLogin.setVisibility(View.VISIBLE);\n tvFailLogin.setBackgroundColor(Color.RED);\n retriesLogin--;\n tvFailLogin.setText(Integer.toString(retriesLogin));\n //If retries==0, set the login button to not enabled\n if (retriesLogin == 0) {\n bLogin.setEnabled(false);\n }\n }\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"777777\");\n }",
"public void signInActionButtonOnClick(View v) {\n EditText usernameField = findViewById(R.id.sign_in_username);\n EditText passwordField = findViewById(R.id.sign_in_password);\n\n if (new UserFieldValidator(fields).validateSignInFields(this)) {\n String username = usernameField.getText().toString();\n String password = passwordField.getText().toString();\n Map<String, String> users = getUsers();\n if (users != null && users.containsKey(username) && users.get(username).equals(password)) {\n Intent tmp = new Intent(this, GameCentreActivity.class);\n tmp.putExtra(\"user\", username);\n startActivity(tmp);\n } else {\n Toast.makeText(this, R.string.sign_in_incorrect, Toast.LENGTH_SHORT).show();\n }\n }\n }",
"private void auto_log_in()\n {\n jtf_username.setText(Config.USERNAME);\n jpf_password.setText(Config.PASSWORD);\n jb_prijavi.doClick();\n\n }",
"public String onClick() {\n final String login = getModel().getLogin();\n final String password = getModel().getPasssword();\n\n //Call Business\n Exception ex2 = null;\n User s = null;\n try {\n s = service.login(login, password);\n } catch (Exception ex) {\n ex2 = ex;\n }\n\n //Model to View\n if (ex2 == null) {\n getModel().setCurrentUser(s);\n return \"list\";\n } else {\n return null;\n }\n }",
"public void checkUsername(ActionEvent actionEvent) {\n String temp= ClientAPI.getForgetPassword(username.getText());\n if(temp==null){\n userExist.setVisible(true);\n } else{\n userExist.setVisible(false);\n question.setText(temp.substring(0, temp.indexOf(\"|\")));\n help=temp.substring(temp.indexOf(\"|\")+1, temp.lastIndexOf(\"|\"));\n password.setText(temp.substring(temp.lastIndexOf(\"|\")+1));\n question.setVisible(true);\n }\n }",
"private void checkAccountLoggedIn()\r\n\t{\n\t\tSharedPreferences pref = this.getSharedPreferences(\"accountdata\", 0);\r\n\t\tSystem.out.println(\"Checking if an account is logged in\");\r\n\t\tif (pref.getBoolean(\"accountLoggedIn\", false))\r\n\t\t{\r\n\t\t\tloginButton.setEnabled(false);\r\n\t\t\tregisterButton.setEnabled(false);\r\n\r\n\t\t\t// Make a crouton notifying the user\r\n\t\t\tCrouton crouton = Crouton.makeText(this, this.getResources()\r\n\t\t\t\t\t.getString(R.string.activity_login_account_loggedin),\r\n\t\t\t\t\tStyle.INFO);\r\n\t\t\tConfiguration.Builder configBuild = new Configuration.Builder();\r\n\t\t\tconfigBuild.setDuration(Configuration.DURATION_INFINITE);\r\n\t\t\tcrouton.setConfiguration(configBuild.build());\r\n\t\t\tcrouton.setOnClickListener(new OnClickListener()\r\n\t\t\t{\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(View v)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Crouton clicked\");\r\n\t\t\t\t\t((LoginActivity) v.getContext()).onBackPressed();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tcrouton.show();\r\n\t\t}\r\n\t}",
"@Override\n public void onClick(View v) {\n loginUser(\"888888\");\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"111111\");\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"222222\");\n }",
"private void onLoginButtonClicked() {\n this.loginManager = new LoginManager(this, this);\n this.password = passwordEditText.getText().toString().trim();\n this.username = usernameEditText.getText().toString().trim();\n if (username.isEmpty() || password.isEmpty()) {\n Snackbar.make(coordinatorLayout, R.string.fill_all_fields_snackbar, Snackbar.LENGTH_LONG).show();\n } else loginManager.fetchUsersToDatabase(username, password, serverName, serverPort);\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"555555\");\n }",
"private void checkLogin() {\n SharedPref sp = new SharedPref(this);\n if (!sp.readLoginStatus()) {\n Intent i = new Intent(this, LoginActivity.class);\n i.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);\n startActivity(i);\n }\n }",
"public void Login()throws Exception{\r\n if(eMailField.getText().equals(\"user\") && PasswordField.getText().equals(\"pass\")){\r\n displayMainMenu();\r\n }\r\n else{\r\n System.out.println(\"Username or Password Does not match\");\r\n }\r\n }",
"protected boolean login() {\n\t\tString Id = id.getText();\n\t\tif (id.equals(\"\")){\n\t\t\tJOptionPane.showMessageDialog(null, \"请输入用户名!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tUserVO user = bl.findUser(Id);\n\t\tif (user == null){\n\t\t\tJOptionPane.showMessageDialog(null, \"该用户不存在!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (! user.getPassword().equals(String.valueOf(key.getPassword()))){\n\t\t\tSystem.out.println(user.getPassword());\n\t\t\tJOptionPane.showMessageDialog(null, \"密码错误!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tsimpleLoginPanel.this.setVisible(false);\n\t\tUserblService user2 = new Userbl(Id);\n\t\tReceiptsblService bl = new Receiptsbl(user2);\n\t\tClient.frame.add(new simpleMainPanel(user2,bl));\n\t\tClient.frame.repaint();\n\t\t\n\t\treturn true;\n\t\t\n\t}",
"@Override\n public void onClick(View view) {\n attemptLogin();\n }",
"public void checkAlreadyLogin(CheckLoggedInInterface listner) {\n currentUser = firebaseAuth.getCurrentUser();\n if(currentUser != null) listner.isLoggedIn(true);\n else listner.isLoggedIn(false);\n }",
"public void logTeacherButton(ActionEvent actionEvent) {\n //if preferences are set remember to check the value from preferences\n // not test because it actually not exists\n if(loginModel.verifyPassword(emailField.getText(),\n passwordField.getText(), UserType.TEACHER)){\n executeLogIn(actionEvent, new LogInTeacher(loginModel.\n getTeacher(emailField.getText())));\n logInTeacher.setDisable(true);\n\n }\n else{\n System.out.println(\"verification not successful\");\n JOptionPane.showMessageDialog(null, \"fuck you\");\n System.out.println(emailField.getText());\n System.out.println(passwordField.getText());\n System.out.println(\"end of that\");\n }\n\n }",
"public void login(ActionEvent event) throws IOException {\n\t\t//if user is admin, open admin screen\n\t\tif(username.getText().toLowerCase().equals(\"admin\")) {\n\t\t\t//open admin screen\n\t\t\tMain.changeScene(\"/view/admin.fxml\", \"Administrator Dashboard\");\t\t\t\n\t\t}\n\t\t//if user is blank, throw error\n\t\telse if(username.getText().isEmpty()){\n\t\t\tinvalidUserError.setVisible(true);\n\t\t}\n\t\t//otherwise make sure user exists and if they do set current user and change screen, if not throw error.\n\t\telse {\n\t\t\tfor(User user : UserState.getAllUsers()) {\n\t\t\t\tif(user.getUserName().toLowerCase().equals(username.getText().toLowerCase())) {\n\t\t\t\t\tUserState.setCurrentUser(user);\n\t\t\t\t\tMain.changeScene(\"/view/userhome.fxml\", \"User Home\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tinvalidUserError.setVisible(true);\n\t\t\tusername.setText(\"\");\n\t\t}\n\t}",
"public void actionPerformed(ActionEvent event) {\n\t\t//We have only one button\n\t\tif(event.getSource() == loginButton) {\n\t\t\t//Getting the username and password inserted\n\t\t\tauxUsername = usernameTextField.getText();\n\t\t\tauxPassword = new String(passwordField.getPassword());\n\t\t\t\n\t\t\t//Check if user introduces username and password\n\t\t\tif(!auxUsername.equals(\"\") && !auxPassword.equals(\"\")) {\n\t\t\t\t//First case: the administrator is logging\n\t\t\t\tif(auxUsername.equals(\"admin\") \n\t\t\t\t\t\t&& auxPassword.equals(\"admin\")) {\n\t\t\t\t\tsetVisible(false);\n\t\t\t\t\t\n\t\t\t\t\tUser auxUser = null;\n\t\t\t\t\tfor(int i=0 ; i<usersList.size(); i++) {\n\t\t\t\t\t\tif(usersList.get(i).getUsername().equals(\"admin\") && \n\t\t\t\t\t\t\t\t\tusersList.get(i).getPassword().equals(\"admin\")) {\n\t\t\t\t\t\t\tauxUser = usersList.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tAdminGUI adminGUI = new AdminGUI(this, auxUser);\n\t\t\t\t\tadminGUI.run();\n\t\t\t\t} else {\n\t\t\t\t\t//Second case: somebody else is logging\n\t\t\t\t\tUser auxUser = null;\n\t\t\t\t\tfor(int i=0; i<usersList.size(); i++) {\n\t\t\t\t\t\tif(usersList.get(i).getUsername().equals(auxUsername) &&\n\t\t\t\t\t\t\t\t\tusersList.get(i).getPassword().equals(auxPassword)) {\n\t\t\t\t\t\t\tauxUser = usersList.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(auxUser != null) {\n\t\t\t\t\t\tsetVisible(false);\n\t\t\t\t\t\tUserGUI userGUI = new UserGUI(this, auxUser);\n\t\t\t\t\t\tuserGUI.run();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Username or password incorect! Try again!\",\n\t\t\t\t \t\t\"ERROR!\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\t//Delete text from textfields\n\t\t\t\t\t\tusernameTextField.setText(\"\");\n\t\t\t\t\t\tpasswordField.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Delete text from textfields\n\t\t\t\tusernameTextField.setText(\"\");\n\t\t\t\tpasswordField.setText(\"\");\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic boolean checkLogin() {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean checkLogin() {\n\t\treturn false;\r\n\t}",
"public boolean loginUser();",
"public void sendLoginClickPing() {\n WBMDOmnitureManager.sendModuleAction(new WBMDOmnitureModule(\"reg-login\", ProfessionalOmnitureData.getAppNamePrefix(this), WBMDOmnitureManager.shared.getLastSentPage()));\n }",
"@Override\n\tpublic boolean isLogin() {\n\t\treturn false;\n\t}",
"private void login() {\n\t\t \tetUserName.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etUserName);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t \t\n\t\t \t // TextWatcher would let us check validation error on the fly\n\t\t \tetPass.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etPass);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t }",
"public String login(){\n UsernamePasswordToken token = new UsernamePasswordToken(user.getAccount(),\n user.getPassword());\n\n// \"Remember Me\" built-in:\n token.setRememberMe(user.isRememberMe());\n\n Subject currentUser = SecurityUtils.getSubject();\n\n\n try {\n currentUser.login(token);\n } catch (AuthenticationException e) {\n // Could catch a subclass of AuthenticationException if you like\n FacesContext.getCurrentInstance().addMessage(\n null,\n new FacesMessage(\"Login Failed: \" + e.getMessage(), e\n .toString()));\n return \"/login\";\n }\n return \"index\";\n }",
"private void logoutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutButtonActionPerformed\n boolean isLoggedIn = uL.isLoggedIn();\n boolean isLoggedInNew = na.isLoggedIn();\n //boolean found = uL.isFound();\n if (isLoggedIn || isLoggedInNew) {\n na.setIsLoggedIn(false);\n uL.setIsLoggedIn(false);\n uL.setIsFound(false);\n dm.messageUserLoggedOut();\n } else {\n dm.messageUserNotLoggedIn();\n }\n }",
"public boolean confirmLoginClicked() {\n return confirmLogin;\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tlogin();\r\n\t\t\t}",
"public void login(ActionEvent e) throws IOException{\n\t\tString username = Username.getText().toLowerCase();\n\t\tString password = Password.getText();\n\t\tif(username.equalsIgnoreCase(\"admin\")){\n\t\t\tif (password.equals(PhotoAlbum.admin.getPassword())) {\n\t\t\t\tsegue(\"/view/Admin.fxml\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpasswrong.setStyle(\"-fx-opacity: 1;\");\n\t\t\t\tPassword.setStyle(\"-fx-text-box-border: red; -fx-focus-color: red;\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t} \n\t\t//search through list\n\t\tfor(int i = 0; i < PhotoAlbum.admin.getUserList().size(); i++){\n\t\t\tPhotoAlbum.regular_user = (NonAdminUser) PhotoAlbum.admin.getUserList().get(i);\n\t\t\tif(PhotoAlbum.regular_user.getUsername().equals(username)){\n\t\t\t\tif(PhotoAlbum.regular_user.getPassword().equals(password)){\n\t\t\t\t\tUsername.setStyle(\"-fx-text-box-border: white; -fx-focus-color: #008ED6;\");\n\t\t\t\t\tuserwrong.setStyle(\"-fx-opacity: 0;\");\n\t\t\t\t\tPassword.setStyle(\"-fx-text-box-border: white; -fx-focus-color: #008ED6;\");\n\t\t\t\t\tpasswrong.setStyle(\"-fx-opacity: 0;\");\n\t\t\t\t\tPhotoAlbum.logged_in = (NonAdminUser) PhotoAlbum.admin.getUserList().get(i);\n\t\t\t\t\tsegue(\"/view/Albums.fxml\");\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tpasswrong.setStyle(\"-fx-opacity: 1;\");\n\t\t\t\t\tPassword.setStyle(\"-fx-text-box-border: red; -fx-focus-color: red;\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//if not found\n\t\tuserwrong.setStyle(\"-fx-opacity: 1;\");\n\t\tUsername.setStyle(\"-fx-text-box-border: #e67e22; -fx-focus-color: #e67e22;\");\n\t\tPassword.setStyle(\"-fx-text-box-border: #e67e22; -fx-focus-color: #e67e22;\");\n\t}",
"@Override\r\n\tpublic void actionPerformed(Object e) {\n\t\tif(e == loginButton) {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\tPreparedStatement ps = con.prepareStatement(\"SELECT * FROM users WHERE username LIKE ? AND password LIKE ?\");\r\n\t\t\t\tps.setString(1, usernameField.getText());\r\n\t\t\t\tps.setString(2, passField.getText());\r\n\t\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\t\t\r\n\t\t\t\tif(!rs.next()) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"invalid username/password\",\"error\",JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tint i = rs.getInt(\"UserId\");\r\n\t\t\t\t\tString name = rs.getString(\"Name\");\r\n\t\t\t\t\tBlob blob = rs.getBlob(\"ProfilePic\");\r\n\t\t\t\t\tUser user = User.getUser(i, name,usernameField.getText(), passField.getText(),blob);\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Login Successfull !\");\r\n\t\t\t\t\tsm.setNewPage(StateManager.HOME);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} catch (SQLException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tSystem.out.println(\"ERROR\");\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void loggedInUser() {\n\t\t\n\t}",
"private void logIn() {\n char[] password = jPasswordField1.getPassword();\n String userCode = jTextField1.getText();\n\n String txtpassword = \"\";\n for (char pw : password) {\n txtpassword += pw;\n }\n if (\"\".equals(txtpassword)) {\n JOptionPane.showMessageDialog(this, textBundle.getTextBundle().getString(\"enterPassword\"), \"No Password\", JOptionPane.WARNING_MESSAGE);\n } else if (txtpassword.equals(userData.get(0).toString())) {\n jPasswordField2.setEnabled(true);\n jPasswordField3.setEnabled(true);\n jPasswordField2.setEditable(true);\n jPasswordField3.setEditable(true);\n jPasswordField2.grabFocus();\n }\n }",
"@Override\r\n\tpublic boolean login(MemberDto mem) {\n\t\treturn login(mem.getEmail(),mem.getPw());\r\n\t}",
"private JButton getLoginButton() {\n\t\tif (LoginButton == null) {\n\t\t\tLoginButton = new JButton();\n\t\t\tLoginButton.setBounds(new Rectangle(140, 230, 80, 25));\n\t\t\tLoginButton.setText(\"Login\");\n\t\t\tLoginButton.addActionListener(new ActionListener () {\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(NameTextField.getText().compareTo(\"admin\")==0)\n\t\t\t\t\t{\n//\t\t\t\t\t\tSystem.out.println(\"clicked\");\n\t\t\t\t\t\tif(String.valueOf(PasswordField.getPassword()).equals(\"mds\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tMainFrame m = new MainFrame();\n//\t\t\t\t\t\t\tm.setBounds(0,0,900,600);\n\t\t\t\t\t\t\tm.setVisible(true);\n\t\t\t\t\t\t\tcloseWindow();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tshowMessageDialog(\"Invalid Username or Password\");\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn LoginButton;\n\t}",
"public void login(ActionEvent e) throws IOException {\r\n\t\t\r\n \tString username = loginuser.getText().trim();\r\n \t//if user is admin, change to userlist screen\r\n \tif (username.equals(\"admin\")) {\r\n \tPhotos.userlistscreen();\r\n \t} else {\r\n \t\tUser user = currentAdmin.findUser(username);\r\n \t\t//if user is found, log into that user and show the album view for that user specifically\r\n \t\tif (user!=null) {\r\n \t\t\tAlbumController.currentUser = (NonAdmin) user;\r\n \t\t\tCopyController.currentUser = (NonAdmin) user;\r\n \t\t\tMoveController.currentUser = (NonAdmin) user;\r\n \t\t\tPhotos.albumscreen(user);\r\n \t\t}\r\n \t\telse {\r\n \t\t\tAlert alert = new Alert(Alert.AlertType.ERROR);\r\n \t\t\talert.setTitle(\"Error\");\r\n \t\t\talert.setHeaderText(\"Invalid username\");\r\n \t\t\talert.setContentText(\"Please try again\");\r\n \t\t\talert.showAndWait();\r\n \t\t\tloginuser.setText(\"\");\r\n \t\t}\r\n \t}\r\n\t}",
"@Override\n public void onClick(View v) {\n String usernanme=et_username.getText().toString().trim();\n String password=et_password.getText().toString().trim();\n if(usernanme.equals(\"\")||password.equals(\"\"))\n {\n Toast.makeText(AdminHomeActivity.this, \"Enter All Fields\", Toast.LENGTH_SHORT).show();\n }\n else\n {\n String msg=repo.CheckUserAlreadyExist(usernanme,password);\n if(!msg.equals(\"exist\"))\n {\n repo.addUser(usernanme,password);\n dialog.dismiss();\n }\n else\n {\n Toast.makeText(AdminHomeActivity.this, \"Username or Password Already Exist\", Toast.LENGTH_SHORT).show();\n }\n }\n\n\n }",
"public void actionPerformed(ActionEvent e) {\n \t\t\t\tlogin();\n \t\t\t}",
"public void login() {\n presenter.login(username.getText().toString(), password.getText().toString());\n }",
"public void clickOnLoginButton(){\n\t\tthis.loginButton.click();\n\t}",
"public void registerLoginMenu() {\n System.out.println(\"Do you want to Login or Register?\");\n System.out.println(\"(Enter the number without parenthesis to choose an option)\");\n System.out.println(\"Enter (1) Login, (2) Register\");\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tif (campoUsername.getText().replace(\" \", \"\").equals(\"\")\n\t\t\t\t\t\t|| new String(campoPassword.getPassword()).replace(\" \", \"\").equals(\"\")) {\n\t\t\t\t\tmostraMissatge(\"No ha possat username o password\");\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\tcv.PrLogin(campoUsername.getText(), new String(campoPassword.getPassword()));\n\t\t\t\t}\n\t\t\t}",
"private void btnLogin(ActionEvent e) {\n }",
"public boolean logincheck(String user, String pass) \r\n {\n \r\n try{\r\n Connection conn = DriverManager.getConnection(url, userName, password);\r\n String Sql = \"Select * from APP.MEMBER where email=? and password=?\";\r\n PreparedStatement pst = conn.prepareStatement(Sql);\r\n pst.setString(1,user);\r\n pst.setString(2,pass);\r\n ResultSet rs = pst.executeQuery();\r\n if (rs.next())\r\n {\r\n JOptionPane.showMessageDialog(null,\"Welcome user\");\r\n createEventsUI w = new createEventsUI();\r\n w.setVisible(true);\r\n }\r\n else\r\n {\r\n JOptionPane.showMessageDialog(null,\"Invalid username or password\", \"Access Denied\",JOptionPane.ERROR_MESSAGE);\r\n }\r\n }catch(Exception e) \r\n {\r\n JOptionPane.showMessageDialog(null, e);\r\n }\r\n return false;\r\n \r\n }",
"@Override\n public void onLoginClicked(String username, String password) {\n loginView.showProgress();\n loginInteractor.authorize(username, password, this);\n }",
"@Override\n\t\t\tpublic void onClick(View v)\n\t\t\t{\n\t\t\t\tToast.makeText(getApplicationContext(), \"Please Sign in to continue.\", Toast.LENGTH_SHORT).show();\n\t\t\t}",
"private void signInAlready(FirebaseUser user) {\n if (user != null) {\n updateUI(user);\n } else {\n updateUI(null);\n }\n }",
"public void logStudentButton(ActionEvent actionEvent) {\n if(loginModel.verifyPassword(emailField.getText(),\n passwordField.getText(), UserType.STUDENT)){\n //we need to get student\n executeLogIn(actionEvent, new LogInStudent(loginModel.\n getStudent(emailField.getText())));\n logInStudent.setDisable(true);\n }\n else {\n System.out.println(\"verification not successful\");\n JOptionPane.showMessageDialog(null, \"Wrong email or password!\");\n System.out.println(emailField.getText());\n System.out.println(passwordField.getText());\n System.out.println(\"end of that\");\n }\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"444444\");\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\n\t\tif(ae.getSource().equals(j_b_login)) {\n\t\t\tString username;\n\t\t\tString password;\n\t\t\t\n\t\t\tusername = j_text_Username.getText();\n\t\t\tpassword = j_text_password.getText();\n\t\t\tif(username.contentEquals(\"admin\") && password.equals(\"admin\")) {\n//\t\t\t\tnew Admin_Dashboard();\n\t\t\t\tAdmin_Dashboard AD =new Admin_Dashboard();\n\t\t\t\tAD.setVisible(true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Invalid Username or Password\");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"@Override\n public void loginBtnClk(View view) {\n isRegisteredOnGCM(1);\n }",
"public pageLogin() {\n initComponents();\n labelimage.setBorder(new EmptyBorder(0,0,0,0));\n enterButton.setBorder(null);\n enterButton.setContentAreaFilled(false);\n enterButton.setVisible(true);\n usernameTextField.setText(\"Username\");\n usernameTextField.setForeground(new Color(153,153,153));\n passwordTextField.setText(\"Password\");\n passwordTextField.setForeground(new Color(153,153,153));\n usernameAlert.setText(\" \");\n passwordAlert.setText(\" \");\n \n }",
"public void login(View view)\n {\n shakeAnim = AnimationUtils.loadAnimation(this, R.anim.shake_anim);\n\n String username = usernameLoginEditText.getText().toString().trim();\n String password = passwordLoginEditText.getText().toString().trim();\n\n for (UserAccount account : accountList) {\n if (account.getStudentUserName().equals(username) && account.getStudentPassword().equals(password)) {\n Toast.makeText(this, getString(R.string.account_found_text),\n Toast.LENGTH_SHORT).show();\n UserAccount.isLoggedIn = true;\n UserAccount.singedInUserAccountName = username;\n\n if (account.getIsAdmin()) {\n startActivity(new Intent(this, AdminMainMenuActivity.class).putExtra(\"Account\", account));\n this.finish();\n }\n else {\n startActivity(new Intent(this, UserMenuActivity.class).putExtra(\"Account\", account));\n this.finish();\n }\n\n userFound = true;\n }\n }\n\n if (!userFound) {\n loginButtonImageView.startAnimation(shakeAnim);\n Toast.makeText(this, getString(R.string.invalid_username_password_text),\n Toast.LENGTH_SHORT).show();\n }\n }",
"private void btnLogInActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLogInActionPerformed\n if(mngr!=null){\n if(mngr.LogIn(txtUsername.getText(), new String(txtPassword.getPassword()))){\n this.dispose();\n } else {\n JOptionPane.showConfirmDialog(this, \"Could not log you in. Check login, password or connection.\");\n }\n }\n }",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t\t\t\tboolean approved = showLoginScreen();\n\t\t\t\tif(approved) {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tGUIDriver.goToScreen(\"welcome\");\n\t\t\t\t} else {\n\t\t\t\t\tshowIncorrectMessage();\n\t\t\t\t}\n\t\t}",
"public void login() {\n\n String username = usernameEditText.getText().toString();\n String password = passwordEditText.getText().toString();\n regPresenter.setHost(hostEditText.getText().toString());\n regPresenter.login(username, password);\n }",
"public void loginMenu(){\n\t\tstate = ATM_State.LOGINID;\n\t\tgui.setDisplay(\"Enter your account ID: \\n\");\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\n\t\t\t\tcheckUser();\n\t\t\t}",
"@Override\n public void onClick(View v) {\n nick = nickname.getText().toString();\n if ((nick.trim().length() > 0)) {\n new Registro(activity, loginResult).execute();\n progressBar.setVisibility(View.VISIBLE);\n } else {\n dialog.setMessage(\"El nickname no puede ser vacio\");\n }\n }",
"void onSignInButtonClicked(String userEmail, String userPassword);",
"private final static void onLoginAdmin(TextField username, PasswordField password)\n\t{\n\t\tif(ProfileManipulation.findUsername(username.getText()) && !ProfileManipulation.checkLoginStatus(username.getText())){\n\t\t\tif (ProfileManipulation.isVerfied(username.getText())) {\n\t\t\t\tProfileManipulation.updateLoginStatus(username.getText(), true);\n\n\t\t\t\t// Jetzt wird das Profil aufgerufen\n\t\t\t\tPartylize.setUsername(username.getText());\n\n\t\t\t\tProfileManipulation.changePassword(password.getText());\n\n\t\t\t\tPartylize.showMainScene();\n\t\t\t} else {\n\t\t\t\tPartylize.setUsername(username.getText());\n\t\t\t\tPartylize.showVerification();\n\t\t\t}\n\t\t}\n\t\t// Funktionsaufruf Datenbankanbindung -> Erstellen einer Session ID\n\t\t// Funktionsaufruf Profildaten in lokalen Speicher laden - WIP\n\t\telse {\n\t\t\tusername.setText(\"\");\n\t\t\tpassword.setText(\"\");\n\t\t}\n\t}",
"void goToLogin() {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.LOGIN));\n }",
"public void login() {\n\t\tUser user = new User(\"admin\", \"12345678\", Role.ADMIN);\n\t\tuser.setEmail(\"[email protected]\");\n\t\t\n\t\tif(user != null) {\n\t\t\tuserBean.setLoggedInUser(user);\n\t\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\t\tHttpServletRequest req = (HttpServletRequest)context.getExternalContext().getRequest();\n\t\t\treq.getSession().setAttribute(ATTR_USER, user);\n\t\t}else{\n\t\t\tkeepDialogOpen();\n\t\t\tdisplayErrorMessageToUser(\"Wrong Username/Password. Try again\");\n\t\t}\n\t\t\n\t}",
"public boolean login() {\n\t\tview.setVisible(true);\r\n\t\treturn resultado;\r\n\t}",
"public static void login() {\n\t\trender();\n\t}"
] | [
"0.69352597",
"0.6725127",
"0.6692609",
"0.6690891",
"0.6621344",
"0.655737",
"0.6556487",
"0.638869",
"0.6371971",
"0.63640356",
"0.6353099",
"0.6344787",
"0.63339865",
"0.6281247",
"0.62773734",
"0.6272287",
"0.62678695",
"0.62540823",
"0.6247845",
"0.62419623",
"0.62116164",
"0.62038517",
"0.6202748",
"0.6201562",
"0.6190656",
"0.61832875",
"0.61783653",
"0.61783653",
"0.6167488",
"0.61609143",
"0.61520004",
"0.61341846",
"0.6127342",
"0.61248225",
"0.61155134",
"0.61097294",
"0.610845",
"0.6106818",
"0.6106584",
"0.6102645",
"0.6082578",
"0.60698813",
"0.6062841",
"0.6060296",
"0.6059191",
"0.6059185",
"0.60554504",
"0.6044402",
"0.60363513",
"0.60243785",
"0.60230076",
"0.6014192",
"0.60109884",
"0.60058796",
"0.60052615",
"0.6005085",
"0.6005085",
"0.6002496",
"0.5989497",
"0.59886616",
"0.59856486",
"0.59818476",
"0.5970911",
"0.59706545",
"0.59592885",
"0.5951159",
"0.5940166",
"0.593111",
"0.59301907",
"0.5925174",
"0.5922564",
"0.5921033",
"0.59020996",
"0.5900898",
"0.5892729",
"0.5882121",
"0.58767176",
"0.58659655",
"0.5865715",
"0.5862954",
"0.5862295",
"0.5853345",
"0.58506066",
"0.58503234",
"0.5847406",
"0.58472425",
"0.5845704",
"0.58373886",
"0.58322394",
"0.5831752",
"0.58285475",
"0.5826013",
"0.5825715",
"0.58217597",
"0.58098364",
"0.58097833",
"0.5807544",
"0.5807013",
"0.5806522",
"0.5805034",
"0.5802528"
] | 0.0 | -1 |
On complete call either onSignupSuccess or onSignupFailed depending on success | public void run() {
if(signedUp == 1) {
onSignupSuccess();
} else{
onSignupFailed();
}
//
progressDialog.dismiss();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void signup() {\n Log.d(TAG, \"Signup\");\n\n if (!validate()) {\n onSignupFailed();\n return;\n }\n\n createProgressDialog(R.string.creating_account);\n\n final String name = _nameText.getText().toString();\n final String email = _emailText.getText().toString();\n final String password = _passwordText.getText().toString();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n createToast(R.string.authentication_failed, Toast.LENGTH_SHORT);\n } else {\n progressDialog.dismiss();\n final FirebaseUser user = mAuth.getCurrentUser();\n mDatabase.child(\"users\").child(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.getValue() == null) {\n createUserInFirebase(name, email, user.getUid());\n }\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n sendToTrivia();\n }\n\n }\n });\n\n\n new android.os.Handler().postDelayed(\n new Runnable() {\n public void run() {\n // On complete call either onSignupSuccess or onSignupFailed\n // depending on success\n progressDialog.dismiss();\n }\n }, 3000);\n }",
"@Override\n public void onValidationSucceeded() {\n String email = mEmailField.getText().toString();\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n String password = mPasswordField.getText().toString();\n\n mSignUpInterface.onSignup(email, firstName, lastName, password);\n }",
"private void onSignupSuccess() {\n startActivity(currentActivity, UserLoginActivity.class);\n finish();\n }",
"public void run() {\n onSignupSuccess();\n // onSignupFailed();\n progressDialog.dismiss();\n }",
"public void SignUp2(View view){\n\n mFirebaseAuth.createUserWithEmailAndPassword(EditEmail.getText().toString(),EditPass.getText().toString())\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n saveUser(EditFirstName.getText().toString(),EditLastName.getText().toString(),EditEmail.getText().toString(),SelectSpinner.getSelectedItem().toString());\n mUserDatabaseReference.push().setValue(mClassUser);\n EditFirstName.setText(\"\");\n EditLastName.setText(\"\");\n EditEmail.setText(\"\");\n EditPass.setText(\"\");\n\n if (!task.isSuccessful()) {\n// Toast.makeText(ActivitySignup.this, \"failed to sign up\",\n// Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n\n }",
"public void onClick_AGSU_signUp(View view) {\n AnimationTools.startLoadingAnimation(Constants.ANIMATION_CODE_AGSU_LOADING, this, signUpButton_rootLayout, R.style.AGSU_loading_progress_bar);\n\n FirestoreManager.saveUserData(SecondarySignUpManager.getDatabaseUser());\n\n //add a password-email auth method\n AuthCredential credential = EmailAuthProvider.getCredential(SecondarySignUpManager.getDatabaseUser().getEmail(), SecondarySignUpManager.getDatabaseUser().getPassword());\n AuthenticationManager.getCurrentUser().linkWithCredential(credential).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()) {\n System.out.println(\"[Neuron.SecondarySignUpActivity.onClick_AGSU_signUp]: link with email credential SUCCESSFUL! User uid = \" + task.getResult().getUser().getDisplayName());\n Constants.isSignUpInProcess = false; //sign up is now finished\n\n //in AGSU user is always new --> send verification email\n EmailVerification.sendVerificationEmail();\n\n Constants.isSecondarySignUpInProcess = false; //end of secondary sign up process\n\n ActivityTools.startNewActivity(activityContext, MainActivity.class);\n } else {\n System.err.println(\"[Neuron.SecondarySignUpActivity.onClick_AGSU_signUp]: ERROR: link with email credential FAILED! \" + task.getException().getMessage());\n }\n\n AnimationTools.stopLoadingAnimation(Constants.ANIMATION_CODE_AGSU_LOADING);\n }\n });\n\n }",
"@Override\n\t\t\t\t\tpublic void onSuccess() {\n\t\t\t\t\t\tToast.makeText(RegisterActivity.this,\"Sign up successfully!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tstartActivity(new Intent(RegisterActivity.this, LoginActivity.class));\n\t\t\t\t\t}",
"private void signUp() {\n final String email = ((EditText) findViewById(R.id.etSignUpEmail))\n .getText().toString();\n final String password = ((EditText) findViewById(R.id.etSignUpPassword))\n .getText().toString();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Log.d(\"SIGN_UP_USER\", \"createUserWithEmail:success\");\n sendVerificationEmail(mAuth.getCurrentUser());\n updateUI();\n } else {\n Log.d(\"SIGN_UP_USER\", \"createUserWithEmail:failure\");\n Toast.makeText(LoginActivity.this,\n \"Failed to create a new user.\",\n Toast.LENGTH_LONG).show();\n }\n }\n });\n }",
"public void run() {\n onSignupSuccess();\n // onSignupFailed();\n progressDialog.dismiss();\n }",
"public void run() {\n onSignupSuccess();\n // onSignupFailed();\n progressDialog.dismiss();\n }",
"public void run() {\n onSignupSuccess();\n // onSignupFailed();\n progressDialog.dismiss();\n }",
"public void run() {\n onSignupSuccess();\n // onSignupFailed();\n progressDialog.dismiss();\n }",
"public void run() {\n onSignupSuccess();\n // onSignupFailed();\n progressDialog.dismiss();\n }",
"public void run() {\n onSignupSuccess();\n // onSignupFailed();\n progressDialog.dismiss();\n }",
"public void run() {\n onSignupSuccess();\n // onSignupFailed();\n progressDialog.dismiss();\n }",
"private void attemptSignup()\n\t{\n\t\t// Reset errors.\n\t\tmEmailView.setError(null);\n\t\tmPasswordView.setError(null);\n\n\t\t_signupButton.setEnabled(false);\n\n\t\t// Store values at the time of the login attempt.\n\t\tfinal String displayName = mNameView.getText().toString();\n\t\tString email = mEmailView.getText().toString();\n\t\tString password = mPasswordView.getText().toString();\n\n\t\tboolean cancel = false;\n\t\tView focusView = null;\n\n\t\t// Check for a valid password, if the user entered one.\n\t\tif (TextUtils.isEmpty(password))\n\t\t{\n\t\t\tmPasswordView.setError(getString(R.string.error_field_required));\n\t\t\tfocusView = mPasswordView;\n\t\t\tcancel = true;\n\t\t}\n\t\telse if (!isPasswordValid(password))\n\t\t{\n\t\t\tmPasswordView.setError(getString(R.string.error_invalid_password));\n\t\t\tfocusView = mPasswordView;\n\t\t\tcancel = true;\n\t\t}\n\n\t\t// Check for a valid email address.\n\t\tif (TextUtils.isEmpty(email))\n\t\t{\n\t\t\tmEmailView.setError(getString(R.string.error_field_required));\n\t\t\tfocusView = mEmailView;\n\t\t\tcancel = true;\n\t\t}\n\t\telse if (!isEmailFormatValid(email))\n\t\t{\n\t\t\tmEmailView.setError(getString(R.string.error_invalid_email));\n\t\t\tfocusView = mEmailView;\n\t\t\tcancel = true;\n\t\t}\n\n\t\t//Check for a valid display name\n\t\tif (displayName.isEmpty())\n\t\t{\n\t\t\tmNameView.setError(getString(R.string.error_field_required));\n\t\t\tfocusView = mNameView;\n\t\t\tcancel = true;\n\t\t}\n\n\t\tif (cancel)\n\t\t{\n\t\t\t// There was an error; don't attempt login and focus the first\n\t\t\t// form field with an error.\n\t\t\tfocusView.requestFocus();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//[START init_progress_dialog]\n\t\t\tfinal ProgressDialog progressDialog = new ProgressDialog(SignupPersonalActivity.this,\n\t\t\t\t\tR.style.AppTheme_Dark_Dialog);\n\t\t\tprogressDialog.setIndeterminate(true);\n\t\t\tprogressDialog.setMessage(\"Creating Account...\");\n\t\t\tprogressDialog.show();\n\t\t\t//[END init_progress_dialog]\n\t\t\tmAuth.createUserWithEmailAndPassword(email, password)\n\t\t\t\t\t.addOnCompleteListener(this, new OnCompleteListener<AuthResult>()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onComplete(@NonNull Task<AuthResult> task)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (task.isSuccessful())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tonSignUpSuccess(displayName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tonSignUpFailed();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// [START_EXCLUDE]\n\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t\t\t\t\t// [END_EXCLUDE]\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\t}",
"public F.Promise<Result> handleSignUp() {\n final Form<SignUp> filledForm = signUpForm.bindFromRequest();\n if(customerService().isLoggedIn()) {\n return asPromise(redirectToReturnUrl());\n } else if (filledForm.hasErrors()) {\n return asPromise(badRequest(signupView.render(data().build(), filledForm)));\n } else {\n return handleSignUpWithValidForm(filledForm);\n }\n }",
"public void onSignupSuccess(){\n Toast.makeText(this, \"YEPP\", Toast.LENGTH_SHORT).show();\r\n Intent changetomain = new Intent(RegisterActivity.this, MainAccount.class) ;\r\n startActivity(changetomain);\r\n }",
"@Test(priority=2)\n\tpublic void completeSignUpProcess(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterFirstName(\"Manish Kumar\");\n\t\tsignup.enterLastName(\"Vuttunoori\");\n\t\tsignup.enterPassword(\"qwerty126\");\n\t\tsignup.reenterPassword(\"qwerty126\");\n\t\tsignup.clickSubmit();\n\t\t// must go to home page but wont as the mail id used here is already registered for an account, \n\t\t//so just checking for single error i.e. Email is already registered.\n\t\tAssert.assertEquals(1, signup.getErrors().size());\n\t}",
"private void attemptSignUp() {\n // Reset errors.\n mEmailView.setError(null);\n mPasswordViewOne.setError(null);\n mPasswordViewTwo.setError(null);\n\n // Store values at the time of the login attempt.\n final String email = mEmailView.getText().toString();\n final String password = mPasswordViewOne.getText().toString();\n final String passwordTwo = mPasswordViewTwo.getText().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(password)) {\n mPasswordViewOne.setError(getString(R.string.error_field_required));\n focusView = mPasswordViewOne;\n cancel = true;\n } else if (!isPasswordValid(password)) {\n mPasswordViewOne.setError(getString(R.string.error_invalid_password));\n focusView = mPasswordViewOne;\n cancel = true;\n }\n\n // Check for matching password\n if (!password.equals(passwordTwo)) {\n mPasswordViewOne.setError(\"Passwords do not match\");\n mPasswordViewTwo.setError(\"Passwords do not match\");\n focusView = mPasswordViewOne;\n cancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email)) {\n mEmailView.setError(getString(R.string.error_field_required));\n focusView = mEmailView;\n cancel = true;\n } else if (!isEmailValid(email)) {\n mEmailView.setError(getString(R.string.error_invalid_email));\n focusView = mEmailView;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n showProgress(true);\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Log.d(\"FirebaseSignUp\", \"createUserWithEmail:Success\");\n FirebaseUser user = mAuth.getCurrentUser();\n String uid = user == null ? \"null\" : user.getUid();\n\n // TODO: if successful, check if User should be an admin and add\n // them to list of admins in Firebase database\n if (mSpinner.getSelectedItem().equals(AccountType.ADMIN)) {\n mDatabase.child(\"admins\").child(uid)\n .setValue(email.split(\"@\")[0]);\n }\n\n Intent i = new Intent(getApplicationContext(), App.class);\n finish();\n startActivity(i);\n } else {\n // Probably means the email was taken\n mEmailView.setError(getString(R.string.error_email_already_registered));\n mEmailView.requestFocus();\n showProgress(false);\n }\n }\n });\n }\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n userWAPFirebase.create(newUser, firebaseAuth.getCurrentUser().getUid()).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(TAG, \"User \" + newUser.getUsername() + \" has been successfully created\");\n Toast.makeText(SignUpActivity.this, \"Sign up successful!\", Toast.LENGTH_SHORT).show();\n\n //Go back to Login Activity\n Intent loginIntent = new Intent(SignUpActivity.this, LoginActivity.class);\n loginIntent.putExtra(PASSWORD_KEY, etPasswordSignup.getText().toString());\n loginIntent.putExtra(EMAIL_KEY, newUser.getEmail());\n startActivity(loginIntent);\n }\n });\n }",
"public void run() {\n if (resultType == 1) {\n onSignupSuccess();\n } else if(resultType==2){\n onSignupFailed(\"Cannot create user.\");\n }else{\n onSignupFailed(\"Network unavailable.\");\n }\n progressDialog.dismiss();\n }",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(Signup.this,\"Signup Succcessful\",Toast.LENGTH_SHORT).show();\n\n }",
"@Override\n public void onSuccess() {\n Handler.Callback bayunAuthSuccess = msg -> {\n confirmHandler.onSuccess();\n return false;\n };\n\n\n // Bayun Registration failure Callback\n Handler.Callback bayunAuthFailure = msg -> {\n Exception exception = new Exception(msg.getData().getString(Constants.ERROR));\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Bayun Registration authorizeEmployeeCallback Callback\n Handler.Callback authorizeEmployeeCallback = msg -> {\n String employeePublicKey = msg.getData().getString(Constants.EMPLOYEE_PUBLICKEY);\n Exception exception = new Exception(\"Employee Authorization is Pending\");\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Registration with Bayun\n BasicBayunCredentials basicBayunCredentials = new BasicBayunCredentials\n (appId, companyName, user.getUserId(), signUpPassword.toCharArray(),\n appSecret, applicationKeySalt);\n\n\n if(signUpIsRegisterWithPwd){\n BayunApplication.bayunCore.registerEmployeeWithPassword\n (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n }else {\n BayunApplication.bayunCore.registerEmployeeWithoutPassword(activity,companyName,user.getUserId()\n ,signUpEmail,false, authorizeEmployeeCallback,\n null,null,null, bayunAuthSuccess, bayunAuthFailure);\n\n }\n// BayunApplication.bayunCore.registerEmployeeWithPassword\n// (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n\n\n }",
"public void signUp(View v) {\n attemptRegistration();\n }",
"private void signUp() {\n if (mAuthTask != null) {\n return;\n }\n\n // Reset errors.\n mEmailView.setError(null);\n mPasswordView.setError(null);\n\n // Store values at the time of the login attempt.\n String email = mEmailView.getText().toString();\n String password = mPasswordView.getText().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {\n mPasswordView.setError(getString(R.string.error_invalid_password));\n focusView = mPasswordView;\n cancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email)) {\n mEmailView.setError(getString(R.string.error_field_required));\n focusView = mEmailView;\n cancel = true;\n } else if (!isEmailValid(email)) {\n mEmailView.setError(getString(R.string.error_invalid_email));\n focusView = mEmailView;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n showProgress(true);\n mAuthTask = new UserLoginTask(email, password, true);\n mAuthTask.execute((Void) null);\n }\n }",
"void signInComplete();",
"public void confirmSignUp(Activity activity, CognitoUser user, String confirmCode,\n boolean forcedAliasCreation, GenericHandler confirmHandler) {\n // Callback for Cognito sign up confirmation\n GenericHandler wrapperConfirmHandler = new GenericHandler() {\n @Override\n public void onSuccess() {\n // Bayun Registration success Callback\n Handler.Callback bayunAuthSuccess = msg -> {\n confirmHandler.onSuccess();\n return false;\n };\n\n\n // Bayun Registration failure Callback\n Handler.Callback bayunAuthFailure = msg -> {\n Exception exception = new Exception(msg.getData().getString(Constants.ERROR));\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Bayun Registration authorizeEmployeeCallback Callback\n Handler.Callback authorizeEmployeeCallback = msg -> {\n String employeePublicKey = msg.getData().getString(Constants.EMPLOYEE_PUBLICKEY);\n Exception exception = new Exception(\"Employee Authorization is Pending\");\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Registration with Bayun\n BasicBayunCredentials basicBayunCredentials = new BasicBayunCredentials\n (appId, companyName, user.getUserId(), signUpPassword.toCharArray(),\n appSecret, applicationKeySalt);\n\n\n if(signUpIsRegisterWithPwd){\n BayunApplication.bayunCore.registerEmployeeWithPassword\n (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n }else {\n BayunApplication.bayunCore.registerEmployeeWithoutPassword(activity,companyName,user.getUserId()\n ,signUpEmail,false, authorizeEmployeeCallback,\n null,null,null, bayunAuthSuccess, bayunAuthFailure);\n\n }\n// BayunApplication.bayunCore.registerEmployeeWithPassword\n// (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n\n\n }\n\n @Override\n public void onFailure(Exception exception) {\n confirmHandler.onFailure(exception);\n }\n };\n\n // Confirmation call with Cognito\n user.confirmSignUpInBackground(confirmCode, forcedAliasCreation, wrapperConfirmHandler);\n }",
"public void attemptSighup(View view) {\n //Start AsyncTask for signup\n new SignUpCreatorTask().execute(\"\");\n }",
"public void onSignupFailed() {\n\n _signupButton.setEnabled(true);\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task)\n {\n String TAG = \"LoginActivity.userRegister\";\n if (task.isSuccessful())\n {\n Log.d(TAG, \"createUserWithEmailAndPassword:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n\n user.sendEmailVerification()\n .addOnCompleteListener(new OnCompleteListener<Void>()\n {\n @Override\n public void onComplete(@NonNull Task<Void> task)\n {\n String TAG = \"LoginActivity.userRegister.EmailVerify\";\n if (task.isSuccessful())\n {\n Log.d(TAG, \"sendEmailVerification:success\");\n Toast.makeText(getActivity(),\n \"Please check Email for Verification\",Toast.LENGTH_SHORT).show();\n }\n else\n {\n Log.w(TAG, \"sendEmailVerification:failure\", task.getException());\n Toast.makeText(getActivity(),\"Unable to Verify: \"\n + task.getException().getMessage(),Toast.LENGTH_SHORT).show();\n\n }\n }\n });\n }\n else\n {\n Log.w(TAG, \"createUserWithEmailAndPassword:failure\", task.getException());\n Toast.makeText(getActivity(), \"Unable to Register: \"\n + task.getException().getMessage(), Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n public void onRegistrationAccomplished() {\n Prefs.setSignedIn(true);\n // Proceed to Main\n proceedToMainActivityAndFinish();\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful())\n {\n addNewUserData(auth.getUid(), email, username);\n if (onCompleteListener != null) {\n onCompleteListener.onComplete(task);\n }\n }\n else\n {\n Toast.makeText(activity, \"faile to register ,Invalid email address Or the email is already registered\", Toast.LENGTH_SHORT).show();\n }\n }",
"public void run() {\n onSignupFailed();\n progressDialog.dismiss();\n }",
"public void registerUser(String email, String password){\n fbAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"createUserWithEmail:success\");\n FirebaseUser user = fbAuth.getCurrentUser();\n updateUI(user);\n Toast.makeText(Signup.this, \"Registration success.\",\n Toast.LENGTH_SHORT).show();\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"createUserWithEmail:failure\", task.getException());\n Toast.makeText(Signup.this, \"Registration failed.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n progressBar.setVisibility(View.GONE);\n if (!task.isSuccessful()) {\n // there was an error\n if (password.length() < 6) {\n passwordW.setError(getString(R.string.minimum_password));\n } else {\n Toast.makeText(SignUpActivity.this, getString(R.string.auth_failed), Toast.LENGTH_LONG).show();\n }\n } else {\n\n FirebaseUser user = auth.getCurrentUser();\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()\n .setDisplayName(dpName)\n .build();\n\n user.updateProfile(profileUpdates)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(SignUpActivity.this, \"User Created! Welcome to Udghosh.\", Toast.LENGTH_LONG).show();\n }\n else {\n Toast.makeText(SignUpActivity.this, \"Cannot connect to servers right now.\", Toast.LENGTH_LONG).show();\n }\n }\n });\n mDatabase.child(\"app\").child(\"users\").child(user.getUid()).setValue(phoneNumber);\n\n Intent intent = new Intent(SignUpActivity.this, HomeActivity.class);\n startActivity(intent);\n finish();\n }\n }",
"void onSignUpEmailRegistered();",
"public void signUp() {\n presenter.signup(username.getText().toString(), password.getText().toString());\n }",
"@Override\r\n\t\t\t\t\t\tpublic void done(ParseException e) {\n\t\t\t\t\t\t\tif(e == null) {\r\n\t\t\t\t\t\t\t\tToast.makeText(SignUpActivity.this, \"Signup Successfull\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t\t\tParseInstallation currentInstallation = ParseInstallation.getCurrentInstallation();\r\n\t\t\t\t\t\t\t\tcurrentInstallation.put(\"username\", ParseUser.getCurrentUser().getObjectId());\r\n\t\t\t\t\t\t\t\tcurrentInstallation.put(\"useremail\", ParseUser.getCurrentUser().getEmail());\r\n\t\t\t\t\t\t\t\tcurrentInstallation.saveInBackground();\r\n\t\t\t\t\t\t\t\tIntent intent = new Intent(SignUpActivity.this, MainActivity.class);\r\n\t\t\t\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tToast.makeText(SignUpActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}",
"@Override\n public void onRegistrationSuccess() {\n listener.onUsernameAvailabilityChecked(false);\n }",
"public void signUp(View view){\n\n\n\n if(signUpCheck) {\n\n\n if (TextUtils.isEmpty(userName.getText().toString()) || TextUtils.isEmpty(password.getText().toString()) || TextUtils.isEmpty(email.getText().toString())) {\n Toast.makeText(this, \"A Username, a Password, and an Email are required.\", Toast.LENGTH_SHORT).show();\n } else {\n\n ParseUser user = new ParseUser();\n\n user.setUsername(userName.getText().toString());\n user.setEmail(email.getText().toString());\n user.setPassword(password.getText().toString());\n\n user.signUpInBackground(new SignUpCallback() {\n @Override\n public void done(ParseException e) {\n if (e == null) {\n //Log.i(\"Signup\", \"Successful\");\n showEventListActivity();\n } else {\n Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n }\n else{\n\n\n ParseUser.logInInBackground(userName.getText().toString(), password.getText().toString(), new LogInCallback() {\n @Override\n public void done(ParseUser user, ParseException e) {\n\n if(user != null){\n //Log.i(\"Signup\", \"Login Successful\");\n showEventListActivity();\n }\n else{\n Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n }\n\n\n\n }",
"private void signUpNewUserToDB(){\n dbAuthentication.createUserWithEmailAndPassword(this.newUser.getEmail(), this.newUser.getPassword())\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n /**signUp success, will update realTime DB ant firebase Authentication*/\n FirebaseUser currentUser = dbAuthentication.getCurrentUser();\n addToRealDB(currentUser.getUid());\n /**will send verification email to the user from Firebase Authentication*/\n currentUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n }\n });\n }else{isBadEmail = true;}\n }\n });\n }",
"private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }",
"public void signupPressed(View view) {\n // fetch the values\n usernameSignup = (EditText) findViewById(R.id.usernameSignupFragment);\n emailSignup = (EditText) findViewById(R.id.emailSignupFragment);\n passwordSignup = (EditText) findViewById(R.id.passwordSignupFragment);\n reenterPasswordSignup = (EditText) findViewById(R.id.reenterPasswordSignupFragment);\n\n String username = usernameSignup.getText().toString();\n String email = emailSignup.getText().toString();\n String password1 = passwordSignup.getText().toString();\n String password2 = reenterPasswordSignup.getText().toString();\n\n // input validation\n if (username.length() == 0) {\n Toast.makeText(getApplicationContext(), \"Please enter a username.\", Toast.LENGTH_SHORT).show();\n } else if (password1.length() == 0) {\n Toast.makeText(getApplicationContext(), \"Please enter a password.\", Toast.LENGTH_SHORT).show();\n } else if (!validatePassword(password1, password2)) {\n Toast.makeText(getApplicationContext(), \"Passwords do not match, try again.\", Toast.LENGTH_SHORT).show();\n } else if (!passwordLongEnough(password1)) {\n Toast.makeText(getApplicationContext(), \"Password too short - must be minimum 8 characters.\", Toast.LENGTH_SHORT).show();\n } else try {\n if (emailAlreadyExists(email)) {\n Toast.makeText(getApplicationContext(), \"Account already exists with this email.\", Toast.LENGTH_SHORT).show();\n } else if (!validateEmail(email)) {\n Toast.makeText(getApplicationContext(), \"Please enter a valid email.\", Toast.LENGTH_SHORT).show();\n } else try {\n if (!usernameAvailable(username)) {\n Toast.makeText(getApplicationContext(), \"Sorry, username already taken.\", Toast.LENGTH_SHORT).show();\n } else {\n // setup a user object with the given attributes, save and enter the app\n final TipperUser user = new TipperUser();\n user.setUsername(username);\n\n // hash password with salt\n String hashed = BCrypt.hashpw(password1, BCrypt.gensalt());\n user.setPassword(hashed);\n\n user.setEmail(email);\n user.setGoogleUser(false);\n user.setFacebookUser(false);\n user.setUuidString();\n\n user.save();\n app.setCurrentUser(user);\n user.pinInBackground();\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(intent);\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n\n saveUser save = new saveUser(registerEmailString, registerPassword);\n FirebaseDatabase.getInstance().getReference(\"Register\").child(FirebaseAuth.\n getInstance().getCurrentUser().getUid()).setValue(save).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n\n if (task.isSuccessful()) {\n progressDialog.dismiss();\n Toast.makeText(Sign_Up.this, \"Sign up successful\", Toast.LENGTH_SHORT).show();\n\n pleaseWait.setVisibility(View.GONE);//\n Intent bac = new Intent(Sign_Up.this, Sign_In.class);\n startActivity(bac);\n\n } else {\n progressDialog.dismiss();\n Toast.makeText(Sign_Up.this, \"Email already exist error\", Toast.LENGTH_SHORT).show();\n pleaseWait.setVisibility(View.GONE);\n\n }\n }\n });\n } else {\n progressDialog.dismiss();\n Toast.makeText(Sign_Up.this, \"Error try again\", Toast.LENGTH_SHORT).show();\n pleaseWait.setVisibility(View.GONE);\n }\n }",
"public void onSignUpClick() {\n\t\tString uid = regview.getUsername();\n\t\tString pw = regview.getPassword();\n\t\tString na = regview.getName();\n\t\tString em = regview.getEmail();\n\t\tString text = \"\";\n\t\tif(uid.equals(\"\") || pw.equals(\"\") || na.equals(\"\")|| em.equals(\"\")){\n\t\t\ttext = \"Please fill out all fields!\";\n\t\t} else if(regview.findUser(uid)!=User.NULL_USER){\n\t\t\ttext = \"The username already exsit, please try another one!\";\n\t\t} else {\n\t\t\tregview.addUser(new User(uid,pw,na,em));\n\t\t\tregview.goLoginPage();\n\t\t}\n\t\tregview.setRegisterText(text);\n\t}",
"public void createAccount (String email, String password) {\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if (!task.isSuccessful()) {\n Toast.makeText(Login.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(Login.this, \"Registration Successful\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n //Sign in existing users\n mAuth.signInWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n //Log.d(TAG, \"signInWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n //Log.w(TAG, \"signInWithEmail\", task.getException());\n Toast.makeText(Login.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }",
"public void signUp(UserSignUpRequest userSignUpRequest) {\n apiInterface.signUp(\n userSignUpRequest\n )\n .subscribeOn(Schedulers.io())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(\n new Observer<Response<ResponseBody>>() {\n @Override\n public void onSubscribe(Disposable d) {\n\n }\n\n @Override\n public void onNext(Response<ResponseBody> responseBodyResponse) {\n if (responseBodyResponse.code() == 201) {\n try {\n //noinspection ConstantConditions\n saveUserData(\n new Gson().fromJson(\n responseBodyResponse.body().string(),\n UserData.class\n )\n );\n } catch (IOException e) {\n e.printStackTrace();\n }\n mutableLiveDataSignUpResult.postValue(\n new Event<>(\n new Result(\n Enums.Result.SUCCESS, \"\"\n )\n )\n );\n } else {\n mutableLiveDataSignUpResult.postValue(\n new Event<>(\n new Result(\n Enums.Result.FAIL,\n getErrorMessage(responseBodyResponse.errorBody())\n )\n )\n );\n }\n }\n\n @Override\n public void onError(Throwable e) {\n mutableLiveDataSignUpResult.postValue(\n new Event<>(\n new Result(\n Enums.Result.FAIL,\n getErrorMessage(e)\n )\n )\n );\n }\n\n @Override\n public void onComplete() {\n\n }\n }\n );\n }",
"private void signUpEvt() {\n String emailRegex = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\n // Get User Details\n String fullname = this.view.getWelcomePanel().getSignUpPanel().getFullnameText().getText().trim();\n String email = this.view.getWelcomePanel().getSignUpPanel().getEmailText().getText().trim();\n String password = new String(this.view.getWelcomePanel().getSignUpPanel().getPasswordText().getPassword()).trim();\n\n if (!fullname.equals(\"\") && !email.equals(\"\") && !password.equals(\"\")) {\n if (email.matches(emailRegex)) {\n if (model.getSudokuDB().registerUser(fullname, email, password)) {\n view.getWelcomePanel().getCardLayoutManager().next(view.getWelcomePanel().getSlider());\n // Clear Fields\n view.getWelcomePanel().getSignUpPanel().clear();\n Object[] options = {\"OK\"};\n JOptionPane.showOptionDialog(this, \"Your registration was successful!\\n You can now sign in to your account.\", \"Successful Registration\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n } else {\n Object[] options = {\"Let me try again\"};\n JOptionPane.showOptionDialog(this, \"Your registration was unsuccessful!\\nBe sure not to create a duplicate account.\", \"Unsuccessful Registration\", JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE, null, options, null);\n }\n } else {\n // Email doesn't meet requirement\n Object[] options = {\"I will correct that\"};\n JOptionPane.showOptionDialog(this, \"You must provide a valid email address.\", \"Invalid Email Address\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n } else {\n // Empty Fields\n Object[] options = {\"Alright\"};\n JOptionPane.showOptionDialog(this, \"In order to register, all fields must be filled out.\", \"Empty Fields\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n }",
"private void onSignUpFailed()\n\t{\n\t\tToast.makeText(SignupPersonalActivity.this, \"Signup failed.\",\n\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t_signupButton.setEnabled(true);\n\t}",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n progressBar.setVisibility(View.GONE);\n\n if (!task.isSuccessful()) {\n Toast.makeText(RegisterActivity.this, \"Registration failed, Check your Network Connection!\", Toast.LENGTH_SHORT).show();\n } else {\n onAuthSuccess(task.getResult().getUser());\n //Toast.makeText(RegisterActivity.this, \"we will make pass of login here\", Toast.LENGTH_SHORT).show();\n //finish();\n }\n }",
"public void register(View view) {\n if(radioGroup.getCheckedRadioButtonId() == -1){\n Snackbar.make(getCurrentFocus(),\"Please select one of the Options: Student or Professor\",Snackbar.LENGTH_LONG).show();\n return;\n }\n if (usn.getText().toString().trim().equals(\"\")){\n usn.setError(\"This field cannot be empty\");\n return;\n } else if (password.getText().toString().trim().equals(\"\")){\n password.setError(\"This field cannot be empty\");\n return;\n } else if(password.getText().toString().trim().length() < 8){\n password.setError(\"Password too short.\");\n return;\n } else if(confirmPassword.getText().toString().trim().equals(\"\")){\n confirmPassword.setError(\"This field cannot be empty\");\n return;\n } else if(!(password.getText().toString().trim()\n .equals(confirmPassword.getText().toString().trim()))){\n password.setError(\"Passwords do not match\");\n confirmPassword.setError(\"Passwords do not match\");\n return;\n }\n progressBar.setVisibility(View.VISIBLE);\n mAuth.signInAnonymously().addOnSuccessListener(authResult -> myRef.child(usn.getText().toString().trim()).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n try {\n String username = dataSnapshot.child(\"emailId\").getValue().toString();\n String password = confirmPassword.getText().toString().trim();\n System.out.println(username);\n mAuth.createUserWithEmailAndPassword(username,password)\n .addOnCompleteListener(RegisterActivity.this,task -> {\n Log.d(\"TAG\",\"Created User:\"+task.isSuccessful());\n if(!task.isSuccessful()){\n Toast.makeText(RegisterActivity.this, \"Error occurred.\" +\n \" Could not create user. Please \" +\n \"check your internet connection\", Toast.LENGTH_LONG).show();\n return;\n }\n else {\n startActivity(new Intent(RegisterActivity.this,LoginActivity.class));\n finish();\n }\n });\n\n }catch (NullPointerException e){\n usn.setError(\"Invalid USN. Please check your input or contact\" +\n \" your department for help\");\n progressBar.setVisibility(View.INVISIBLE);\n }\n }\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n }))\n .addOnFailureListener(e -> {\n progressBar.setVisibility(View.INVISIBLE);\n Snackbar.make(view,\"Something went wrong.Please check if you have an internet connection or that the details\" +\n \"entered are valid\",Snackbar.LENGTH_LONG).show();\n });\n }",
"public void UserSignUp(View view)\n {\n // get the data from text fields\n inputName = ((EditText) findViewById(R.id.signUpEditTextName)).getText().toString();\n inputEmail = ((EditText) findViewById(R.id.signUpEditTextEmail)).getText().toString();\n inputPhoneNumber = ((EditText) findViewById(R.id.signUpEditTextPhoneNumber)).getText().toString();\n inputPassword = ((EditText) findViewById(R.id.signUpEditTextPassword)).getText().toString();\n inputRepeatPassword = ((EditText) (findViewById(R.id.signUpEditTextRepeatPassword))).getText().toString();\n\n // If some text fields are empty\n if(inputName.equals(\"\") || inputEmail.equals(\"\") || inputPhoneNumber.equals(\"\")\n || inputPassword.equals(\"\") || inputRepeatPassword.equals(\"\")) {\n Toast.makeText(SignUpActivity.this, \"All fields are required!\", Toast.LENGTH_LONG).show();\n finish();\n startActivity(getIntent());\n }\n // if password and repeat password are matched\n else if(inputPassword.compareTo(inputRepeatPassword) == 0) {\n // if there is internet connection\n if (CheckNetworkConnection.checknetwork(getApplicationContext()))\n new CreateNewUser().execute();\n else\n Toast.makeText(SignUpActivity.this, \"No Internet Connection!\", Toast.LENGTH_LONG).show();\n }\n // if password and repeat password do not matched\n else {\n Toast.makeText(SignUpActivity.this, \"Passwords do not match!\", Toast.LENGTH_LONG).show();\n finish();\n startActivity(getIntent());\n }\n\n }",
"public void onClickSignUp(View view) {\r\n\t\tcheckRegistationValidation();\r\n\t}",
"@Override\n\tpublic void onDidFinished(SYLSignupResponseModel msylsignupresponsemodel) {\n\t\tif (msylProgressDialog != null && msylProgressDialog.isShowing()) {\n\t\t\tmsylProgressDialog.dismiss();\n\t\t}\n\t\ttry {\n\t\tif(msylsignupresponsemodel!=null)\n\t\t{\n\t\t\tif(msylsignupresponsemodel.isSuccess())\n\t\t\t\n\t\t\t{\n\t\t\t\tSYLSaveValues.setSYLusername(\"\", getActivity());\n\t\t\t\tSYLSaveValues.setProfileImageurl(\"\", getActivity());\n\t\t\t\tSYLSaveValues.setSYLusername(msylsignupresponsemodel.getSignupResponse().getName(), getActivity());\n\t\t\t\tSYLSaveValues.setProfileImageurl(msylsignupresponsemodel.getSignupResponse().getProfileImage(), getActivity());\nSYLSaveValues.setSYLEmailAddress(msylsignupresponsemodel.getSignupResponse().getEmail(),getActivity());\n\n\t\t\t getActivity().\t\tgetSupportFragmentManager().beginTransaction()\n\t\t\t\t.replace(R.id.menu_frame, new SYLMenuFragment())\n\t\t\t\t.commit();\n\t\t\t\tif(msylsignupresponsemodel.getSignupResponse().isVerified())\n\t\t\t\t{\n\t\t\t\t\tSYLUtil.buildAlertMessage(getActivity(),\"Profile updated successfully\");\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\t\tbuildAlertMessage(getActivity(), \"Your profile Updated with your changed email.Please enter the verification code which we have send to your\" + msylsignupresponsemodel.getSignupResponse().getEmail()+\"to complete the validation process\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSYLUtil.buildAlertMessage(getActivity(),msylsignupresponsemodel.getError().getErrorDetail());\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tSYLUtil.buildAlertMessage(getActivity(),\"Unexpected server error happened\");\n\t\t}\n\t\t}\n\tcatch(Exception e)\t\n\t{\n\t\tSYLUtil.buildAlertMessage(getActivity(),\"Unexpected server error happened\");\n\t}\n\t}",
"public void signup(View view){\r\n if(editText1.getText().toString().isEmpty()||editText2.getText().toString().isEmpty()||editText3.getText().toString().isEmpty()\r\n ||editText4.getText().toString().isEmpty()||editText5.getText().toString().isEmpty()){\r\n Toast.makeText(this, \"Παρακαλώ εισάγετε όλα τα απαραίτητα πεδία προκειμένου να εγγραφείτε.\", Toast.LENGTH_SHORT).show();\r\n }\r\n else{\r\n mAuth.createUserWithEmailAndPassword(editText1.getText().toString(), editText2.getText().toString())\r\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n\r\n if (task.isSuccessful()) {\r\n new_user = mAuth.getCurrentUser();\r\n create_users_list(new_user.getUid());\r\n String userid=new_user.getUid();\r\n String firstname=editText3.getText().toString();\r\n String lastname=editText4.getText().toString();\r\n String address=editText5.getText().toString();\r\n SharedPreferences.Editor editor=pref.edit();\r\n editor.putString(userid+\"firstname\",firstname);\r\n editor.putString(userid+\"lastname\",lastname);\r\n editor.putString(userid+\"address\",address);\r\n editor.apply();\r\n Intent intent = new Intent(getApplicationContext(), MainActivity3.class);\r\n intent.putExtra(\"userid\", new_user.getUid());\r\n\r\n startActivity(intent);\r\n\r\n\r\n } else {\r\n Toast.makeText(getApplicationContext(), task.getException().getMessage(),\r\n Toast.LENGTH_SHORT).show();\r\n\r\n }\r\n }\r\n }\r\n );}}",
"public void signUpUser(final AuthActivity fromAuthActivity, String email, String password, final String displayName) {\n try {\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(fromAuthActivity, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n // sign in user\n FirebaseUser firebaseUser = mAuth.getCurrentUser();\n User user = new User(firebaseUser);\n loggedInUser = user;\n setUserDisplayName(displayName);\n GameManager.statisticsManager.initUserInDatabase();\n fromAuthActivity.onSignUpSuccess();\n\n } else {\n // If sign in fails, call \"callback\"\n fromAuthActivity.onSignUpError(task.getException());\n }\n }\n });\n } catch (Exception e) {\n fromAuthActivity.onSignUpError(new Exception(\"Something didn't work here :/\"));\n e.printStackTrace();\n }\n }",
"boolean hasSignupRequest();",
"void signUp(SignUpRequest signupRequest);",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n userProfileChangeRequest = new UserProfileChangeRequest.Builder().setDisplayName(name).build();\n firebaseUser = FirebaseAuth.getInstance().getCurrentUser();\n firebaseUser.updateProfile(userProfileChangeRequest);\n UsersInfo user = new UsersInfo(name, phone, mail, \"\");\n database.child(userAuth.getCurrentUser().getUid()).setValue(user);\n userRegister.onRegisterSuccess();\n } else {\n if (task.getException().getMessage().equals(\"The email address is already in use by another account.\")) {\n userRegister.onMailExistedError();\n }\n if (task.getException().getMessage().equals(\"The email address is badly formatted.\")) {\n userRegister.onMailFormatError();\n }\n }\n }",
"@Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(!task.isSuccessful())\r\n {\r\n Toast.makeText(MainActivity.this,\"Some Error Occured,Please try again later\",Toast.LENGTH_LONG).show();\r\n }\r\n if(task.isSuccessful())\r\n {\r\n Toast.makeText(MainActivity.this,\"Regristration Successful\",Toast.LENGTH_LONG).show();\r\n }\r\n }",
"@OnClick(R.id.fragment_register_sign_up_button)\n public void validateSignupInformation() {\n mValidator.validate();\n }",
"private void attemptRegister() {\n progressGenerator = new ProgressGenerator();\n\n // Reset errors.\n inputEmail.setError(null);\n inputPasswd.setError(null);\n\n // Store values at the time of the login attempt.\n String email = inputEmail.getText().toString();\n String password = inputPasswd.getText().toString();\n String confirmPassword = inputConfirmPasswd.getText().toString();\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email)) {\n inputEmail.setError(getString(R.string.error_field_required));\n inputEmail.requestFocus();\n shake();\n return;\n } else if (!isEmailValid(email)) {\n inputEmail.setError(getString(R.string.error_invalid_email));\n inputEmail.requestFocus();\n shake();\n return;\n }\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(password) || !isPasswordValid(password)) {\n inputPasswd.setError(getString(R.string.error_invalid_password));\n inputPasswd.requestFocus();\n shake();\n return;\n }\n\n // Check if passwords match\n if (!confirmPassword.equals(password)) {\n inputConfirmPasswd.setError(getString(R.string.error_password_does_not_match));\n inputConfirmPasswd.requestFocus();\n shake();\n return;\n }\n\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n isRegistering = true;\n btnRegister.requestFocus();\n\n progressGenerator.start(btnRegister);\n btnRegister.setEnabled(false);\n inputEmail.setEnabled(false);\n inputPasswd.setEnabled(false);\n inputConfirmPasswd.setEnabled(false);\n\n LoginAgent.getInstance().registerInBackground(email, password);\n }",
"public void attemptSignUp() {\n\tif (mAuthTask != null) {\n\t return;\n\t}\n\n\t// Reset errors.\n\tmUsernameView.setError(null);\n\tmNameView.setError(null);\n\tmEmailView.setError(null);\n\tmPasswordView.setError(null);\n\n\t// Store values at the time of the login attempt.\n\tmUsername = mUsernameView.getText().toString().trim();\n\tmName = mNameView.getText().toString();\n\tmEmail = mEmailView.getText().toString();\n\tmPassword = mPasswordView.getText().toString();\n\n\tboolean cancel = false;\n\tView focusView = null;\n\n\t// Check for a valid username\n\tif (TextUtils.isEmpty(mUsername)) {\n\t mUsernameView.setError(getString(R.string.error_field_required));\n\t focusView = mUsernameView;\n\t cancel = true;\n\t} else if (TextUtils.split(mUsername, \" \").length > 1) {\n\t mUsernameView.setError(\"Username can not have spaces\");\n\t}\n\n\t// Check for a valid name\n\tif (TextUtils.isEmpty(mName)) {\n\t mNameView.setError(getString(R.string.error_field_required));\n\t focusView = mNameView;\n\t cancel = true;\n\t}\n\n\t// Check for a valid password.\n\tif (TextUtils.isEmpty(mPassword)) {\n\t mPasswordView.setError(getString(R.string.error_field_required));\n\t focusView = mPasswordView;\n\t cancel = true;\n\t} else if (mPassword.length() != 4 || !TextUtils.isDigitsOnly(mPassword)) {\n\t mPasswordView.setError(getString(R.string.error_invalid_password));\n\t focusView = mPasswordView;\n\t cancel = true;\n\t}\n\n\t// Check for a valid email address.\n\tif (TextUtils.isEmpty(mEmail)) {\n\t mEmailView.setError(getString(R.string.error_field_required));\n\t focusView = mEmailView;\n\t cancel = true;\n\t} else if (!mEmail.contains(\"@\")) {\n\t mEmailView.setError(getString(R.string.error_invalid_email));\n\t focusView = mEmailView;\n\t cancel = true;\n\t}\n\n\tif (cancel) {\n\t // There was an error; don't attempt login and focus the first\n\t // form field with an error.\n\t focusView.requestFocus();\n\t} else {\n\t // Show a progress spinner, and kick off a background task to\n\t // perform the user login attempt.\n\t mLoginStatusMessageView.setText(R.string.login_progress_signing_in);\n\t showProgress(true);\n\t mAuthTask = new UserSignUpTask();\n\t mAuthTask.execute((Void) null);\n\t}\n }",
"@Override\n public void onClick(View view) {\n if (validate()) {\n String user_email = create_email.getText().toString().trim();\n String user_password = create_password.getText().toString().trim();\n firebaseAuth.createUserWithEmailAndPassword(user_email, user_password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if (task.isSuccessful()) {\n //sendEmailVerification();\n //sendUserData();\n firebaseAuth.signOut();\n Toast.makeText(CreateNewSurvey.this, \"Successfully Registered, Upload complete!\", Toast.LENGTH_SHORT).show();\n finish();\n startActivity(new Intent(CreateNewSurvey.this, Main2Activity.class));\n } else {\n Toast.makeText(CreateNewSurvey.this, \"Registration Failed\", Toast.LENGTH_SHORT).show();\n }\n\n }\n\n });\n }\n }",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n userModel.setIdUrl(uri.toString());\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(userModel.getEmail(), userModel.getPassword())\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n FirebaseFirestore.getInstance().collection(\"USERS\").add(userModel)\n .addOnCompleteListener(task1 -> {\n if (task1.isSuccessful()) {\n Toast.makeText(RegisterActivity.this, \"Registered Successfully\", Toast.LENGTH_SHORT).show();\n\n Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);\n startActivity(intent);\n } else\n Toast.makeText(RegisterActivity.this, \"\" + task1.getException(), Toast.LENGTH_SHORT).show();\n\n });\n\n } else\n Toast.makeText(RegisterActivity.this, \"\" + task.getException(), Toast.LENGTH_SHORT).show();\n }\n });\n }\n });\n }",
"public void onSignUpFailed() {\n Toast.makeText(this, getString(R.string.account_creation_failed), Toast.LENGTH_LONG).show();\n mSignUpButton.setEnabled(true);\n }",
"@Override\n protected void onPostExecute(Response<Result> resultResponse) {\n if (resultResponse.body().getCodigo()==400) {\n dialog.dismiss();\n activity.onSignupSuccess();\n } else {\n if ((dialog != null) && dialog.isShowing()) {\n dialog.dismiss();\n dialog = null;\n }\n activity.onSignupFailed();\n }\n }",
"private void userRegister(String email, String password)\n {\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>()\n {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task)\n {\n // if successful, send email verification\n String TAG = \"LoginActivity.userRegister\";\n if (task.isSuccessful())\n {\n Log.d(TAG, \"createUserWithEmailAndPassword:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n\n user.sendEmailVerification()\n .addOnCompleteListener(new OnCompleteListener<Void>()\n {\n @Override\n public void onComplete(@NonNull Task<Void> task)\n {\n String TAG = \"LoginActivity.userRegister.EmailVerify\";\n if (task.isSuccessful())\n {\n Log.d(TAG, \"sendEmailVerification:success\");\n Toast.makeText(getActivity(),\n \"Please check Email for Verification\",Toast.LENGTH_SHORT).show();\n }\n else\n {\n Log.w(TAG, \"sendEmailVerification:failure\", task.getException());\n Toast.makeText(getActivity(),\"Unable to Verify: \"\n + task.getException().getMessage(),Toast.LENGTH_SHORT).show();\n\n }\n }\n });\n }\n else\n {\n Log.w(TAG, \"createUserWithEmailAndPassword:failure\", task.getException());\n Toast.makeText(getActivity(), \"Unable to Register: \"\n + task.getException().getMessage(), Toast.LENGTH_SHORT).show();\n }\n }\n });\n }",
"boolean signUp(User user);",
"@Override\n\tpublic void onSignInSucceeded() {\n\n\t}",
"@FXML protected void handleSignUpButtonAction() {\n \tboolean bexit = false;\n \tif(passwordField.getText().equals(passwordField2.getText()))\n \t{\n \t\t\n \t\tString signUpUsername = username.getText();\n \t\tString signUpPassword = passwordField.getText();\n \t\t\n if(username.getText().toString().length() >= 6 && passwordField.getText().toString().length() >= 6)\n {\n\t \t\tUser user = new User(signUpUsername, \"Unknown\", null, \"Unknown\", signUpPassword);\n\t \t\t\n\t \t\ttry {\n\t\t\t\t\tuser = client.createUser(user);\n\t \t\t\n\t \t\t} catch (WebApplicationException e) {\n\t \t\t\tLOGGER.log(Level.SEVERE, e.toString(), e);\n\t \t\t\tif (e.getResponse().getStatus() == 409) {\n\t \t\t\t\tactiontarget.setText(\"Sign up error: Username already exists\");\n\t \t\t\t} else {\n\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t} catch (JsonProcessingException e) {\n\t \t\t\tLOGGER.log(Level.SEVERE, e.toString(), e);\n\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLOGGER.log(Level.SEVERE, e.toString(), e);\n\t\t\t\t}\n\t \t\t\n\t \t\t// Go back to Login view\n\t \t\t\n\t \t\tLoginVistaNavigator.loadVista(LoginVistaNavigator.LOGIN);\n }\n else\n {\n \tactiontarget.setText(\"username/password \\nlength must be 6 number\");\n }\n \t}\n \telse\n \t{\n \t\tactiontarget.setText(\"password not consistent.\");\n \t}\n }",
"public void onCreateAccountPressed(View view) {\n\n\n mUserName = mEditTextUsernameCreate.getText().toString();\n mUserEmail = mEditTextEmailCreate.getText().toString().toLowerCase();\n mPassword = mEditTextPasswordCreate.getText().toString();\n\n /**\n * Check that email and user name are okay\n */\n boolean validEmail = isEmailValid(mUserEmail);\n boolean validUserName = isUserNameValid(mUserName);\n boolean validPassword = isPasswordValid(mPassword);\n if (!validEmail || !validUserName || !validPassword) return;\n /**\n * If everything was valid show the progress dialog to indicate that\n * account creation has started\n */\n mAuthProgressDialog.show();\n\n\n // [START create_user_with_email]\n mAuth.createUserWithEmailAndPassword(mUserEmail, mPassword)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(LOG_TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n Toast.makeText(CreateAccountActivity.this, R.string.auth_failed,\n Toast.LENGTH_SHORT).show();//error message\n //showErrorToast(\"createUserWithEmail : \"+task.isSuccessful());\n }\n\n // [START_EXCLUDE]\n mAuthProgressDialog.dismiss();\n Intent intent = new Intent(CreateAccountActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n // [END_EXCLUDE]\n //end\n }\n });\n // [END create_user_with_email]\n\n\n\n /**\n * Create new user with specified email and password\n */\n /*mFirebaseRef.createUser(mUserEmail, mPassword, new Firebase.ValueResultHandler<Map<String, Object>>() {\n @Override\n public void onSuccess(Map<String, Object> result) {\n Dismiss the progress dialog\n mAuthProgressDialog.dismiss();\n Log.i(LOG_TAG, getString(R.string.log_message_auth_successful));\n }\n\n @Override\n public void onError(FirebaseError firebaseError) {\n *//* Error occurred, log the error and dismiss the progress dialog *//*\n Log.d(LOG_TAG, getString(R.string.log_error_occurred) +\n firebaseError);\n mAuthProgressDialog.dismiss();\n *//* Display the appropriate error message *//*\n if (firebaseError.getCode() == FirebaseError.EMAIL_TAKEN) {\n mEditTextEmailCreate.setError(getString(R.string.error_email_taken));\n } else {\n showErrorToast(firebaseError.getMessage());\n }\n\n }\n });*/\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (!(API.isInternetOn(Register.this))) {\r\n\t\t\t\t\tshowAlert(\"Internet not avialble.\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprogressdialog.setMessage(\"Please wait...\");\r\n\t\t\t\t\tprogressdialog.show();\r\n\t\t\t\t\t// Force user to fill up the form\r\n\t\t\t\t\tif (username.getText().toString().equals(\"\")\r\n\t\t\t\t\t\t\t|| email.getText().toString().equals(\"\")\r\n\t\t\t\t\t\t\t|| password.getText().toString().equals(\"\")\r\n\t\t\t\t\t\t\t|| verifyPassword.getText().toString().equals(\"\")) {\r\n\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\tshowAlert(\"Please complete the sign up form.\");\r\n\t\t\t\t\t} else if (!(isValidEmail(email.getText().toString()))) {\r\n\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\tshowAlert(\"Please enter valid email id.\");\r\n\t\t\t\t\t} else if (!(password.getText().toString()\r\n\t\t\t\t\t\t\t.equals(verifyPassword.getText().toString()))) {\r\n\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\tshowAlert(\"Password did not matched\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Save new user data into Parse.com Data Storage\r\n\t\t\t\t\t\tParseUser user = new ParseUser();\r\n\t\t\t\t\t\tuser.setUsername(username.getText().toString());\r\n\t\t\t\t\t\tuser.setPassword(password.getText().toString());\r\n\t\t\t\t\t\tuser.setEmail(email.getText().toString());\r\n\t\t\t\t\t\tuser.signUpInBackground(new SignUpCallback() {\r\n\t\t\t\t\t\t\tpublic void done(ParseException e) {\r\n\t\t\t\t\t\t\t\tif (e == null) {\r\n\t\t\t\t\t\t\t\t\tAllowUserToLogin(username.getText()\r\n\t\t\t\t\t\t\t\t\t\t\t.toString(), password.getText()\r\n\t\t\t\t\t\t\t\t\t\t\t.toString());\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\t\t\t\t\t\t\"Sign up Error\", Toast.LENGTH_LONG)\r\n\t\t\t\t\t\t\t\t\t\t\t.show();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n //delete user just created\n user.delete();\n //prompt user to create account\n Toast.makeText(MainActivity.this, \"No Email Exist \", Toast.LENGTH_SHORT).show();\n Toast.makeText(MainActivity.this, \"Create New Account \", Toast.LENGTH_SHORT).show();\n } else {\n // if failed, email already exist and move on to verify passoword\n //Toast.makeText(MainActivity.this, \"Loggin In\", Toast.LENGTH_SHORT).show();\n sentReset(finalInputUsername);\n }\n }",
"@Override\n public void onComplete(@NonNull Task<Void> task) {\n\n if(task.isSuccessful()){\n Toast.makeText(RegistrationActivity.this, \"User has been registered successfully!\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n\n //Then redirect to login layout\n } else {\n Toast.makeText(RegistrationActivity.this,\"Failed to register. Try again.\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n }\n\n }",
"public void signup(){\n\t\tboolean result = SignUpForm.display(\"Chocolate Chiptunes - Sign Up\", \"Sign-Up Form\");\n\t\tSystem.out.println(result);\n\t}",
"public interface OnSignUpFinishedListener {\n void userNameError();\n void passwordError();\n void mailError();\n void exitoOperacion(String preferencia, String sesion);\n}",
"private void sign_up() {\n final String name = nameET.getText().toString().trim();\n final String cell = cellET.getText().toString().trim();\n final String division = divisionET.getText().toString().trim();\n final String address = addressEt.getText().toString().trim();\n final String password = passwordET.getText().toString().trim();\n final String account_type = accouttypeET.getText().toString().trim();\n final String status=\"Pending\";\n\n\n //Checking field/validation\n if (name.isEmpty()) {\n nameET.setError(\"Please enter name !\");\n requestFocus(nameET);\n }\n else if (cell.length()!=11) {\n\n cellET.setError(\"Please enter valid phone number !\");\n requestFocus(cellET);\n\n }\n\n else if (division.isEmpty()) {\n\n divisionET.setError(\"Please select division !\");\n requestFocus(divisionET);\n Toasty.error(this, \"Please select division !\", Toast.LENGTH_SHORT).show();\n }\n else if (address.isEmpty()) {\n\n addressEt.setError(\"Please enter full address !\");\n requestFocus(addressEt);\n }\n else if (account_type.isEmpty()) {\n\n accouttypeET.setError(\"Please select account type !\");\n requestFocus(accouttypeET);\n Toasty.error(this, \"Please select account type !\", Toast.LENGTH_SHORT).show();\n }\n else if (password.isEmpty()) {\n\n passwordET.setError(\"Please enter password !\");\n requestFocus(passwordET);\n }\n else if (password.length() < 4) {\n\n passwordET.setError(\"Password should be more than 3 characters!\");\n requestFocus(passwordET);\n }\n\n else\n {\n loading = new ProgressDialog(this);\n loading.setIcon(R.drawable.wait_icon);\n loading.setTitle(\"Sign up\");\n loading.setMessage(\"Please wait....\");\n loading.show();\n\n\n StringRequest stringRequest=new StringRequest(Request.Method.POST, Constant.SIGNUP_URL, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n //for track response in logcat\n Log.d(\"RESPONSE\", response);\n\n if (response.equals(\"success\")) {\n loading.dismiss();\n Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);\n Toasty.success(RegisterActivity.this, \"Registration successful\", Toast.LENGTH_SHORT).show();\n startActivity(intent);\n } else if (response.equals(\"exists\")) {\n\n Toasty.warning(RegisterActivity.this, \"User already exists!\", Toast.LENGTH_SHORT).show();\n loading.dismiss();\n\n }\n\n else if (response.equals(\"failure\")) {\n\n Toasty.error(RegisterActivity.this, \"Registration Failed!\", Toast.LENGTH_SHORT).show();\n loading.dismiss();\n\n }\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n Toasty.error(RegisterActivity.this, \"No Internet Connection or \\nThere is an error !!!\", Toast.LENGTH_SHORT).show();\n loading.dismiss();\n }\n }\n\n ){\n @Override\n protected Map<String, String> getParams() throws AuthFailureError {\n Map<String, String> params = new HashMap<>();\n //Adding parameters to request\n\n params.put(Constant.KEY_NAME, name);\n params.put(Constant.KEY_CELL, cell);\n params.put(Constant.KEY_DIV, division);\n params.put(Constant.KEY_ADDRESS, address);\n params.put(Constant.KEY_AC_TYPE, account_type);\n params.put(Constant.KEY_PASSWORD, password);\n params.put(Constant.KEY_STATUS, status);\n\n Log.d(\"url_info\",Constant.SIGNUP_URL);\n\n //returning parameter\n return params;\n }\n };\n\n //Adding the string request to the queue\n RequestQueue requestQueue = Volley.newRequestQueue(this);\n requestQueue.add(stringRequest);\n }\n }",
"private void RegisterGoogleSignup() {\n\n\t\ttry {\n\t\t\tLocalData data = new LocalData(SplashActivity.this);\n\n\t\t\tArrayList<String> asName = new ArrayList<String>();\n\t\t\tArrayList<String> asValue = new ArrayList<String>();\n\n\t\t\tasName.add(\"email\");\n\t\t\tasName.add(\"firstname\");\n\t\t\tasName.add(\"gender\");\n\t\t\tasName.add(\"id\");\n\t\t\tasName.add(\"lastname\");\n\t\t\tasName.add(\"name\");\n\t\t\t// asName.add(\"link\");\n\n\t\t\tasName.add(\"device_type\");\n\t\t\tasName.add(\"device_id\");\n\t\t\tasName.add(\"gcm_id\");\n\t\t\tasName.add(\"timezone\");\n\n\t\t\tasValue.add(data.GetS(LocalData.EMAIL));\n\t\t\tasValue.add(data.GetS(LocalData.FIRST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.GENDER));\n\t\t\tasValue.add(data.GetS(LocalData.ID));\n\t\t\tasValue.add(data.GetS(LocalData.LAST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.NAME));\n\t\t\t// asValue.add(data.GetS(LocalData.LINK));\n\n\t\t\tasValue.add(\"A\");\n\n\t\t\tString android_id = Secure\n\t\t\t\t\t.getString(SplashActivity.this.getContentResolver(),\n\t\t\t\t\t\t\tSecure.ANDROID_ID);\n\n\t\t\tasValue.add(android_id);\n\n\t\t\tLocalData data1 = new LocalData(SplashActivity.this);\n\t\t\tasValue.add(data1.GetS(\"gcmId\"));\n\t\t\tasValue.add(Main.GetTimeZone());\n\t\t\tString sURL = StringURLs.getQuery(StringURLs.GOOGLE_LOGIN, asName,\n\t\t\t\t\tasValue);\n\n\t\t\tConnectServer connectServer = new ConnectServer();\n\t\t\tconnectServer.setMode(ConnectServer.MODE_POST);\n\t\t\tconnectServer.setContext(SplashActivity.this);\n\t\t\tconnectServer.setListener(new ConnectServerListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onServerResponse(String sJSON, JSONObject jsonObject) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t\tLog.d(\"JSON DATA\", sJSON);\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tif (sJSON.length() != 0) {\n\t\t\t\t\t\t\tJSONObject object = new JSONObject(sJSON);\n\t\t\t\t\t\t\tJSONObject response = object\n\t\t\t\t\t\t\t\t\t.getJSONObject(JSONStrings.JSON_RESPONSE);\n\t\t\t\t\t\t\tString sResult = response\n\t\t\t\t\t\t\t\t\t.getString(JSONStrings.JSON_SUCCESS);\n\n\t\t\t\t\t\t\tif (sResult.equalsIgnoreCase(\"1\") == true) {\n\n\t\t\t\t\t\t\t\tString user_id = response.getString(\"userid\");\n\n\t\t\t\t\t\t\t\tLocalData data = new LocalData(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this);\n\t\t\t\t\t\t\t\tdata.Update(\"userid\", user_id);\n\t\t\t\t\t\t\t\tdata.Update(\"name\", response.getString(\"name\"));\n\n\t\t\t\t\t\t\t\tGetNotificationCount();\n\n\t\t\t\t\t\t\t} else if (sResult.equalsIgnoreCase(\"0\") == true) {\n\n\t\t\t\t\t\t\t\tString msgcode = jsonObject.getJSONObject(\n\t\t\t\t\t\t\t\t\t\t\"response\").getString(\"msgcode\");\n\n\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, msgcode),\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (Exception exp) {\n\n\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconnectServer.execute(sURL);\n\n\t\t} catch (Exception exp) {\n\n\t\t\tToast.makeText(SplashActivity.this,\n\t\t\t\t\tMain.getStringResourceByName(SplashActivity.this, \"c100\"),\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t}\n\t}",
"private void doSignup(RoutingContext ctx){\n // Get Data from view\n JsonObject req = ctx.getBodyAsJson();\n String username = req.getString(\"username\");\n String password = req.getString(\"password\");\n\n GoogleAuthenticator authenticator = new GoogleAuthenticator();\n\n //Get Generate Key\n System.out.println(\" Calling Google Authenticator to generate AuthKey\");\n GoogleAuthenticatorKey authKey = authenticator.createCredentials();\n String key = authKey.getKey();\n System.out.println(\" Google Authenticator generated AuthKey\");\n\n //Store Data from Repository\n User user = new User(username,password,key);\n\n //send response to the user\n JsonObject res = new JsonObject().put(\"key\",key);\n ctx.response().setStatusCode(200).end(res.encode());\n }",
"private void attemptRegistration() {\n emailView.setError(null);\n passwordView.setError(null);\n\n // Store values at the time of the login attempt.\n String email = emailView.getText().toString();\n String password = passwordView.getText().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(password) || !isPasswordValid(password)) {\n passwordView.setError(getString(R.string.error_invalid_password));\n focusView = passwordView;\n cancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email)) {\n emailView.setError(getString(R.string.error_field_required));\n focusView = emailView;\n cancel = true;\n } else if (!isEmailValid(email)) {\n emailView.setError(getString(R.string.error_invalid_email));\n focusView = emailView;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n createFirebaseUser();\n\n }\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n Users user = new Users();\n user.setEmail(inputEmail.getText().toString());\n user.setName(inputName.getText().toString());\n user.setPhone(inputPhoneNumber.getText().toString());\n user.setPassword(inputPassword.getText().toString());\n\n users.child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Snackbar.make(relativeLayoutsignup,\"SignUp Successfully\",Snackbar.LENGTH_SHORT)\n .show();\n\n startActivity(new Intent(SignUpActivity.this,SignInActivity.class));\n finish();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Snackbar.make(relativeLayoutsignup,\"Failed\"+e.getMessage(),Snackbar.LENGTH_SHORT)\n .show();\n }\n });\n }",
"@OnClick(R.id.register_email_register_button)\n void onClickRegister(){\n if(isInfoValidate()){\n //Call Register Http, first put the information into bundle\n// Bundle bundle = new Bundle();\n// bundle.putString(Constant.REGISTER_PHONE_NUM, mEmailAddress.getText().toString());\n// bundle.putString(Constant.REGISTER_PASSWORD, mPassword.getText().toString());\n// bundle.putInt(Constant.REGISTER_REGION, mRegionSpinner.getSelectedItemPosition());\n//\n// callRegisterHttp(mEmailAddress.getText().toString(),\n// mRegionSpinner.getSelectedItemPosition(),\n// bundle);\n\n //\n\n\n JSONObject jsonParams = new JSONObject();\n JSONObject outerJsonParams = new JSONObject();\n try {\n// jsonParams.put(\"username\", \"michael_firebasechat_1\");\n // String userNameString = mEmailAddress.getText().toString().split(\"@\")[0];\n jsonParams.put(\"username\", mUsername.getText().toString());\n jsonParams.put(\"email\", mEmailAddress.getText().toString());\n jsonParams.put(\"password\", mPassword.getText().toString());\n outerJsonParams.put(\"user\",jsonParams);\n StringEntity entity = new StringEntity(outerJsonParams.toString());\n callRegisterByEmailHttp(entity);\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n }\n else {\n //Show the warning text\n new SweetAlertDialog(getContext(), SweetAlertDialog.WARNING_TYPE)\n .setTitleText(getString(R.string.warning_title))\n .setContentText(errorText)\n .setConfirmText(getString(R.string.warning_confirm))\n .show();\n }\n }",
"@Override\n public void onSignInSucceeded() {\n\n if (ACCESS_ACHIEVEMENT) {\n\n //if we just came from achievements button and are now signed in, display ui\n displayAchievementUI();\n\n //flag back false\n ACCESS_ACHIEVEMENT = false;\n }\n\n //don't bypass auto login\n BYPASS_LOGIN = false;\n }",
"private void attemptSignUp() {\n // Reset errors.\n mName.setError(null);\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(mName.getText().toString())) {\n mName.setError(getString(R.string.error_field_required));\n focusView = mName;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n SQLiteDatabase database = DBHelper.getInstance(this).getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(DBHelper.U_NAME, mName.getText().toString());\n values.put(DBHelper.U_EMAIL, email);\n values.put(DBHelper.U_IMAGE, profileImage);\n values.put(DBHelper.U_PASSWORD, password);\n database.insert(DBHelper.TUSER, null, values);\n database.close();\n\n UserModel userData = new UserModel();\n userData.setId(0);\n userData.setName(mName.getText().toString());\n userData.setImage(profileImage);\n userData.setEmail(email);\n userData.setPassword(password);\n userData.setRememberMe(rememberMe);\n String userDataStr = new Gson().toJson(userData);\n Common.saveStrPref(this, Common.PREF_USER, userDataStr);\n\n startActivity(new Intent(this, HomeActivity.class));\n }\n }",
"public void onCreateAccountPressed(final View view) throws FirebaseAuthUserCollisionException{\n username=mEditTextUsernameCreate.getText().toString();\n email=mEditTextEmailCreate.getText().toString();\n password=mEditTextPasswordCreate.getText().toString();\n\n if(!isEmailValid(email) || !isUserNameValid(username) || !isPasswordValid(password)){\n return;\n }\n mAuthProgressDialog.show();\n final FirebaseAuth auth=FirebaseAuth.getInstance();\n final DatabaseReference ref=mReference.child(Constants.FIREBASE_LOCATION_USER_ACCOUNTS).child(Utils.encodeEmail(email));\n auth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if (task.isSuccessful()){\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n mAuthProgressDialog.dismiss();\n ref.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.getValue()==null){\n User user=new User(username, email);\n ref.setValue(user);\n }\n else {\n showErrorToast(getResources().getString(R.string.error_email_taken));\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n Log.e(LOG_TAG, databaseError.getMessage());\n }\n });\n onSignInPressed(view);\n\n }\n else {\n mAuthProgressDialog.dismiss();\n Log.d(TAG, \"createUserWithEmail:onFailure:\" + task.getException());\n showErrorToast(task.getException().getMessage());\n\n }\n }\n\n\n });\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n\n Toast.makeText(RegistroActivity.this,\"Se ha registrado el usuario con el email: \"+ TextEmail.getText(),Toast.LENGTH_LONG).show();\n Intent intent = new Intent(RegistroActivity.this, LoginActivity.class);\n startActivity(intent);\n }\n else{\n if (task.getException() instanceof FirebaseAuthUserCollisionException) {//si se presenta una colisión\n Toast.makeText(RegistroActivity.this, \"Ese usuario ya existe \", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(RegistroActivity.this, \"No se pudo registrar el usuario \", Toast.LENGTH_LONG).show();\n }\n }\n progressDialog.dismiss();\n }",
"public void signUp() throws ExecutionException, InterruptedException {\n if (mAuthTask != null) {\n return;\n }\n\n // Reset errors.\n mPasswordView.setError(null);\n usernameView.setError(null);\n lname.setError(null);\n mEmailView.setError(null);\n cPassword.setError(null);\n age.setError(null);\n fname.setError(null);\n\n // Store values at the time of the login attempt.\n String username = usernameView.getText().toString();\n String password = mPasswordView.getText().toString();\n String email = mEmailView.getText().toString();\n String lnameS = lname.getText().toString();\n String fnameS = fname.getText().toString();\n String conPass = cPassword.getText().toString();\n String ageS = age.getText().toString();\n String gender = spinner.getSelectedItem().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n //showProgress(true);\n HashMap<String, String> map = new HashMap<>();\n map.put(\"userName\", username);\n map.put(\"pass\", password);\n map.put(\"age\", ageS);\n map.put(\"email\", email);\n map.put(\"fName\", fnameS);\n map.put(\"lName\", lnameS);\n map.put(\"sex\", gender);\n map.put(\"cPass\", conPass);\n\n mAuthTask = new httpUrlConn(map, \"http://hive.sewanee.edu/evansdb0/android1/scripts/hotPartySignUp.php\");\n\n mAuthTask.execute();\n // if php inserted credentials into the database\n Log.i(\"mAuthTask.get is:\", mAuthTask.get());\n try {\n // if the user succesfully logged in\n if(mAuthTask.get().contains(\"true\")) {\n String r = mAuthTask.get().replace(\"true // \",\"\");\n // tell them they are registered\n Toast.makeText(getApplicationContext(),r,Toast.LENGTH_SHORT).show();\n Intent i = new Intent(this,loginActivity2.class);\n // take them back to log in part of this activity\n startActivity(i);\n\n }\n else {\n String[] resp = response.split(\",\");\n for(String i: resp)\n Toast.makeText(getApplicationContext(),i,Toast.LENGTH_SHORT).show();\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n if(mAuthTask == null || mAuthTask.getStatus().equals(AsyncTask.Status.FINISHED))\n mAuthTask = null;\n }\n }",
"Task<Void> signUp(String email, String password);",
"public void onSignUpClicked() {\n loginView.startSignUpActivity();\n loginView.finishActivity();\n }",
"private void SignUp(String email, String password) {\n if (TextUtils.isEmpty(email) || TextUtils.isEmpty(password) ) {\n\n }else {\n msignInDialog.setTitle(\"Creating New User\");\n msignInDialog.setMessage(\"Please wait while DevChat creates your new Account...\");\n msignInDialog.setCanceledOnTouchOutside(false);\n msignInDialog.show();\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(ActivityRegister.this, \"User Account Created!\", Toast.LENGTH_SHORT).show();\n createUser(et_username.getText().toString());\n msignInDialog.dismiss();\n Intent chatBoxIntent = new Intent(ActivityRegister.this, Chatbox_Activity.class);\n Bundle bundle = new Bundle();\n bundle.putStringArray(\"values\", values);\n chatBoxIntent.putExtras(bundle);\n startActivity(chatBoxIntent);\n } else {\n msignInDialog.dismiss();\n Toast.makeText(ActivityRegister.this, \"Error Creating New User Account!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n }",
"void signUpAttempt(String email, String password, String firstName, String lastName);",
"@SuppressLint(\"StaticFieldLeak\")\n @Override\n public void onClick(final View view) {\n String userName = txtUsername.getText().toString();\n String password = txtPassword.getText().toString();\n String firstName = txtFirstName.getText().toString();\n String lastName = txtLastName.getText().toString();\n String phoneNumber = txtPhoneNumber.getText().toString();\n\n // Check that all fields aren't empty.\n if(isParamsEmpty(userName, password, firstName, lastName, phoneNumber)){\n Toast.makeText(getContext(), \"All fields are required!\", Toast.LENGTH_SHORT).show();\n return;\n }\n if(listener != null) {\n // Lock the button.\n btnSignUp.setEnabled(false);\n btnSignUp.setText(R.string.wait_message);\n\n // Check if username not taken.\n new AsyncTask<User, Void, Boolean>(){\n User user;\n\n @Override\n protected Boolean doInBackground(User... users) {\n // Save the user.\n user = users[0];\n\n // Connect to server to check if username exist.\n int result = (int) HttpConnection.connection(SIGN_UP, user);\n\n // If exist - return false\n if (result == EXIST)\n return false;\n // If not - return true\n else if (result == SUCCESS)\n return true;\n else\n return null;\n }\n\n @Override\n protected void onPostExecute(Boolean success) {\n // Enable the button.\n btnSignUp.setEnabled(true);\n btnSignUp.setText(R.string.sign_up);\n\n // New username - Log in the user.\n if (success == null){\n listener.onSignUp(null);\n }\n else if (success){\n // Send back user details.\n listener.onSignUp(user);\n dismiss();\n }else{\n Vibrator vibrator = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE);\n vibrator.vibrate(500);\n Toast.makeText(getContext(), \"Username already exist!\", Toast.LENGTH_SHORT).show();\n }\n }\n }.execute(new User(userName, password, firstName, lastName, phoneNumber));\n }\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n //delete user just created\n user.delete();\n //prompt user to create account\n Toast.makeText(MainActivity.this, \"No Email Exist \", Toast.LENGTH_SHORT).show();\n Toast.makeText(MainActivity.this, \"Create New Account \", Toast.LENGTH_SHORT).show();\n } else {\n // if failed, email already exist and move on to verify passoword\n //Toast.makeText(MainActivity.this, \"Loggin In\", Toast.LENGTH_SHORT).show();\n signUserIn(emailX);\n }\n\n }",
"@Override\n\t\t\tpublic void onCompleted(final GraphUser user, Response response) {\n\t\t\t\tif (session == Session.getActiveSession()) {\n\t\t\t\t\tif (user != null) {\n\t\t\t\t\t\tToast.makeText(getBaseContext(), \"Hello \"+user.getName()+\"!\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t\tParseClass p = new ParseClass(getBaseContext());\n\t\t\t\t\t\tp.Signup(user,user.getProperty(\"email\").toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (response.getError() != null) {\n\n\t\t\t\t\tToast.makeText(getBaseContext(), \"Error with connection\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void onSuccess(UserProfile result) {\n\t\t\t\t\t\tuserAuthenticated();\r\n\t\t\t\t\t}",
"@Override\n public void onSuccess(AuthResult authResult) {\n if(!mAuth.getCurrentUser().isEmailVerified()){\n PopupEmailVerification popupEmailVerification = new PopupEmailVerification(StartPage.this);\n popupEmailVerification.show();\n }\n else{\n //User found & ready for next page\n Toast.makeText(StartPage.this, \"Sign in successful\", Toast.LENGTH_LONG).show();\n startActivity(new Intent(StartPage.this, CenterPage.class));\n finish();\n }\n\n }",
"private void userSignUp(final int id, String agentNm, String fName, String sta, String localG, String tow, String phoneNm, String fmMr, String cbRg, String memSiz, String cggNam, String cFarmZz, String fcRg, String inFarm, String riceVarr, String qttyHarr, String afRg,\n String fertTldd, String noRzz, String qtyApll, String alRg, String szLoaa, String srcRicc, String qtyPdyRicc, String majByrss, String comSolcc, String qttyByy, String howMcc, String prcBb, String incDs,\n String reasnn, String hwSpyy, String stRg, String ysSptrr, String fm1, String t11, String cstCs11, String fm2, String t22, String cstCs22, String fm3, String t33, String cstCs33, String infPrcc, String salesDmm,\n String avgQtFcc, String whnCp, String whyCp, String whnEx, String whyExx, String mjCh, String adCh, String timSe, String othSe, String adInn) {\n Call<ResponseBody> call = RetrofitClient2\n .getInstance()\n .getNaSurvey()\n .submitResponse(agentNm, fName, sta, localG, tow, phoneNm, fmMr, cbRg, memSiz, cggNam, cFarmZz, fcRg, inFarm, riceVarr, qttyHarr, afRg, fertTldd, noRzz, qtyApll, alRg, szLoaa, srcRicc, qtyPdyRicc, majByrss, comSolcc, qttyByy, howMcc, prcBb, incDs, reasnn, hwSpyy, stRg, ysSptrr, fm1, t11, cstCs11,\n fm2, t22, cstCs22, fm3, t33, cstCs33, infPrcc, salesDmm, avgQtFcc, whnCp, whyCp, whnEx, whyExx, mjCh, adCh, timSe, othSe, adInn);\n\n call.enqueue(new Callback<ResponseBody>() {\n @Override\n public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {\n\n try {\n JSONObject obj = new JSONObject(String.valueOf(response));\n if (!obj.getBoolean(\"error\")) {\n //updating the status in sqlite\n db.updateNameStatus(id, SurveyActivity.SYNC_STATUS_OK);\n\n //sending the broadcast to refresh the list\n context.sendBroadcast(new Intent(SurveyActivity.DATA_SAVED_BROADCAST));\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n Map<String, String> params = new HashMap<>();\n params.put(\"agentNm\", agentNm);\n params.put(\"fname\", fName);\n params.put(\"state\", sta);\n params.put(\"lga\", localG);\n params.put(\"town\", tow);\n params.put(\"phoneNm\", phoneNm);\n params.put(\"farmer\", fmMr);\n params.put(\"cogp\", cbRg);\n params.put(\"memsz\", memSiz);\n params.put(\"cgnam\", cggNam);\n params.put(\"cofmsz\", cFarmZz);\n params.put(\"frmcol\", fcRg);\n params.put(\"invfz\", inFarm);\n params.put(\"ricev\", riceVarr);\n params.put(\"qtyhv\", qttyHarr);\n params.put(\"apfert\", afRg);\n params.put(\"ysyld\", fertTldd);\n params.put(\"norz\", noRzz);\n params.put(\"qtyap\", qtyApll);\n params.put(\"aploa\", alRg);\n params.put(\"szloa\", szLoaa);\n params.put(\"srcric\", srcRicc);\n params.put(\"qtypdrc\", qtyPdyRicc);\n params.put(\"majby\", majByrss);\n params.put(\"comso\", comSolcc);\n params.put(\"qtby\", qttyByy);\n params.put(\"hwmch\", howMcc);\n params.put(\"pricbf\", prcBb);\n params.put(\"indcr\", incDs);\n params.put(\"rsn\", reasnn);\n params.put(\"hwspl\", hwSpyy);\n params.put(\"chsp\", stRg);\n params.put(\"yssptr\", ysSptrr);\n params.put(\"frm1\", fm1);\n params.put(\"to1\", t11);\n params.put(\"costc1\", cstCs11);\n params.put(\"frm2\", fm2);\n params.put(\"to2\", t22);\n params.put(\"costcs2\", cstCs22);\n params.put(\"frm3\", fm3);\n params.put(\"to3\", t33);\n params.put(\"costcs3\", cstCs33);\n params.put(\"infpr\", infPrcc);\n params.put(\"salsdm\", salesDmm);\n params.put(\"avqtf\", avgQtFcc);\n params.put(\"wncp\", whnCp);\n params.put(\"wycp\", whyCp);\n params.put(\"wnex\", whnEx);\n params.put(\"wyex\", whyExx);\n params.put(\"majch\", mjCh);\n params.put(\"addch\", adCh);\n params.put(\"timsl\",timSe);\n params.put(\"othsl\",othSe);\n params.put(\"adin\",adInn);\n\n return;\n }\n });\n\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n //check password and username before proceeding to login page\n Intent intent = new Intent(MainActivity.this, LoginSuccessActivity.class);\n intent.putExtra(\"USERNAME\", inputUsername);\n intent.putExtra(\"PASSWORD\", inputPassword);\n startTrackerService();\n startActivityForResult(intent, 1);\n } else {\n // password does not match email\n Toast.makeText(MainActivity.this, \"Invalid Password\", Toast.LENGTH_SHORT).show();\n }\n\n }"
] | [
"0.749818",
"0.7450446",
"0.72251976",
"0.7110287",
"0.71000487",
"0.70153224",
"0.69603664",
"0.69242877",
"0.69216275",
"0.69216275",
"0.69216275",
"0.69216275",
"0.69216275",
"0.69216275",
"0.69216275",
"0.682155",
"0.68199736",
"0.67964095",
"0.6788328",
"0.67731184",
"0.6760961",
"0.67412454",
"0.6724432",
"0.6702761",
"0.6689517",
"0.66227275",
"0.65999144",
"0.65946484",
"0.65941495",
"0.6570705",
"0.65704256",
"0.65463465",
"0.6519259",
"0.6494989",
"0.649099",
"0.6475846",
"0.64600486",
"0.6446599",
"0.64225703",
"0.6417737",
"0.64092255",
"0.6407461",
"0.6400479",
"0.63996637",
"0.6377295",
"0.6363325",
"0.6351159",
"0.6350235",
"0.6343461",
"0.63367605",
"0.633371",
"0.63238645",
"0.63018566",
"0.6299093",
"0.6275767",
"0.62705725",
"0.62700254",
"0.6267739",
"0.62571216",
"0.62554055",
"0.6251714",
"0.6238528",
"0.62298584",
"0.6226984",
"0.62091964",
"0.61881846",
"0.6185948",
"0.61828977",
"0.618262",
"0.6168282",
"0.61678505",
"0.613236",
"0.61228347",
"0.6122088",
"0.6097339",
"0.60945976",
"0.6079358",
"0.6072545",
"0.6065115",
"0.6063521",
"0.60203356",
"0.6015083",
"0.6003572",
"0.60035515",
"0.60031635",
"0.59974295",
"0.5990976",
"0.59909713",
"0.59852403",
"0.5984024",
"0.59810054",
"0.5971131",
"0.5968507",
"0.59681326",
"0.5949265",
"0.59458065",
"0.5943519",
"0.5939797",
"0.5938854",
"0.59369"
] | 0.67502373 | 21 |
Returns the underlying storage implementation. | OStorage getStorage(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Storage getStorage() {\n return this.storage;\n }",
"@NonNull\n public StorageReference getStorage() {\n return getTask().getStorage();\n }",
"public IStorage getStorage() throws CoreException\n\t{\n\n\t\treturn this.storage;\n\t}",
"public interface DBStorage {\n \n /**\n * Get the name of the storage vendor (DB vendor name)\n *\n * @return name of the storage vendor (DB vendor name)\n */\n String getStorageVendor();\n \n /**\n * Can this storage handle the requested database?\n *\n * @param dbm database meta data\n * @return if storage can handle the requested database\n */\n boolean canHandle(DatabaseMetaData dbm);\n \n /**\n * Get the ContentStorage singleton instance\n *\n * @param mode used storage mode\n * @return ContentStorage singleton instance\n * @throws FxNotFoundException if no implementation was found\n */\n ContentStorage getContentStorage(TypeStorageMode mode) throws FxNotFoundException;\n \n /**\n * Get the EnvironmentLoader singleton instance\n *\n * @return EnvironmentLoader singleton instance\n */\n EnvironmentLoader getEnvironmentLoader();\n \n /**\n * Get the SequencerStorage singleton instance\n *\n * @return SequencerStorage singleton instance\n */\n SequencerStorage getSequencerStorage();\n \n /**\n * Get the TreeStorage singleton instance\n *\n * @return TreeStorage singleton instance\n */\n TreeStorage getTreeStorage();\n \n /**\n * Get the LockStorage singleton instance\n *\n * @return LockStorage singleton instance\n */\n LockStorage getLockStorage();\n \n /**\n * Get a data selector for a sql search\n *\n * @param search current SqlSearch to operate on\n * @return data selector\n * @throws FxSqlSearchException on errors\n */\n DataSelector getDataSelector(SqlSearch search) throws FxSqlSearchException;\n \n /**\n * Get a data filter for a sql search\n *\n * @param con an open and valid connection\n * @param search current SqlSearch to operate on\n * @return DataFilter\n * @throws FxSqlSearchException on errors\n */\n DataFilter getDataFilter(Connection con, SqlSearch search) throws FxSqlSearchException;\n \n /**\n * Get the CMIS SQL Dialect implementation\n *\n * @param environment environment\n * @param contentEngine content engine in use\n * @param query query\n * @param returnPrimitives return primitives?\n * @return CMIS SQL Dialect implementation\n */\n SqlDialect getCmisSqlDialect(FxEnvironment environment, ContentEngine contentEngine, CmisSqlQuery query, boolean returnPrimitives);\n \n /**\n * Get the database vendor specific Boolean expression\n *\n * @param flag the flag to get the expression for\n * @return database vendor specific Boolean expression for <code>flag</code>\n */\n String getBooleanExpression(boolean flag);\n \n /**\n * Get the boolean <code>true</code> expression string for the database vendor\n *\n * @return the boolean <code>true</code> expression string for the database vendor\n */\n String getBooleanTrueExpression();\n \n /**\n * Get the boolean <code>false</code> expression string for the database vendor\n *\n * @return the boolean <code>false</code> expression string for the database vendor\n */\n String getBooleanFalseExpression();\n \n /**\n * Escape reserved words properly if needed\n *\n * @param query the query to escape\n * @return escaped query\n */\n String escapeReservedWords(String query);\n \n /**\n * Get a database vendor specific \"IF\" function\n *\n * @param condition the condition to check\n * @param exprtrue expression if condition is true\n * @param exprfalse expression if condition is false\n * @return database vendor specific \"IF\" function\n */\n String getIfFunction(String condition, String exprtrue, String exprfalse);\n \n /**\n * Get the database vendor specific operator to query regular expressions\n *\n * @param column column to match\n * @param regexp regexp to match the column against\n * @return database vendor specific operator to query regular expressions\n */\n String getRegExpLikeOperator(String column, String regexp);\n \n /**\n * Get the database vendor specific statement to enable or disable referential integrity checks.\n * When in a transaction, be sure to check {@link #isDisableIntegrityTransactional()}\n * since not all databases support this in a transactional context.\n *\n * @param enable enable or disable checks?\n * @return database vendor specific statement to enable or disable referential integrity checks\n */\n String getReferentialIntegrityChecksStatement(boolean enable);\n \n /**\n * Return true if calling {@link #getReferentialIntegrityChecksStatement(boolean)} is possible\n * in a transactional context.\n *\n * @return true if calling {@link #getReferentialIntegrityChecksStatement(boolean)} is possible\n * in a transactional context\n */\n boolean isDisableIntegrityTransactional();\n \n /**\n * Get the sql code of the statement to fix referential integrity when removing selectlist items\n *\n * @return sql code of the statement to fix referential integrity when removing selectlist items\n */\n String getSelectListItemReferenceFixStatement();\n \n /**\n * Get a database vendor specific timestamp of the current time in milliseconds as Long\n *\n * @return database vendor specific timestamp of the current time in milliseconds as Long\n */\n String getTimestampFunction();\n \n /**\n * Get a database vendor specific concat statement\n *\n * @param text array of text to concatenate\n * @return concatenated text statement\n */\n String concat(String... text);\n \n /**\n * Get a database vendor specific concat_ws statement\n *\n * @param delimiter the delimiter to use\n * @param text array of text to concatenate\n * @return concatenated text statement\n */\n String concat_ws(String delimiter, String... text);\n \n /**\n * If a database needs a \" ... from dual\" to generate valid queries, it is returned here\n *\n * @return from dual (or equivalent) if needed\n */\n String getFromDual();\n \n /**\n * Get databas evendor specific limit statement\n *\n * @param hasWhereClause does the query already contain a where clause?\n * @param limit limit\n * @return limit statement\n */\n String getLimit(boolean hasWhereClause, long limit);\n \n /**\n * Get database vendor specific limit/offset statement\n *\n * @param hasWhereClause does the query already contain a where clause?\n * @param limit limit\n * @param offset offset\n * @return limit/offset statement\n */\n String getLimitOffset(boolean hasWhereClause, long limit, long offset);\n \n /**\n * Get database vendor specific limit/offset statement using the specified variable name\n *\n * @param var name of the variable to use\n * @param hasWhereClause does the query already contain a where clause?\n * @param limit limit\n * @param offset offset\n * @return limit/offset statement\n */\n String getLimitOffsetVar(String var, boolean hasWhereClause, long limit, long offset);\n \n /**\n * Get the statement to get the last content change timestamp\n *\n * @param live live version included?\n * @return statement to get the last content change timestamp\n */\n String getLastContentChangeStatement(boolean live);\n \n /**\n * Format a date to be used in a query condition (properly escaped)\n *\n * @param date the date to format\n * @return formatted date\n */\n String formatDateCondition(Date date);\n \n /**\n * Correctly escape a flat storage column if needed\n *\n * @param column name of the column\n * @return escaped column (if needed)\n */\n String escapeFlatStorageColumn(String column);\n \n /**\n * Returns true if the SqlError is a foreign key violation.\n *\n * @param exc the exception\n * @return true if the SqlError is a foreign key violation\n */\n boolean isForeignKeyViolation(Exception exc);\n \n /**\n * Returns true if the given exception was caused by a query timeout.\n *\n * @param e the exception to be examined\n * @return true if the given exception was caused by a query timeout\n * @since 3.1\n */\n boolean isQueryTimeout(Exception e);\n \n /**\n * Does the database rollback a connection if it encounters a constraint violation? (eg Postgres does...)\n *\n * @return database rollbacks a connection if it encounters a constraint violation\n */\n boolean isRollbackOnConstraintViolation();\n \n /**\n * Returns true if the SqlError is a unique constraint violation.\n *\n * @param exc the exception\n * @return true if the SqlError is a unique constraint violation\n */\n boolean isUniqueConstraintViolation(Exception exc);\n \n /**\n * Returns true if the given SqlException indicates a deadlock.\n *\n * @param exc the exception\n * @return true if the given SqlException indicates a deadlock.\n * @since 3.1\n */\n boolean isDeadlock(Exception exc);\n \n /**\n * When accessing the global configuration - does the config table has to be prefixed with the schema?\n * (eg in postgres no schemas are supported for JDBC URL's hence it is not required)\n *\n * @return access to configuration tables require the configuration schema to be prepended\n */\n boolean requiresConfigSchema();\n \n /**\n * Get a connection to the database using provided parameters and (re)create the database and/or schema\n *\n * @param database name of the database\n * @param schema name of the schema\n * @param jdbcURL JDBC connect URL\n * @param jdbcURLParameters optional JDBC URL parameters\n * @param user name of the db user\n * @param password password\n * @param createDB create the database?\n * @param createSchema create the schema?\n * @param dropDBIfExist drop the database if it exists?\n * @return an open connection to the database with the schema set as default\n * @throws Exception on errors\n */\n Connection getConnection(String database, String schema, String jdbcURL, String jdbcURLParameters, String user, String password, boolean createDB, boolean createSchema, boolean dropDBIfExist) throws Exception;\n \n /**\n * Initialize a configuration schema\n *\n * @param con an open and valid connection to the database\n * @param schema the schema to create\n * @param dropIfExist drop the schema if it exists?\n * @return success\n * @throws Exception on errors\n */\n boolean initConfiguration(Connection con, String schema, boolean dropIfExist) throws Exception;\n \n /**\n * Initialize a division\n *\n * @param con an open and valid connection to the database\n * @param schema the schema to create\n * @param dropIfExist drop the schema if it exists?\n * @return success\n * @throws Exception on errors\n */\n boolean initDivision(Connection con, String schema, boolean dropIfExist) throws Exception;\n \n /**\n * Export all data of a division to an OutputStream as ZIP\n *\n * @param con an open and valid connection to the database to be exported\n * @param out OutputStream that will be used to create the zip file\n * @throws Exception on errors\n */\n void exportDivision(Connection con, OutputStream out) throws Exception;\n \n /**\n * Import a complete division from a zip stream\n *\n * @param con an open and valid connection\n * @param zip zip archive that contains an exported divison\n * @throws Exception on errors\n */\n void importDivision(Connection con, ZipFile zip) throws Exception;\n }",
"public StorageUnit beStorageUnit();",
"public com.hps.july.persistence.StoragePlaceAccessBean getStorage() {\n\treturn storage;\n}",
"public DataStorage getDataStorage();",
"public AccountStorage getStore() {\n\t\t@SuppressWarnings(\"resource\")\n\t\tApplicationContext springContext = new AnnotationConfigApplicationContext(AccountServerConfig.class);\n return (AccountStorage) springContext.getBean(\"getStorage\");\n\t}",
"LockStorage getLockStorage();",
"public JStorage storage() {\n return new JStorage(TH.THTensor_(storage)(this));\n }",
"interface Storage {\n String getStorageSize() ;\n}",
"public interface IStorageManager {\n\n\tpublic String getStorageType();\n\n\tpublic String getStorageId();\n\n\tpublic void initialize(String configFile) throws Exception;\n}",
"public UserStorage getUserStorage() {\n return UserStorage.getInstance();\n }",
"BlobStore getBlobStore();",
"@Nullable public String getStorageContext() {\n return storageContext;\n }",
"public TFileStorageType getFileStorageType() {\n\n\t\treturn fileStorageType;\n\t}",
"@NonnullAfterInit public StorageSerializer getStorageSerializer() {\n return storageSerializer;\n }",
"protected abstract RegistryStorage storage();",
"public IntegerStorage getiStorage() {\n\t\treturn iStorage;\n\t}",
"public IntegerStorage getiStorage() {\n\t\treturn iStorage;\n\t}",
"public short getStorageType() {\n\treturn storageType;\n }",
"public interface Storage {\n\n String getId();\n}",
"public static Object getInternalStorageDirectory() {\n\n FileObject root = Repository.getDefault().getDefaultFileSystem().getRoot();\n\n //FileObject dir = root.getFileObject(\"Storage\");\n \n //return dir;\n return null;\n }",
"public static SQLiteStorage instance() {\n return instance;\n }",
"public long getStorage() {\n\t\t// List<Storage> listSim = new ArrayList<Storage>();\n\t\t//\n\t\t// Storage storage;\n\t\t//\n\t\t// for (int i = 0; i < 3; i++) {\n\t\t// storage = new Storage();\n\t\t//\n\t\t// storage.setDeviceName(\"/dev/sda1\");\n\t\t// storage.setFreeSpaceKB(3 * 100 * 12 * 5 * i);\n\t\t// storage.setTotalSizeKB(288237920);\n\t\t// storage.setMountPoint(\"/\");\n\t\t// storage.setOsSpecificFSType(\"ext4\");\n\t\t//\n\t\t// listSim.add(storage);\n\t\t// }\n\t\t// return listSim;\n\n\t\treturn new Random().nextInt(19700621);\n\t}",
"public StorageLocation getStorageLocation() {\n return this.storageLocation;\n }",
"public <T extends SecretsStorage> T getSecretsStorage(Class<T> implementation, WithSecrets config) {\n\n return null;\n }",
"public KVCommInterface getStore();",
"String getStorageVendor();",
"public RecipeStorage getRecipeStorage() {\n return RecipeStorage.getInstance();\n }",
"public interface StorageModel {\n}",
"@Nullable public String getStorageKey() {\n return storageKey;\n }",
"public interface IStorage extends Serializable {\n\n /**\n * Removes all stored values.\n */\n void clear();\n\n /**\n * Removes the value stored under the given key (if one exists).\n *\n * @return {@code true} if a successful.\n */\n StoragePrimitive remove(String key);\n\n /**\n * Adds all mappings in {@code val} to this storage object, overwriting any existing values.\n *\n * @see #addAll(String, IStorage)\n */\n void addAll(IStorage val);\n\n /**\n * Adds all mappings in {@code val} to this storage object, where all keys are prefixed with\n * {@code prefix}. Any existing values are overwritten.\n */\n void addAll(String prefix, IStorage val);\n\n /**\n * @return All stored keys.\n * @see #getKeys(String)\n */\n Collection<String> getKeys();\n\n /**\n * @return A collection of all stored keys matching the given prefix, or all stored keys if the prefix is\n * {@code null}.\n */\n Collection<String> getKeys(@Nullable String prefix);\n\n /**\n * @return {@code true} if this storage object contains a mapping for the given key.\n */\n boolean contains(String key);\n\n /**\n * Returns raw value stored under the given key.\n */\n StoragePrimitive get(String key);\n\n /**\n * Returns value stored under the given key converted to a boolean.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n boolean getBoolean(String key, boolean defaultValue);\n\n /**\n * Convenience method for retrieving a 32-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to int.\n *\n * @see #getDouble(String, double)\n */\n int getInt(String key, int defaultValue);\n\n /**\n * Convenience method for retrieving a 64-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to long.\n *\n * @see #getDouble(String, double)\n */\n long getLong(String keyTotal, long defaultValue);\n\n /**\n * Returns value stored under the given key converted to a double.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n double getDouble(String key, double defaultValue);\n\n /**\n * Returns value stored under the given key converted to a string.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key.\n */\n String getString(String key, String defaultValue);\n\n /**\n * Stores a value under the given key. If {@code null}, removes any existing mapping for the given key\n * instead.\n */\n void set(String key, @Nullable StoragePrimitive val);\n\n /**\n * Stores a boolean value under the given key.\n *\n * @see #setString(String, String)\n */\n void setBoolean(String key, boolean val);\n\n /**\n * Convenience method for storing an integer. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setInt(String key, int val);\n\n /**\n * Convenience method for storing a long. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setLong(String key, long val);\n\n /**\n * Stores a double-precision floating point value under the given key.\n *\n * @see #setString(String, String)\n */\n void setDouble(String key, double val);\n\n /**\n * Stores a string value under the given key.\n *\n * @param val The value to store. If {@code null}, removes any existing mapping for the given key instead.\n */\n void setString(String key, String val);\n\n}",
"public String getStoragePath() {\n return this.storagePath;\n }",
"public HashMap<String, T> getStorage();",
"public long getUsedStorage() {\n return usedStorage;\n }",
"public VPlexStorageVolumeInfo getStorageVolumeInfo() {\n return storageVolumeInfo;\n }",
"int getItemStorage();",
"public ArtifactStorage getArtifactStorage() {\n if(artifactStorageMap.firstEntry() != null) {\n return artifactStorageMap.firstEntry().getValue();\n }\n return null;\n }",
"public StorageAccount storageAccount() {\n return this.storageAccount;\n }",
"public StorageAccount storageAccount() {\n return this.storageAccount;\n }",
"public StorageProfile storageProfile() {\n return this.storageProfile;\n }",
"public java.lang.Boolean getStoragePolicySupported() {\r\n return storagePolicySupported;\r\n }",
"ContentStorage getContentStorage(TypeStorageMode mode) throws FxNotFoundException;",
"public Integer supportedStorageGb() {\n return this.supportedStorageGb;\n }",
"@java.lang.Deprecated\n public io.kubernetes.client.openapi.models.V1StorageOSPersistentVolumeSource getStorageos();",
"public interface DistributeStorage<T> {\n public void store(String path, T t, boolean create) throws StorageException;\n\n public T get(String path, Class<T> tClass) throws StorageException;\n\n public void del(String path) throws StorageException;\n\n public boolean exist(String path) throws StorageException;\n}",
"public int getItemStorage() {\n return itemStorage_;\n }",
"public MediaStorageVolume getDefaultStorageVolume()\n {\n MediaStorageVolume msv = null;\n LogicalStorageVolume lsv[] = null;\n StorageProxy[] proxies = StorageManager.getInstance().getStorageProxies();\n if (proxies.length != 0)\n {\n lsv = proxies[0].getVolumes();\n }\n else\n {\n System.out.println(\" *********No proxies avaliable*********\");\n return null;\n }\n\n System.out.println(\"*************************************************\");\n System.out.println(\" *****Found \" + lsv.length + \" volumes.******\");\n System.out.println(\"*************************************************\");\n for (int i = 0; i < lsv.length; i++)\n {\n if (lsv[i] instanceof MediaStorageVolume)\n {\n msv = (MediaStorageVolume) lsv[i];\n System.out.println(\"*************************************************\");\n System.out.println(\"******Found MSV: \" + msv + \"*********\");\n System.out.println(\"*************************************************\");\n }\n }\n\n if (msv == null)\n {\n System.out.println(\"*************************************************\");\n System.out.println(\"*******MediaStorageVolume not found!********\");\n System.out.println(\"*************************************************\");\n }\n return msv;\n }",
"public int getItemStorage() {\n return itemStorage_;\n }",
"public final StorageType mo102949f() {\n return StorageType.CACHE;\n }",
"TreeStorage getTreeStorage();",
"StorageEntity getStorageById(Integer id);",
"public String getStorageLocation() {\n\t\treturn io.getFile();\n\t}",
"public StorageUnit getStorageUnit() {\n\t\t// find the StorageUnit for the destination container\n\t\tStorageUnit storageUnit = null;\n\t\tProductContainer parentContainer = this;\n\t\twhile (storageUnit == null) {\n\t\t\tif (parentContainer.getClass() == StorageUnit.class) {\n\t\t\t\tstorageUnit = (StorageUnit) parentContainer;\n\t\t\t} else {\n\t\t\t\tparentContainer = ((ProductGroup) parentContainer)\n\t\t\t\t\t\t.getParent();\n\t\t\t}\n\t\t}\n\t\treturn storageUnit;\n\t}",
"public String storageAccount() {\n return this.storageAccount;\n }",
"public interface Storage extends ClientListStorage, UserPrefsStorage, PolicyListStorage {\n\n @Override\n Optional<UserPrefs> readUserPrefs() throws DataConversionException, IOException;\n\n @Override\n void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException;\n\n @Override\n Path getClientListFilePath();\n\n @Override\n Optional<ReadOnlyClientList> readClientList() throws DataConversionException, IOException;\n\n @Override\n void saveClientList(ReadOnlyClientList clientList) throws IOException;\n\n @Override\n Path getPolicyListFilePath();\n\n @Override\n Optional<PolicyList> readPolicyList() throws DataConversionException, IOException;\n\n @Override\n void savePolicyList(PolicyList policyList) throws IOException;\n}",
"@Deprecated\n public String getStorageClass()\n {\n return this.storageClass != null ? this.storageClass.getCode() : null;\n }",
"public Long getStorageBlock() {\n return this.StorageBlock;\n }",
"public interface SerializableStorage {\n\n /**\n * Method to save the binary data\n *\n * @param uuid identifier for the data\n * @param context binary data to save\n * @throws FailedToStoreDataInStorage in case when storage has failed to save the data\n */\n void store(UUID uuid, byte[] context) throws FailedToStoreDataInStorage;\n\n /**\n * Method to retrieve stored data\n *\n * @param uuid identifier for the data\n * @return binary data\n * @throws FailedToRetrieveStorageData in case when storage has faile to retrieve the data\n * @throws DataNotFoundInStorage in case when data has not been found\n */\n byte[] retrieve(UUID uuid) throws FailedToRetrieveStorageData, DataNotFoundInStorage;\n\n /**\n * Method to delete stored data from storage\n *\n * @param uuid identifier for the data\n * @throws DataNotFoundInStorage in case when data has not been found\n * @throws FailedToDeleteDataInStorage in case when storage has failed to delete the data\n */\n void delete(UUID uuid) throws DataNotFoundInStorage, FailedToDeleteDataInStorage;\n\n /**\n * Method to retrieve an occupied data size. Lets suppose it measured in bytes\n * @return occupied place size in bytes\n */\n long getOccupiedSize();\n}",
"public Integer getStorageSize() {\n\t return this.storageSize;\n\t}",
"@NonnullAfterInit public Function<ProfileRequestContext, String> getStorageContextLookupStrategy() {\n return storageContextLookupStrategy;\n }",
"public FileSystem getFileSystem() {\n return installBase.getFileSystem();\n }",
"public StorageUnit getRoot();",
"public static Class getStorageClass()\r\n {\r\n return String.class;\r\n }",
"@NonnullAfterInit public Function<ProfileRequestContext, String> getStorageKeyLookupStrategy() {\n return storageKeyLookupStrategy;\n }",
"public StorageManagerImpl()\n {\n if (log.isDebugEnabled())\n {\n log.debug(\"Creating Instance of StorageManagerImpl\");\n }\n storageProxyHolder = new Hashtable();\n\n try\n {\n initializeStorageProxies();\n nRegister();\n }\n catch (Throwable throwable)\n {\n if (log.isErrorEnabled())\n {\n log.error(\"Failed to create StorageManager object\", throwable);\n }\n throwable.printStackTrace();\n }\n }",
"protected DissertationStorage newDissertationStorage()\n\t{\n\t\treturn new DbCachedDissertationStorage(new DissertationStorageUser());\n\t}",
"public interface SCStorage\r\n{\r\n\t/**\r\n\t * The server will register a driver before making any method calls\r\n\t *\r\n\t * @param driver the driver\r\n\t */\r\n\tpublic void setStorageServerDriver(SCStorageServerDriver driver);\r\n\r\n\t/**\r\n\t * Open the storage at the given path\r\n\t *\r\n\t * @param path path to the storage\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void\topen(File path) throws IOException;\r\n\r\n\t/**\r\n\t * Return the object associated with the given key\r\n\t *\r\n\t * @param key the key\r\n\t * @return the object or null if not found\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic SCDataSpec get(String key) throws IOException;\r\n\r\n\t/**\r\n\t * Add an object to the storage\r\n\t *\r\n\t * @param key key\r\n\t * @param data object\r\n\t * @param groups associated groups or null\r\n\t */\r\n\tpublic void put(String key, SCDataSpec data, SCGroupSpec groups);\r\n\r\n\t/**\r\n\t * Close the storage. The storage instance will be unusable afterwards.\r\n\t *\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void close() throws IOException;\r\n\r\n\t/**\r\n\t * Return the keys that match the given regular expression\r\n\t *\r\n\t * @param regex expression\r\n\t * @return matching keys\r\n\t */\r\n\tpublic Set<String> regexFindKeys(String regex);\r\n\r\n\t/**\r\n\t * Remove the given object\r\n\t *\r\n\t * @param key key of the object\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void remove(String key) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method deletes all objects\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to delete\r\n\t * @return list of keys deleted.\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> removeGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method lists all keys\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to list\r\n\t * @return list of keys\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> listGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * Returns storage statistics\r\n\t *\r\n\t * @param verbose if true, verbose stats are returned\r\n\t * @return list of stats\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> dumpStats(boolean verbose) throws IOException;\r\n\r\n\t/**\r\n\t * Write a tab delimited file with information about the key index\r\n\t *\r\n\t * @param f the file to write to\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void writeKeyData(File f) throws IOException;\r\n}",
"public interface IStorageManager {\n public IStorageBook getValue(String key);\n\n public void addStorageBook(String key, IStorageBook book);\n\n public void clear();\n\n public boolean isEmpty();\n\n public void remove(String key);\n}",
"public String getStorageRegion() {\n return this.StorageRegion;\n }",
"public DefaultStorage() {\n }",
"public abstract FHIRPersistence getPersistenceImpl() throws Exception;",
"public IStorage getStorage(IProgressMonitor monitor) throws CoreException {\n \t\t\t\t\tif (svnRemResource != null) {\n \t\t\t\t\t\treturn svnRemResource.getStorage(monitor);\n \t\t\t\t\t}\n \n \t\t\t\t\tLong revisionNum = Long.decode(getId());\n \t\t\t\t\treturn resolveStorage(monitor, revisionNum, repository.getLocation(), getPath());\n \t\t\t\t}",
"SequencerStorage getSequencerStorage();",
"public BlobStorageTokenStore azureBlobStorage() {\n return this.azureBlobStorage;\n }",
"public java.lang.Integer getStorageCard() throws java.rmi.RemoteException;",
"com.google.privacy.dlp.v2.CloudStorageOptions getCloudStorageOptions();",
"@Nullable\n BigInteger getStorageGb();",
"public java.lang.Boolean getVStorageCapable() {\r\n return vStorageCapable;\r\n }",
"java.lang.String getArtifactStorage();",
"public com.hps.july.persistence.StorageCardKey getStorageCardKey() {\n\tcom.hps.july.persistence.StorageCardKey temp = null;\n\ttemp = new com.hps.july.persistence.StorageCardKey();\n\tboolean storageCard_NULLTEST = true;\n\tstorageCard_NULLTEST &= (storageCard_storagecard == null);\n\ttemp.storagecard = ((storageCard_storagecard == null) ? 0 : storageCard_storagecard.intValue());\n\tif (storageCard_NULLTEST) temp = null;\n\treturn temp;\n}",
"@Override\n @Path(\"/storages/{sid}\")\n public IStorageResource findStorage(@PathParam(\"sid\") int storageId) {\n return new StorageResource(provider.getProviderId(), cluster.getClusterId(), storageId);\n }",
"public interface StorageService {\n\n /**\n * Return the ReplicatSet configuration (list of services able to pin a file)\n * @return ReplicaSet List of PinningService\n */\n Set<PinningService> getReplicaSet();\n \n /**\n * Write content on the storage layer\n * @param content InputStream\n * @param noPin Disable persistence, require to pin/persist asynchrounsly (can improve the writing performance)\n * @return Content ID (hash, CID)\n */\n String write(InputStream content, boolean noPin);\n\n /**\n * Write content on the storage layer\n * @param content Byte array\n * @param noPin Disable persistence, require to pin/persist asynchrounsly (can improve the writing performance)\n * @return Content ID (hash, CID)\n */\n String write(byte[] content, boolean noPin);\n\n /**\n * Read content from the storage layer and write it in a ByteArrayOutputStream\n * @param id Content ID (hash, CID\n * @return content\n */\n OutputStream read(String id);\n \n /**\n * Read content from the storage layer and write it the OutputStream provided\n * @param id Content ID (hash, CID\n * @param output OutputStream to write content to\n * @return Outputstream passed as argument\n */\n OutputStream read(String id, OutputStream output);\n}",
"public FileSystemTokenStore fileSystem() {\n return this.fileSystem;\n }",
"RemoteStorageContext getParentRemoteStorageContext();",
"public IPersistence<T> getPersistence();",
"public MicrosoftGraphStoragePlanInformation storagePlanInformation() {\n return this.storagePlanInformation;\n }",
"protected CandidatePathStorage newCandidatePathStorage()\n\t{\n\t\treturn new DbCachedCandidatePathStorage(new CandidatePathStorageUser());\n\t}",
"public java.lang.Boolean getStorageIORMSupported() {\r\n return storageIORMSupported;\r\n }",
"StoragePolicyDecisionPoint getStoragePolicyDecisionPoint();",
"long storageSize();",
"<DB extends ODatabase> DB getUnderlying();",
"public interface Storage {\n\n public Collection<Developers> values();\n\n public int add(final Developers developer);\n\n public void edit(final Developers developer);\n\n public void delete(final int id);\n\n public Developers get(final int id);\n\n public Developers findByName(String name);\n\n public void close();\n}",
"public static StorageReference getFirebaseStorage() {\n if (referenciaStorage == null) {\n referenciaStorage = FirebaseStorage.getInstance().getReference();\n }\n\n return referenciaStorage;\n }",
"public String getLocalStore() {\n return localStore;\n }",
"public java.util.Enumeration getStorageCard() throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n\n instantiateEJB();\n return ejbRef().getStorageCard();\n }",
"public IStore getIStore() {\n\n\t\treturn store;\n\t}",
"@GET\n @Produces(\"application/xml\")\n public StorageConverter get() {\n return new StorageConverter(dao.retrieveById(id), context.getAbsolutePath());\n }",
"public Long getStorageRecordId() {\n return storageRecordId;\n }"
] | [
"0.72889626",
"0.7157885",
"0.6926719",
"0.6910864",
"0.67972183",
"0.6787244",
"0.67682415",
"0.66988325",
"0.6689585",
"0.6644348",
"0.6615578",
"0.66015446",
"0.65762156",
"0.6524896",
"0.651834",
"0.64676875",
"0.64654833",
"0.64293724",
"0.6420952",
"0.6420952",
"0.6414918",
"0.63573575",
"0.6354014",
"0.63498616",
"0.6329107",
"0.6328954",
"0.63201755",
"0.6306098",
"0.6294788",
"0.62890124",
"0.62694174",
"0.62671876",
"0.6260781",
"0.6246251",
"0.62399864",
"0.6222483",
"0.6176447",
"0.61726016",
"0.61506975",
"0.6134374",
"0.6134374",
"0.613251",
"0.6108771",
"0.609426",
"0.60617507",
"0.6060157",
"0.605992",
"0.6043574",
"0.6028934",
"0.6028177",
"0.6023086",
"0.6022335",
"0.601397",
"0.6012273",
"0.5994155",
"0.5974462",
"0.5963136",
"0.59629184",
"0.5961745",
"0.5927531",
"0.5903389",
"0.58876204",
"0.58840555",
"0.58656096",
"0.58653367",
"0.585784",
"0.5852685",
"0.58453476",
"0.5844447",
"0.58379996",
"0.5836413",
"0.5802528",
"0.5801475",
"0.58005226",
"0.5797377",
"0.57880855",
"0.5783623",
"0.5745871",
"0.57435274",
"0.57328707",
"0.57022536",
"0.569081",
"0.56883115",
"0.56872565",
"0.5682919",
"0.56770056",
"0.5675502",
"0.5631792",
"0.5628787",
"0.56269455",
"0.5620426",
"0.56162065",
"0.56152403",
"0.56146884",
"0.5613195",
"0.5586314",
"0.55770403",
"0.55653685",
"0.5560284",
"0.55498934"
] | 0.7413829 | 0 |
Set user for current database instance. | void setUser(OSecurityUser user); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDatabaseUser(String sDatabaseUser) throws IOException;",
"public void setDbuser(String dbuser) {\n this.dbuser = dbuser;\n }",
"public void setUser(User user) { this.user = user; }",
"public void setUser(User user) {\r\n this.user = user;\r\n }",
"private void setAuthenticatedUser(HttpServletRequest req, HttpSession httpSess, String userName) {\n\t\t// Set the authentication\n\t\tauthComponent.setCurrentUser(userName);\n\n\t\t// Set up the user information\n\t\tUserTransaction tx = transactionService.getUserTransaction();\n\t\tNodeRef homeSpaceRef = null;\n\t\tUser user;\n\t\ttry {\n\t\t\ttx.begin();\n\t\t\tuser = new User(userName, authService.getCurrentTicket(), personService.getPerson(userName));\n\t\t\thomeSpaceRef = (NodeRef) nodeService.getProperty(personService.getPerson(userName), ContentModel.PROP_HOMEFOLDER);\n\t\t\tif(homeSpaceRef == null) {\n\t\t\t\tlogger.warn(\"Home Folder is null for user '\"+userName+\"', using company_home.\");\n\t\t\t\thomeSpaceRef = (NodeRef) nodeService.getRootNode(Repository.getStoreRef());\n\t\t\t}\n\t\t\tuser.setHomeSpaceId(homeSpaceRef.getId());\n\t\t\ttx.commit();\n\t\t} catch (Throwable ex) {\n\t\t\tlogger.error(ex);\n\n\t\t\ttry {\n\t\t\t\ttx.rollback();\n\t\t\t} catch (Exception ex2) {\n\t\t\t\tlogger.error(\"Failed to rollback transaction\", ex2);\n\t\t\t}\n\n\t\t\tif (ex instanceof RuntimeException) {\n\t\t\t\tthrow (RuntimeException) ex;\n\t\t\t} else {\n\t\t\t\tthrow new RuntimeException(\"Failed to set authenticated user\", ex);\n\t\t\t}\n\t\t}\n\n\t\t// Store the user\n\t\thttpSess.setAttribute(AuthenticationHelper.AUTHENTICATION_USER, user);\n\t\thttpSess.setAttribute(LoginBean.LOGIN_EXTERNAL_AUTH, Boolean.TRUE);\n\n\t\t// Set the current locale from the Accept-Lanaguage header if available\n\t\tLocale userLocale = parseAcceptLanguageHeader(req, m_languages);\n\n\t\tif (userLocale != null) {\n\t\t\thttpSess.setAttribute(LOCALE, userLocale);\n\t\t\thttpSess.removeAttribute(MESSAGE_BUNDLE);\n\t\t}\n\n\t\t// Set the locale using the session\n\t\tI18NUtil.setLocale(Application.getLanguage(httpSess));\n\n\t}",
"private void setUpUser() {\n Bundle extras = getIntent().getExtras();\n mActiveUser = extras.getString(Helper.USER_NAME);\n mUser = mDbHelper.getUser(mActiveUser, true);\n Log.d(TAG, mUser.toString());\n\n if (mUser == null) {\n Toast.makeText(getBaseContext(), \"Error loading user data\", Toast.LENGTH_SHORT);\n return;\n }\n\n mIsNumPassword = Helper.isNumeric(mUser.getPassword());\n\n mKeyController = new KeyController(getApplicationContext(), mUser);\n }",
"public void setUser(User theUser) {\n\t\tmyUser = theUser;\n\t}",
"public void setUser(final String user)\n {\n checkImmutable();\n if (this.logger.isTraceEnabled()) {\n this.logger.trace(\"setting user: \" + user);\n }\n this.user = user;\n }",
"public void setUser(final String user)\n {\n checkImmutable();\n if (this.logger.isTraceEnabled()) {\n this.logger.trace(\"setting user: \" + user);\n }\n this.user = user;\n }",
"void setUser(final ApplicationUser user);",
"public void setUser(User user) {\n\tthis.user = user;\n }",
"public DatabaseConfig setUser(String user) {\n this.user = user;\n return this;\n }",
"void setCurrentUser(@Nullable User newCurrentUser) {\n currentUser = newCurrentUser;\n }",
"public void setJdbcUser(String val)\n {\n setValue(DataSourceDobj.FLD_JDBC_USER, val);\n }",
"public void setUser(String user)\n {\n _user = user;\n }",
"public void setCurrentUser(String username) {\n currentUser = username;\n }",
"public void setUser(String user) {\r\n this.user = user;\r\n }",
"public static void setUser(String user) {\n Account.user = user;\n }",
"public void initUser(ActiveSession user) {\n this.user = user;\n }",
"public void setUser(String user) \r\n\t{\n\t\tthis.user = user;\r\n\t}",
"public void setUser(User user) {\r\n\t\tthis.user = user;\r\n\t}",
"public void setUser(User user) {\r\n\t\tthis.user = user;\r\n\t}",
"public void setUser(User user) {\n this.user = user;\n }",
"public void setUser(User user) {\n this.user = user;\n }",
"public void setUser(User user) {\n this.user = user;\n }",
"public void setupUser() {\n }",
"public void setUser(String user) {\n this.user = user;\n }",
"public void setUser(String user) {\n this.user = user;\n }",
"public void setUser(String user) {\n this.user = user;\n }",
"public void setUser(String user) {\n this.user = user;\n }",
"public void assignCurrentAdminUser(final String val) {\n currentAdminUser = val;\n }",
"public void setCurrentUser(AVUser aVUser) {\n this.currentUser = aVUser;\n }",
"public void setUser(User user) {\n\t\tthis.user = user;\n\t}",
"public void setUser(User user) {\n\t\tthis.user = user;\n\t}",
"public void setUser(User user) {\n\t\tthis.user = user;\n\t}",
"public void setUser(User user) {\n\t\tthis.user = user;\n\t}",
"public void setUser(User user) {\n\t\tthis.user = user;\n\t}",
"public void setUser(User user) {\n\t\tthis.user = user;\n\t}",
"public void setMongoUser(String user) {\n mongoUser = user;\n }",
"public void setUser(String user) {\n\t\t\tthis.user = user;\n\t\t}",
"public void setCurrentUser(Person person) {\n assert person != null;\n this.currentUser = person;\n indicateUserLoginStatusChanged();\n }",
"public void setUser(final String user)\n {\n checkImmutable();\n this.user = user;\n }",
"public void setUser (User user) {\n userId = user.id != null ? user.id : User.getUserId(user.username);\n }",
"public void setUser(java.lang.String user) {\n this.user = user;\n }",
"public void setUser(final User user) {\n this.user = user;\n }",
"private void setCreateUser(entity.User value) {\n __getInternalInterface().setFieldValue(CREATEUSER_PROP.get(), value);\n }",
"public void changeUser() {\n refreshState();\n SystemUserDTO user = null;\n SystemUserDTO systemUser = null;\n systemUser = ctrl.getSystemUser(this.inputTextUser);\n if (systemUser == null) {\n user = new SystemUserDTO(this.inputTextUser, this.inputTextFName, this.inputTextLName, this.inputTextEMail);\n ctrl.addSystemUser(user);\n } else {\n user = new SystemUserDTO(this.inputTextUser, this.inputTextFName, this.inputTextLName, this.inputTextEMail);\n ctrl.updateSystemUser(user);\n }\n refreshState();\n this.currentUser = user;\n }",
"public void setCurrentUserAccount(String currentUserAccount);",
"void setPassedUser(User passedUser);",
"public void setUser(final SimpleUser user) {\n this.user = user;\n }",
"public void setUser(UserModel param) {\n localUserTracker = true;\n\n this.localUser = param;\n }",
"public void setUser(UserModel param) {\n localUserTracker = true;\n\n this.localUser = param;\n }",
"public void setUser(UserModel param) {\n localUserTracker = true;\n\n this.localUser = param;\n }",
"public void setIdUser(String idUser) {\n\t\tthis.idUser = idUser;\n\t}",
"public void setUserContext(UserContext userContext);",
"public String getDbuser() {\n return dbuser;\n }",
"public void setIdUser(Integer idUser) {\r\n\t\tthis.idUser = idUser;\r\n\t}",
"public void setUser(User user) {\n this.savedBy = user;\n }",
"public void setCallingUser(entity.User value);",
"public static void setConnectedUser( HttpServletRequest request, User user )\r\n\t{\r\n\t\trequest.getSession().setAttribute( \"connectedUser\", user );\r\n\t}",
"public void setUser(UserData data) {\n user = data;\n }",
"public void setCurrentUser(int userNum) {\n\t\tuserTurn = userNum;\n\t}",
"public static void setUserForCurrentThread(String user) {\r\n userPerThread.set(user);\r\n }",
"public void assignAuthorisedUser(final boolean val) {\n authorisedUser = val;\n }",
"public void setupUser( String uid, String password ) throws NamingException, GeneralSecurityException {\r\n\t\ttolvenUser = login(uid, password);\r\n\t}",
"public void setIdUser(int value) {\n this.idUser = value;\n }",
"private void setUpdateUser(entity.User value) {\n __getInternalInterface().setFieldValue(UPDATEUSER_PROP.get(), value);\n }",
"void setUserStore(UserStore userStore) {\n this.userStore = userStore;\n }",
"void setUserStore(UserStore userStore) {\n this.userStore = userStore;\n }",
"void setUser(User user, int id) {\n this.user = user;\n this.id = id;\n }",
"@Override\n public void intsertUser(SysUser user) {\n System.out.println(\"user插入到mysql数据库中(oracle数据库):\"+user);\n }",
"private void getUser(){\n mainUser = DatabaseAccess.getUser();\n }",
"@BeforeEach\n\t public void setUser() {\n\t\tpasswordEncoder=new BCryptPasswordEncoder();\n\t\tuser=new AuthUser();\n\t\tuser.setId(1L);\n\t\tuser.setFirstName(\"Mohammad\");\n\t\tuser.setLastName(\"Faizan\");\n\t\tuser.setEmail(\"[email protected]\");\n\t\tuser.setPassword(passwordEncoder.encode(\"faizan@123\"));\n\t\tuser.setAccountNonExpired(true);\n\t\tuser.setAccountNonLocked(true);\n\t\tuser.setCredentialsNonExpired(true);\n\t\tuser.setEnabled(true);\n\t\tSet<Role> roles=new HashSet<>();\n\t\tRole role=new Role();\n\t\trole.setId(1L);\n\t\trole.setName(\"USER\");\n\t\troles.add(role);\n\t\tuser.setRoles(roles);\n\t\t\n\t}",
"public void setRole() throws SQLException\r\n\t{\r\n\t\tString SQL_USER = \"UPDATE user SET role = 'Student' WHERE id=?;\";\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Prepare the statement\r\n\t\t\tPreparedStatement statement = this.getConn().prepareStatement(SQL_USER);\r\n\r\n\t\t\t//Bind the variables\r\n\t\t\tstatement.setInt(1, userId);\r\n\r\n\t\t\t//Execute the update\r\n\t\t\tstatement.executeUpdate();\r\n\r\n\t\t} catch (SQLException e)\r\n\t\t{\r\n\t\t\tGWT.log(\"Error in SQL: Student->setRole()\", e);\r\n\t\t\tthis.getConn().rollback();\r\n\t\t\tthrow e;\t\r\n\t\t}\r\n\t\t\r\n\t\t//commit change\r\n\t\tDatabase.get().commit();\r\n\t}",
"protected void setUsername(final String user) {\n this.user = user;\n }",
"@Override\n public void setUserUuid(java.lang.String userUuid) {\n _usersCatastropheOrgs.setUserUuid(userUuid);\n }",
"public void setCreateUser(User createUser)\r\n/* */ {\r\n/* 151 */ this.createUser = createUser;\r\n/* */ }",
"public void setUser(UserEntity user) {\n this.user = user;\n }",
"public void setUser(Long user) {\n this.user = user;\n }",
"public String getDatabaseUser();",
"@FXML private void setToNewUser(){\n\t\tshowPassword();\n\t\tclearFields();\n\t\thideLackMessages();\n\t\tchangeCancelButton.setText(\"Anuluj\");\n\t\tnewUser = true;\n\t}",
"@Override\n\tpublic void setUser(User user) {\n\t\tusersHashtable.put(user.getAccount(), user);\n\t}",
"@Override\n\tpublic void setUser(IUser user) {\n\t\tgetInnerObject().setUser(user);\n\t}",
"private void initUser() {\n\t}",
"public void updateCurrentTrempitUser() {\n\n // create the trempituser object\n TrempitUser currentUser = new TrempitUser();\n currentUser.setFullName(Profile.getCurrentProfile().getName());\n currentUser.setId(Long.valueOf(Profile.getCurrentProfile().getId()));\n\n // update the global variable so all activities can access the user\n globalState.setCurrentUser(currentUser);\n\n // insert the user to the server\n insertTrempitUserToServer(currentUser);\n\n Toast.makeText(this, \"logged in to facebook:\" + globalState.getCurrentUser().getFullName(), Toast.LENGTH_LONG).show();\n }",
"public void setCreateUser(entity.User value) {\n __getInternalInterface().setFieldValue(CREATEUSER_PROP.get(), value);\n }",
"public void setAD_User_ID (int AD_User_ID);",
"public void setUser(User user) {\n\t\tif (user == currentUser)\n\t\t\treturn;\n\t\tcurrentUser = user;\n\t}",
"@Override\n\tpublic IUser creatUser() {\n\t\treturn new SqlServerUser();\n\t}",
"public void setfUser(FirebaseUser f){\n fUser = f;\n }",
"public static void setUser(String user) {\n\t\tif (adHocAccount == null)\n\t\t\tadHocAccount = new Account();\n\t\tadHocAccount.userName = user;\n\t}",
"public QUser(Database server) {\n super(User.class, server);\n }",
"User setTokenForUser(String username, String token) throws DatabaseException;",
"public void setUserAccount(String userAccount) {\n sessionData.setUserAccount(userAccount);\n }",
"public void setUser(ScrumzuUser user) {\n\t\tthis.user = user;\n\t}",
"public void setLoggedUser(CustomEmployee user) {\n loggedUser = user;\n }",
"public void setUser(String paramUser) {\n\tstrUser = paramUser;\n }",
"public synchronized static void setUserId(String userId){\n setUserId(context,userId);\n }",
"public void modifyUser() {\n\t\tUser selectedUser = null;\r\n\t\tselectedUser = tableUser.getSelectionModel().getSelectedItem();\r\n\t\tUser user = dataManager.findCurrentUser();\r\n\t\tif (user != null) {\r\n\t\t\tif (selectedUser != null) {\r\n\t\t\t\tframeManager.modifyUser(user, selectedUser);\r\n\t\t\t\tpesquisar();\r\n\t\t\t} else {\r\n\t\t\t\tAlertUtils.alertErroSelecionar(\"Para modificar um usuario é necessário selecionar um!\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tAlertUtils.alertSemPrivelegio();\r\n\t\t}\r\n\t}",
"void editUser(String uid, User newUser);"
] | [
"0.7605621",
"0.6727858",
"0.65308815",
"0.6526275",
"0.6525295",
"0.65231264",
"0.6510289",
"0.65043306",
"0.65043306",
"0.649431",
"0.64798373",
"0.64548534",
"0.64408374",
"0.6438962",
"0.6438198",
"0.6434465",
"0.6434358",
"0.6421608",
"0.6407845",
"0.6406547",
"0.6404924",
"0.6404924",
"0.6386786",
"0.6386786",
"0.6386786",
"0.6364739",
"0.63366264",
"0.63366264",
"0.63366264",
"0.63366264",
"0.63308686",
"0.62984943",
"0.6266952",
"0.6266952",
"0.6266952",
"0.6266952",
"0.6266952",
"0.6266952",
"0.622543",
"0.6185268",
"0.6176408",
"0.6160754",
"0.61517054",
"0.6142669",
"0.6121655",
"0.6105445",
"0.6105437",
"0.6097376",
"0.6062506",
"0.6052962",
"0.6048888",
"0.6048888",
"0.6048888",
"0.60451543",
"0.60387826",
"0.6035403",
"0.6024288",
"0.599269",
"0.59871876",
"0.5964924",
"0.5952499",
"0.5951333",
"0.59302247",
"0.5912809",
"0.5909792",
"0.5892769",
"0.5875661",
"0.5856702",
"0.5856702",
"0.58464736",
"0.58451813",
"0.58408374",
"0.5839013",
"0.5837649",
"0.58343434",
"0.58286655",
"0.5817172",
"0.5814067",
"0.58114755",
"0.5809556",
"0.5805059",
"0.5791687",
"0.5781025",
"0.5780533",
"0.5777463",
"0.5771249",
"0.5763609",
"0.5754824",
"0.5746058",
"0.5742781",
"0.5741103",
"0.57373184",
"0.57358664",
"0.5719781",
"0.5715398",
"0.5709718",
"0.5708955",
"0.56891847",
"0.56809944",
"0.5669871"
] | 0.6522799 | 6 |
Internal only: replace the storage with a new one. | void replaceStorage(OStorage iNewStorage); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setStorage(com.hps.july.persistence.StoragePlaceAccessBean newStorage) {\n\tstorage = newStorage;\n}",
"public static void lost() {\n\t\tPig.alterStorage(false);\n\t}",
"public static void gained() {\n\t\tPig.alterStorage(true);\n\t}",
"public void clearStorage();",
"public void updateStorage(Map<Resource, Integer> newStorage) {\n\n this.gameboardPanel.updateStorage(newStorage);\n\n }",
"public void setStorage(Storage storage) {\n this.storage = storage;\n }",
"protected void setStorage(IStorage aStorage)\n\t{\n\n\t\tthis.storage = aStorage;\n\t}",
"protected abstract void updateStorage(MasterMetaStorage storage) throws JSONException;",
"public void setStorageplace(int newStorageplace) {\n\tstorageplace = newStorageplace;\n}",
"void editStorage(StorageEntity storage);",
"void setStorage(@NonNull Storage storage) {\n setValue(0, verifyNotNull(storage));\n }",
"@Override\n\tpublic void setStorage() {\n\t\tcom.setStorage(\"256g SSD\");\n\t}",
"public void updateUsedStorage(long consumedStorage) {\n this.usedStorage = consumedStorage;\n }",
"void cloneTo(NamedStorage storage);",
"public void setStorageplace( int newValue ) {\n __setCache(\"storageplace\", new Integer(newValue));\n }",
"protected void removeOldData() {\n if (!storage.isEmpty()) {\n long timeLowerbound = storage.lastKey() - maxStorageTime;\n while (!storage.isEmpty() && storage.firstKey() < timeLowerbound) {\n storage.pollFirstEntry();\n } \n }\n }",
"@Test\n public void setAndThenDeleteStorage() {\n byte[] txDataMethodArguments = ABIUtil.encodeMethodArguments(\"putStorage\");\n AvmRule.ResultWrapper resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n\n txDataMethodArguments = ABIUtil.encodeMethodArguments(\"resetStorage\");\n resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n Assert.assertEquals(58303 - 58303 / 2, energyLimit - resultWrapper.getTransactionResult().getEnergyRemaining());\n }",
"void saveStorage(StorageEntity storage);",
"@Test\n public void resetStorageSameKey() {\n //put first\n byte[] txDataMethodArguments = ABIUtil.encodeMethodArguments(\"putStorage\");\n AvmRule.ResultWrapper resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n\n //delete values\n txDataMethodArguments = ABIUtil.encodeMethodArguments(\"resetStorageSameKey\");\n resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n // cost before the refund is processed\n Assert.assertEquals(37271 + 29 * 5\n + 5 * RuntimeMethodFeeSchedule.BlockchainRuntime_avm_resetStorage\n - RuntimeMethodFeeSchedule.BlockchainRuntime_avm_deleteStorage_refund, energyLimit - resultWrapper.getTransactionResult().getEnergyRemaining());\n }",
"public void closeStorage() {\n\t\tdbStats.commit();\n\t\tdbStats.close();\n\t}",
"@Test\n public void setAndThenDeleteStorageAndSelfDestruct() {\n byte[] txDataMethodArguments = ABIUtil.encodeMethodArguments(\"putStorage\");\n AvmRule.ResultWrapper resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n\n txDataMethodArguments = ABIUtil.encodeMethodArguments(\"resetStorageSelfDestruct\");\n resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n Assert.assertEquals(65168 - 65168 / 2, energyLimit - resultWrapper.getTransactionResult().getEnergyRemaining());\n }",
"public void setStorage(String storage) {\n if (storage == null || storage.equals(\"\") || storage.equals(\" \")) {\n throw new IllegalArgumentException(\"storage must be provided\");\n }\n this.storage = storage;\n }",
"@Test\n public void testGenericStorageSerializationAndStorageFunctions() {\n String serializationFilename = \"TestStorage\";\n\n // Creating the GenericStorage which is under test\n GenericStorage<String, TestObject> storage = new GenericStorage\n (serializationFilename);\n\n // Creating the key we'll use to store the object\n String key = \"Hello\";\n\n // Creating a bogus object to see if it is stored and recovered properly\n TestObject testObj = new TestObject(\"HelloThisIsATest\");\n\n\n // Storing the object\n storage.create(key, testObj);\n\n // Is the object properly stored\n assert(storage.exists(key));\n assert(storage.read(key).equals(testObj));\n\n // Trying to serialize the object\n storage.saveStorage();\n\n // Resetting the storage to null\n storage = null;\n storage = new GenericStorage(\"TestStorage\");\n\n // The object shouldn't exist anymore in the storage\n assert(!storage.exists(key));\n\n // The storage should be restored with the serialization\n storage.loadStorage();\n\n // Is the object properly stored\n assert(storage.exists(key));\n assert(storage.read(key).equals(testObj));\n\n }",
"public static void setStorage(Storage storage) {\n Parser.storage = storage;\n }",
"@Test\n public void putStorageSameKey() {\n byte[] txDataMethodArguments = ABIUtil.encodeMethodArguments(\"putStorageSameKey\");\n AvmRule.ResultWrapper resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n Assert.assertEquals(35281 + 74 * 5 +\n RuntimeMethodFeeSchedule.BlockchainRuntime_avm_setStorage +\n 4 * RuntimeMethodFeeSchedule.BlockchainRuntime_avm_resetStorage + 500, energyLimit - resultWrapper.getTransactionResult().getEnergyRemaining());\n }",
"public void setStorageCard(java.lang.Integer newStorageCard)\n\t\tthrows java.rmi.RemoteException;",
"void resetStore() {\n File storeFile = new File(getStoreName());\n if (storeFile.exists()) {\n storeFile.delete();\n }\n }",
"public synchronized void writeStore() {\n FileOutputStream fileStream = null;\n\n try {\n File storeFile = new File(getStoreName());\n File oldStoreFile = new File(oldStoreName);\n\n if (oldStoreFile.exists()) {\n oldStoreFile.delete();\n }\n\n if (storeFile.exists()) {\n storeFile.renameTo(oldStoreFile);\n }\n\n File newStoreFile = new File(getStoreName());\n\n // Make sure the needed directories exists\n if (!newStoreFile.getParentFile().exists()) {\n newStoreFile.getParentFile().mkdirs();\n }\n\n fileStream = new FileOutputStream(newStoreFile);\n ObjectOutputStream outStream = new ObjectOutputStream(fileStream);\n outStream.writeObject(store);\n } catch (Exception e) {\n LOGGER.log(Level.WARNING, Utility.expandStackTraceToString(e));\n } finally {\n if (fileStream != null) {\n try {\n fileStream.close();\n } catch (IOException e) {\n LOGGER.log(Level.WARNING, Utility.expandStackTraceToString(e));\n }\n }\n }\n }",
"public void save() {\n Path root = Paths.get(storagePath);\n try {\n Files.copy(file.getInputStream(), root.resolve(file.getOriginalFilename()),\n StandardCopyOption.REPLACE_EXISTING);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"OStorage getStorage();",
"@Override\n public void clear() {\n size = 0;\n storage = null;\n }",
"public boolean save() {\n\t\t\tif (mmaped) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tfinal boolean ret = storage.set(index, buf);\n\t\t\tstorage.release(buf);\n\t\t\tbuf = null;\n\t\t\treturn ret;\n\t\t}",
"private AbstractStorageOfFoods reallocateFood(Food food, Date currentDate) {\n AbstractStorageOfFoods result = null;\n for (AbstractStorageOfFoods storage : storages) {\n if (storage != null && storage.isAppropriate(food, currentDate)) {\n storage.add(food);\n result = storage;\n break;\n }\n }\n return result;\n }",
"public void restorePreviousDeletion(){\n int cachePosition = deletedEntry.cachePosition;\n sortedFilesArrList.add(cachePosition, deletedEntry.cacheFileName);\n tag1ArrList.add(cachePosition, deletedEntry.cacheTag1);\n tag2ArrList.add(cachePosition, deletedEntry.cacheTag2);\n tag3ArrList.add(cachePosition, deletedEntry.cachetTag3);\n favArrList.add(cachePosition, deletedEntry.cacheFileIsFavorite);\n deletedEntry = null;\n\n notifyItemInserted(cachePosition);\n notifyItemRangeChanged(cachePosition, this.getItemCount());\n }",
"public void addStorage(AbstractStorageOfFoods storage) {\n storages.add(storage);\n }",
"public void loadFromLocalStorage() {\n\t\t\n\t}",
"@Override\n\tpublic void resetToExisting() {\n\t\t\n\t}",
"@Override\r\n\tpublic void update(StoragePrimary storagePrimary) {\n\t\tstoragePrimaryDao.update(storagePrimary);\r\n\t}",
"public void setStorageLocation( String name ) throws IOException {\n\t \tlog.config( \"update Storage Location to: \"+name );\n\t\tPersistentData data = null;\n\t\ttry {\n\t\t\tdata = io.readState();\n\t\t} catch( ClassNotFoundException ex ) {\n\t\t\tlog.log( Level.SEVERE, ex.toString(), ex );\n\t\t\tdata = new PersistentData();\n\t\t}\n\t\tio.setFile( name );\n\t\tio.writeState(data);\n\t}",
"@After\n public void tearDown() throws Exception {\n storage.close();\n }",
"void setTempStorage(Map<String, Object> storage);",
"public void update_storage( ) {\n SharedPreferences sp_file = getPreferences(Context.MODE_PRIVATE); //make shared preferences object\n SharedPreferences.Editor editor = sp_file.edit(); //make editor object\n editor.putInt(\"alarm_set\", alarm_set);\n editor.apply();\n }",
"private void updateStorageInfo(){\n\n long cacheSize = updateStoragePrefreneces(this);\n //cache management ends here\n\n TextView tv = (TextView) findViewById(R.id.sdcardstate_value);\n final String state = Environment.getExternalStorageState();\n\n boolean mSdCardAvailable = Environment.MEDIA_MOUNTED.equals(state);\n tv.setText((mSdCardAvailable ? \"Mounted\" : \"Not Available\") );\n if (!mSdCardAvailable) {\n tv.setTextColor(Color.RED);\n tv.setTypeface(null, Typeface.BOLD);\n }\n\n tv = (TextView) findViewById(R.id.version_text);\n tv.setText(BuildConfig.VERSION_NAME + \" \" + BuildConfig.BUILD_TYPE);\n\n tv = (TextView) findViewById(R.id.mainstorageInfo);\n tv.setText(Configuration.getInstance().getOsmdroidTileCache().getAbsolutePath() + \"\\n\" +\n \"Cache size: \" + Formatter.formatFileSize(this,cacheSize));\n }",
"void reloadFromDiskSafe();",
"private void initStorage() {\n storageList = new ItemsList();\n storageList.add(new StorageItem(1, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\pen.png\", \"pen\", 3));\n storageList.add(new StorageItem(2, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\pencil.png\", \"pencil\", 2));\n storageList.add(new StorageItem(3, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\book.jpg\", \"book\", 21));\n storageList.add(new StorageItem(4, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\rubber.png\", \"rubber\", 1));\n storageList.add(new StorageItem(5, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\calculator.png\", \"calculator\", 15));\n storageList.add(new StorageItem(6, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\cover.jpg\", \"cover\", 4));\n storageList.add(new StorageItem(7, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\globe.png\", \"globe\", 46));\n storageList.add(new StorageItem(8, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\map.jpg\", \"map\", 10));\n storageList.add(new StorageItem(9, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\marker.png\", \"marker\", 6));\n\n }",
"public void setStorageType(short type) {\n\tstorageType = type;\n }",
"@Override\n protected Void doInBackground() {\n DataProvider oldStore = theWindow_.getDataProvider();\n Datastore tmpStore = null;\n try {\n if (saveMode_ == null) {\n tmpStore = studio_.data().createRAMDatastore();\n } else if (saveMode_ == Datastore.SaveMode.SINGLEPLANE_TIFF_SERIES) {\n tmpStore = studio_.data().createSinglePlaneTIFFSeriesDatastore(filePath_);\n } else if (saveMode_ == Datastore.SaveMode.MULTIPAGE_TIFF) {\n // TODO: read options for parameters here\n tmpStore = studio_.data().createMultipageTIFFDatastore(filePath_, true, true);\n } else if (saveMode_ == Datastore.SaveMode.ND_TIFF) {\n tmpStore = studio_.data().createNDTIFFDatastore(filePath_);\n }\n } catch (IOException ioe) {\n studio_.logs().showError(ioe, \"Failed to open new datastore on disk\");\n return null;\n }\n\n final Datastore newStore = tmpStore;\n final DisplaySettings originalDisplaySettings = theWindow_.getDisplaySettings();\n final DisplaySettings.Builder newDisplaySettingsBuilder =\n theWindow_.getDisplaySettings().copyBuilder();\n\n // TODO: use Overlays instead\n final Roi roi = theWindow_.getImagePlus().getRoi();\n \n Coords.CoordsBuilder newSizeCoordsBuilder = studio_.data().coordsBuilder();\n for (String axis : oldStore.getAxes()) {\n newSizeCoordsBuilder.index(axis, oldStore.getNextIndex(axis) - 1);\n }\n SummaryMetadata oldMetadata = oldStore.getSummaryMetadata();\n List<String> channelNames = oldMetadata.getChannelNameList();\n if (channels_ != null) {\n List<ChannelDisplaySettings> channelDisplaySettings = new ArrayList<>();\n List<String> chNameList = new ArrayList<>();\n int index = 0;\n for (Map.Entry<String, Boolean> channel : channels_.entrySet()) {\n if (channel.getValue()) {\n chNameList.add(channel.getKey());\n channelDisplaySettings.add(originalDisplaySettings.getChannelSettings(index));\n }\n index++;\n }\n channelNames = chNameList;\n newDisplaySettingsBuilder.channels(channelDisplaySettings);\n }\n newSizeCoordsBuilder.channel(channelNames.size());\n float nrToBeCopied = 1;\n for (String axis : oldStore.getAxes()) {\n if (channels_ != null && channels_.size() > 0) {\n nrToBeCopied *= channels_.size();\n }\n if (mins_.containsKey(axis)) {\n int min = mins_.get(axis);\n int max = maxes_.get(axis);\n newSizeCoordsBuilder.index(axis, max - min);\n nrToBeCopied *= (max - min + 1);\n }\n }\n\n int width = roi == null ? oldMetadata.getImageWidth() : roi.getBounds().width;\n int height = roi == null ? oldMetadata.getImageHeight() : roi.getBounds().height;\n\n SummaryMetadata metadata = oldMetadata.copyBuilder()\n .channelNames(channelNames)\n .imageWidth(width)\n .imageHeight(height)\n .intendedDimensions(newSizeCoordsBuilder.build())\n .build();\n\n try {\n newStore.setSummaryMetadata(metadata);\n // The implementations of the store set SummaryMetadata on another thread.\n // This can lead to disasters, so we have to poll to make sure SummaryMetadata is\n // there. Copied from DefaultDataSaver.\n long startTime = System.currentTimeMillis();\n boolean timeOut = false;\n while (!timeOut && newStore.getSummaryMetadata() == null) {\n if (System.currentTimeMillis() - startTime > 10000) {\n timeOut = true;\n }\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n timeOut = true;\n studio_.logs().logError(e);\n }\n }\n if (timeOut) {\n studio_.logs().showError(\"Failed to save data\");\n return null;\n }\n\n newStore.setName(newName_);\n final DisplayWindow copyDisplay = studio_.displays().createDisplay(newStore);\n copyDisplay.setDisplaySettings(newDisplaySettingsBuilder.build());\n\n Iterable<Coords> unorderedImageCoords = oldStore.getUnorderedImageCoords();\n int nrCopied = 0;\n for (Coords oldCoord : unorderedImageCoords) {\n List<String> oldAxes = oldStore.getAxes();\n boolean copy = !oldAxes.contains(Coords.CHANNEL);\n for (String axis : oldStore.getAxes()) {\n if (axis.equals(Coords.CHANNEL)) {\n int index = 0;\n for (Map.Entry<String, Boolean> channel : channels_.entrySet()) {\n if (channel.getValue() && oldCoord.getIndex(axis) == index) {\n copy = true;\n continue;\n }\n index++;\n }\n }\n }\n for (String axis : oldStore.getAxes()) {\n if (copy && mins_.containsKey(axis) && maxes_.containsKey(axis)) {\n if (oldCoord.getIndex(axis) < (mins_.get(axis))) {\n copy = false;\n }\n if (oldCoord.getIndex(axis) > maxes_.get(axis)) {\n copy = false;\n }\n }\n }\n if (copy) {\n Coords.CoordsBuilder newCoordBuilder = oldCoord.copyBuilder();\n for (String axis : oldCoord.getAxes()) {\n if (axis.equals(Coords.CHANNEL)) {\n if (channels_ != null && channels_.size() > 0) {\n int chIndex = oldCoord.getIndex(axis);\n if (chIndex < oldMetadata.getChannelNameList().size()) {\n String channelName = oldMetadata.getChannelNameList().get(chIndex);\n if (channelNames.contains(channelName)) {\n int newIndex = channelNames.indexOf(channelName);\n newCoordBuilder.index(axis, newIndex);\n }\n }\n }\n }\n if (mins_.containsKey(axis)) {\n newCoordBuilder.index(axis, oldCoord.getIndex(axis) - mins_.get(axis));\n }\n }\n Image img = oldStore.getImage(oldCoord);\n Coords newCoords = newCoordBuilder.build();\n Image newImgShallow = img.copyAtCoords(newCoords);\n if (roi != null) {\n ImageProcessor ip = studio_.data().ij().createProcessor(img);\n if (ip != null) {\n ip.setRoi(roi);\n ImageProcessor copyIp = ip.crop();\n newImgShallow = studio_.data().createImage(copyIp.getPixels(), \n copyIp.getWidth(), copyIp.getHeight(), \n img.getBytesPerPixel(), img.getNumComponents(), \n newCoords, newImgShallow.getMetadata());\n } else {\n throw new DuplicatorException(\n \"Unsupported pixel type. Can only copy 8 or 16 bit images.\");\n }\n }\n newStore.putImage(newImgShallow);\n nrCopied++;\n try {\n setProgress((int) (nrCopied / nrToBeCopied * 100.0));\n } catch (IllegalArgumentException iae) {\n System.out.println(\"Value was: \" + (int) (nrCopied / nrToBeCopied * 100.0));\n }\n \n }\n }\n\n } catch (DatastoreFrozenException ex) {\n studio_.logs().showError(\"Can not add data to frozen datastore\");\n } catch (DatastoreRewriteException ex) {\n studio_.logs().showError(ex, \"Can not overwrite data\");\n } catch (DuplicatorException ex) {\n studio_.logs().showError(ex.getMessage());\n } catch (IOException ioe) {\n studio_.logs().showError(ioe, \"IOException in Duplicator plugin\");\n }\n \n try {\n newStore.freeze();\n } catch (IOException ioe) {\n studio_.logs().showError(ioe, \"IOException freezing store in Duplicator plugin\");\n }\n studio_.displays().manage(newStore);\n return null;\n }",
"public Storage getStorage() {\n return this.storage;\n }",
"public abstract void restore();",
"private InternalStorage() {}",
"public Builder setItemStorage(int value) {\n bitField0_ |= 0x00000040;\n itemStorage_ = value;\n onChanged();\n return this;\n }",
"public static void alterStorage (boolean status) {\n\t\tif (status) {\n\t\t\tnbrOfHouses+=1;\n\t\t}\n\t\telse {\n\t\t\tnbrOfHouses-=1;\n\t\t}\n\t}",
"public interface NamedStorage extends Iterable<String>, AutoCloseable {\n\n /**\n * Gets data stored by specified key and puts it to the provided stream.\n * Does not close given stream.\n * @param key data key\n * @param stream stream to process data\n * @return true if data was found, false otherwise\n */\n boolean getInto(String key, OutputStream stream);\n\n /**\n * Saves data from stream using provided key. If there was data for this key it will be overwritten with new data.\n * Does not close given stream.\n * @param key data key\n * @param stream stream to get data from\n */\n void saveFrom(String key, InputStream stream);\n\n /**\n * Checks that there is data stored for provided key\n * @param key data key\n * @return true if there is data for this key, false otherwise\n */\n boolean contains(String key);\n\n /**\n * Deletes key and associated data from storage. Does nothing if there is no such key in storage\n * @param key\n */\n void delete(String key);\n\n /**\n *\n * @return iterator for all keys. Order of keys is unknown.\n */\n Iterator<String> iterator();\n\n /**\n * Closes storage and flushes all changes on disk.\n */\n void close();\n\n /**\n * Copies all data to the specified storage\n * @param storage\n */\n void cloneTo(NamedStorage storage);\n}",
"public void store() throws PersistenceException {\n }",
"public void shuffleThePresentCardToTheEnd() {\n storageCards.add(storageCards.remove());\n }",
"public void setStorageSize(Integer storageSize) {\n\t this.storageSize = storageSize;\n\t}",
"protected abstract RegistryStorage storage();",
"private Storage_Area unloadAGV (Storage_Area storage) throws Exception\r\n {\r\n return unloadContainer(0,0, storage);\r\n }",
"public Storage(int storageSize) {\n\t\tstorageSpace = new Block[storageSize];\n\t}",
"@Override\r\n\tpublic void addStorageUnit() {\r\n\t}",
"Snapshot refresh();",
"@Override\n\tpublic void setStorageSpace(int amount) {\n\t\tif(network==null)return;\n\t\tnetwork.setBytesLimit(gibibytesToBytes(amount));\n\t\tNetwork.log(\"Set new storage amount\");\n\t}",
"public synchronized ReadableStorage register(String id, ReadableStorage storage) {\n log.info(\"Registered \" + id + \": \" + storage);\n return readStorages.put(id, storage);\n }",
"private void configStorage(){\n try {\n final StorageReference storageReference = FirebaseStorage.getInstance()\n .getReference(\"motolost/\"+ String.valueOf(Math.random()) + getFileExtension(filePath));\n storageReference.putFile(filePath)\n .continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n return storageReference.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n Uri downloadUri = task.getResult();\n saveRegistry(downloadUri.toString());\n }\n }\n });\n } catch (Exception ex) {\n Constant.showMessage(\"Exception\", ex.getMessage(), this);\n }\n }",
"@ManagedOperation(description = \"Reset and reloads the file store\")\n public synchronized void reset() throws IOException {\n synchronized (cache) {\n // trunk and clear, before we reload the store\n trunkStore();\n cache.clear();\n loadStore();\n }\n }",
"public interface DistributeStorage<T> {\n public void store(String path, T t, boolean create) throws StorageException;\n\n public T get(String path, Class<T> tClass) throws StorageException;\n\n public void del(String path) throws StorageException;\n\n public boolean exist(String path) throws StorageException;\n}",
"public synchronized WritableStorage register(String id, WritableStorage storage) {\n log.info(\"Registered \" + id + \": \" + storage);\n return writeStorages.put(id, storage);\n }",
"public void fillStorageBlocks(Block[] contents) {\n\t\tfor(int i = 0; i < contents.length; i++) {\n\t\t\tstorageSpace[i] = contents[i];\n\t\t}\n\t}",
"@Override\n public void restore() {\n }",
"public void setStorageLocation(String storageLocation) {\n this.storageLocation = storageLocation;\n }",
"public interface IStorage extends Serializable {\n\n /**\n * Removes all stored values.\n */\n void clear();\n\n /**\n * Removes the value stored under the given key (if one exists).\n *\n * @return {@code true} if a successful.\n */\n StoragePrimitive remove(String key);\n\n /**\n * Adds all mappings in {@code val} to this storage object, overwriting any existing values.\n *\n * @see #addAll(String, IStorage)\n */\n void addAll(IStorage val);\n\n /**\n * Adds all mappings in {@code val} to this storage object, where all keys are prefixed with\n * {@code prefix}. Any existing values are overwritten.\n */\n void addAll(String prefix, IStorage val);\n\n /**\n * @return All stored keys.\n * @see #getKeys(String)\n */\n Collection<String> getKeys();\n\n /**\n * @return A collection of all stored keys matching the given prefix, or all stored keys if the prefix is\n * {@code null}.\n */\n Collection<String> getKeys(@Nullable String prefix);\n\n /**\n * @return {@code true} if this storage object contains a mapping for the given key.\n */\n boolean contains(String key);\n\n /**\n * Returns raw value stored under the given key.\n */\n StoragePrimitive get(String key);\n\n /**\n * Returns value stored under the given key converted to a boolean.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n boolean getBoolean(String key, boolean defaultValue);\n\n /**\n * Convenience method for retrieving a 32-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to int.\n *\n * @see #getDouble(String, double)\n */\n int getInt(String key, int defaultValue);\n\n /**\n * Convenience method for retrieving a 64-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to long.\n *\n * @see #getDouble(String, double)\n */\n long getLong(String keyTotal, long defaultValue);\n\n /**\n * Returns value stored under the given key converted to a double.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n double getDouble(String key, double defaultValue);\n\n /**\n * Returns value stored under the given key converted to a string.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key.\n */\n String getString(String key, String defaultValue);\n\n /**\n * Stores a value under the given key. If {@code null}, removes any existing mapping for the given key\n * instead.\n */\n void set(String key, @Nullable StoragePrimitive val);\n\n /**\n * Stores a boolean value under the given key.\n *\n * @see #setString(String, String)\n */\n void setBoolean(String key, boolean val);\n\n /**\n * Convenience method for storing an integer. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setInt(String key, int val);\n\n /**\n * Convenience method for storing a long. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setLong(String key, long val);\n\n /**\n * Stores a double-precision floating point value under the given key.\n *\n * @see #setString(String, String)\n */\n void setDouble(String key, double val);\n\n /**\n * Stores a string value under the given key.\n *\n * @param val The value to store. If {@code null}, removes any existing mapping for the given key instead.\n */\n void setString(String key, String val);\n\n}",
"@Test\r\n public void testResetInventory2()\r\n {\r\n testLongTermStorage.addItem(item2, testLongTermStorage.getCapacity() / item2.getVolume());\r\n testLongTermStorage.resetInventory();\r\n assertEquals(\"Storage should be empty\", new HashMap<>(), testLongTermStorage.getInventory());\r\n }",
"public interface IStorageManager {\n public IStorageBook getValue(String key);\n\n public void addStorageBook(String key, IStorageBook book);\n\n public void clear();\n\n public boolean isEmpty();\n\n public void remove(String key);\n}",
"private void saveFood() {\n float w = Float.parseFloat(food.getDataSet().getValue(food.getMealTitle(), \"weight\"));\n float factor = Float.parseFloat(Integer.toString(quantitySeekbar.getProgress())) / w;\n\n food.setFactor(factor);\n\n LocalStorage localStorage = new LocalStorage(LocalStorage.STORAGE_KEY);\n\n ArrayList<Food> foods = (ArrayList<Food>) localStorage.retrieveObject(Constants.FOOD_ARRAYLIST_CACHE);\n\n if (foods == null) {\n foods = new ArrayList<>();\n }\n\n foods.add(food);\n\n localStorage.serializeAndStore(Constants.FOOD_ARRAYLIST_CACHE, foods);\n ((MainActivity) getActivity()).resetFragments();\n }",
"@java.lang.Deprecated\n public A withNewStorageClassName(java.lang.String original);",
"public void resetStore() {\n try {\n db.close();\n uncommited = null;\n uncommitedDeletes = null;\n autoCommit = true;\n bloom = new BloomFilter();\n utxoCache = new LRUCache(openOutCache, 0.75f);\n } catch (IOException e) {\n log.error(\"Exception in resetStore.\", e);\n }\n\n File f = new File(filename);\n if (f.isDirectory()) {\n for (File c : f.listFiles())\n c.delete();\n }\n openDB();\n }",
"public interface IWritableStorage extends IStorage {\n\n\tpublic void setContents(InputStream source, IProgressMonitor monitor) throws CoreException;\n\t\n\tpublic IStatus validateEdit(Object context);\n}",
"public void deleteStorage() {\n deleteReportDir(reportDir_);\n reportDir_ = null;\n deleteReportDir(leftoverDir_);\n leftoverDir_ = null;\n }",
"int getItemStorage();",
"public void setLocalStorageNBT(StorageID id, NBTTagCompound nbt) {\n\t\tthis.nbt.setTag(id.getStringID(), nbt);\n\t\tthis.dirty = true;\n\t}",
"private void saveToStorage() {\n FileOutputStream fos = null;\n try {\n fos = context.openFileOutput(\"GeoFences\", Context.MODE_PRIVATE);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n oos.writeObject(currentList);\n oos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public interface SCStorage\r\n{\r\n\t/**\r\n\t * The server will register a driver before making any method calls\r\n\t *\r\n\t * @param driver the driver\r\n\t */\r\n\tpublic void setStorageServerDriver(SCStorageServerDriver driver);\r\n\r\n\t/**\r\n\t * Open the storage at the given path\r\n\t *\r\n\t * @param path path to the storage\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void\topen(File path) throws IOException;\r\n\r\n\t/**\r\n\t * Return the object associated with the given key\r\n\t *\r\n\t * @param key the key\r\n\t * @return the object or null if not found\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic SCDataSpec get(String key) throws IOException;\r\n\r\n\t/**\r\n\t * Add an object to the storage\r\n\t *\r\n\t * @param key key\r\n\t * @param data object\r\n\t * @param groups associated groups or null\r\n\t */\r\n\tpublic void put(String key, SCDataSpec data, SCGroupSpec groups);\r\n\r\n\t/**\r\n\t * Close the storage. The storage instance will be unusable afterwards.\r\n\t *\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void close() throws IOException;\r\n\r\n\t/**\r\n\t * Return the keys that match the given regular expression\r\n\t *\r\n\t * @param regex expression\r\n\t * @return matching keys\r\n\t */\r\n\tpublic Set<String> regexFindKeys(String regex);\r\n\r\n\t/**\r\n\t * Remove the given object\r\n\t *\r\n\t * @param key key of the object\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void remove(String key) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method deletes all objects\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to delete\r\n\t * @return list of keys deleted.\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> removeGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method lists all keys\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to list\r\n\t * @return list of keys\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> listGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * Returns storage statistics\r\n\t *\r\n\t * @param verbose if true, verbose stats are returned\r\n\t * @return list of stats\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> dumpStats(boolean verbose) throws IOException;\r\n\r\n\t/**\r\n\t * Write a tab delimited file with information about the key index\r\n\t *\r\n\t * @param f the file to write to\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void writeKeyData(File f) throws IOException;\r\n}",
"private void ensureCapacity() {\n if ( top + 1 < storage.length ) {\n return;\n }\n storage = Arrays.copyOf( storage, storage.length * 2 );\n }",
"public void Clean()\n\t{\n\t\tstorage.clear();\n\t}",
"public void setStorageLocation(StorageLocation storageLocation) {\n this.storageLocation = storageLocation;\n }",
"@Override\n public boolean isStorageConnected() {\n return true;\n }",
"public interface Storage {\n\n String getId();\n}",
"public JStorage storage() {\n return new JStorage(TH.THTensor_(storage)(this));\n }",
"private void reallocate(){\n capacity = 2 * capacity;\n theData = Arrays.copyOf(theData, capacity);\n }",
"private void putInCacheDirty(Module module) throws NoStorageForModuleException, StorageFailureException{\n\t\tputInCache(module);\n\t\tIModuleStorage storage = storages.get(module.getId());\n\t\tif (storage==null){\n\t\t\tLOGGER.warn(\"No storage for \" + module.getId() + \", \" + module + \" is not persistent!\");\n\t\t\tthrow new NoStorageForModuleException(module.getId());\n\t\t}\n\t\tstorage.saveModule(module);\n\t}",
"protected abstract void clearRuntimeFactStorage();",
"public void addStorage(StackType option);",
"void deleteStorageById(Integer id);",
"public void restore() {\n currentIm= originalIm.copy();\n }",
"public void setStorageGroup(PartialPath path) throws MetadataException {\n String[] nodeNames = path.getNodes();\n MetaFormatUtils.checkStorageGroup(path.getFullPath());\n if (nodeNames.length <= 1 || !nodeNames[0].equals(root.getName())) {\n throw new IllegalPathException(path.getFullPath());\n }\n IMNode cur = root;\n int i = 1;\n // e.g., path = root.a.b.sg, create internal nodes for a, b\n while (i < nodeNames.length - 1) {\n IMNode temp = cur.getChild(nodeNames[i]);\n if (temp == null) {\n cur.addChild(nodeNames[i], new InternalMNode(cur, nodeNames[i]));\n } else if (temp.isStorageGroup()) {\n // before create database, check whether the database already exists\n throw new StorageGroupAlreadySetException(temp.getFullPath());\n }\n cur = cur.getChild(nodeNames[i]);\n i++;\n }\n\n // synchronize check and add, we need addChild operation be atomic.\n // only write operations on mtree will be synchronized\n synchronized (this) {\n if (cur.hasChild(nodeNames[i])) {\n // node b has child sg\n if (cur.getChild(nodeNames[i]).isStorageGroup()) {\n throw new StorageGroupAlreadySetException(path.getFullPath());\n } else {\n throw new StorageGroupAlreadySetException(path.getFullPath(), true);\n }\n } else {\n IStorageGroupMNode storageGroupMNode =\n new StorageGroupMNode(\n cur, nodeNames[i], CommonDescriptor.getInstance().getConfig().getDefaultTTLInMs());\n\n IMNode result = cur.addChild(nodeNames[i], storageGroupMNode);\n\n if (result != storageGroupMNode) {\n throw new StorageGroupAlreadySetException(path.getFullPath(), true);\n }\n }\n }\n }",
"private void reset()\r\n {\r\n log.info(\"{0}: Resetting cache\", logCacheName);\r\n\r\n try\r\n {\r\n storageLock.writeLock().lock();\r\n\r\n if (dataFile != null)\r\n {\r\n dataFile.close();\r\n }\r\n\r\n final File dataFileTemp = new File(rafDir, fileName + \".data\");\r\n Files.delete(dataFileTemp.toPath());\r\n\r\n if (keyFile != null)\r\n {\r\n keyFile.close();\r\n }\r\n final File keyFileTemp = new File(rafDir, fileName + \".key\");\r\n Files.delete(keyFileTemp.toPath());\r\n\r\n dataFile = new IndexedDisk(dataFileTemp, getElementSerializer());\r\n keyFile = new IndexedDisk(keyFileTemp, getElementSerializer());\r\n\r\n this.recycle.clear();\r\n this.keyHash.clear();\r\n }\r\n catch (final IOException e)\r\n {\r\n log.error(\"{0}: Failure resetting state\", logCacheName, e);\r\n }\r\n finally\r\n {\r\n storageLock.writeLock().unlock();\r\n }\r\n }",
"LockStorage getLockStorage();",
"public void saveExisting() {\r\n Part modifiedPart = null;\r\n for (Part part : Inventory.getAllParts()) {\r\n if (Integer.parseInt(iDfield.getText()) == part.getId()) {\r\n modifiedPart = part;\r\n }\r\n }\r\n if (modifiedPart instanceof Outsourced && inHouseSelected) {\r\n replacePart(modifiedPart);\r\n\r\n } else if (modifiedPart instanceof InHouse && !inHouseSelected) {\r\n replacePart(modifiedPart);\r\n } else {\r\n modifiedPart.setName(nameField.getText());\r\n modifiedPart.setStock(Integer.parseInt(invField.getText()));\r\n modifiedPart.setPrice(Double.parseDouble(priceField.getText()));\r\n modifiedPart.setMax(Integer.parseInt(maxField.getText()));\r\n modifiedPart.setMin(Integer.parseInt(minField.getText()));\r\n if (inHouseSelected) {\r\n ((InHouse) modifiedPart).setMachineId(Integer.parseInt(machineOrCompanyField.getText()));\r\n } else {\r\n ((Outsourced) modifiedPart).setCompanyName(machineOrCompanyField.getText());\r\n }\r\n\r\n Inventory.updatePart(Inventory.getAllParts().indexOf(modifiedPart), modifiedPart);\r\n }\r\n\r\n }",
"@Override\n public void onBackPressed( ) {\n update_storage( );\n super.onBackPressed( );\n }",
"private void saveSensor() {\n new SensorDataSerializer(sensorID, rawData);\n rawData.clear();\n }"
] | [
"0.66719186",
"0.6622475",
"0.65831625",
"0.6549414",
"0.64970547",
"0.63830584",
"0.62634856",
"0.6230203",
"0.61974853",
"0.61863846",
"0.6094846",
"0.59463006",
"0.5941944",
"0.5940108",
"0.593394",
"0.59322417",
"0.59093386",
"0.5852671",
"0.5817118",
"0.5794422",
"0.57835215",
"0.577293",
"0.5767806",
"0.57647496",
"0.5724088",
"0.5710298",
"0.5672101",
"0.5643691",
"0.56301427",
"0.5617089",
"0.55772567",
"0.5546692",
"0.5542441",
"0.55268264",
"0.55013084",
"0.54835063",
"0.5480104",
"0.54554194",
"0.54550934",
"0.54463065",
"0.5445279",
"0.54393333",
"0.54133093",
"0.5406768",
"0.540495",
"0.53999466",
"0.53618854",
"0.53417873",
"0.5334721",
"0.5330844",
"0.531427",
"0.53051865",
"0.52945226",
"0.5272538",
"0.5269151",
"0.52677345",
"0.526153",
"0.5255036",
"0.5252409",
"0.52464914",
"0.5235278",
"0.5221659",
"0.52180266",
"0.5203745",
"0.52016306",
"0.5190122",
"0.5181283",
"0.51798713",
"0.5175801",
"0.5174629",
"0.5169471",
"0.51651394",
"0.5142304",
"0.5138292",
"0.51334214",
"0.51268125",
"0.512203",
"0.5120985",
"0.5117328",
"0.51151794",
"0.5089575",
"0.5089389",
"0.5087676",
"0.508683",
"0.5086505",
"0.5086318",
"0.5076349",
"0.50735444",
"0.5054989",
"0.50518805",
"0.50504017",
"0.5047879",
"0.50470746",
"0.5045349",
"0.5040609",
"0.50299144",
"0.5028531",
"0.50281143",
"0.50278693",
"0.50253874"
] | 0.7939939 | 0 |
Returns the database owner. Used in wrapped instances to know the up level ODatabase instance. | ODatabaseInternal<?> getDatabaseOwner(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ODatabaseInternal<?> db() {\n return ODatabaseRecordThreadLocal.INSTANCE.get().getDatabaseOwner();\n }",
"@objid (\"8b942215-f0a1-454e-9f8a-596315ee40d5\")\n Instance getOwner();",
"public long getOwner() {\n\t\treturn owner;\n\t}",
"public String getOwner(){\r\n \ttry{\r\n \t\t_lockObject.lock();\r\n \t\treturn _owner;\r\n \t}finally{\r\n \t\t_lockObject.unlock();\r\n \t}\r\n }",
"ODatabaseInternal<?> setDatabaseOwner(ODatabaseInternal<?> iOwner);",
"User getOwner();",
"public String owner() {\n return this.owner;\n }",
"public synchronized static String getOwner() {\n return owner;\n }",
"public String getOwner() {\r\n\t\treturn owner;\r\n\t}",
"final int GetOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\r\n return owner;\r\n }",
"java.lang.String getOwner();",
"java.lang.String getOwner();",
"@DISPID(75)\r\n\t// = 0x4b. The runtime will prefer the VTID if present\r\n\t@VTID(73)\r\n\tjava.lang.String owner();",
"public T getOwner() {\n return owner;\n }",
"public int getOwner() {\n validify();\n return Client.INSTANCE.pieceGetOwner(ptr);\n }",
"public String getOwner() {\n\n return owner;\n\n }",
"String getOwner();",
"String getOwner();",
"public String getOwner() {\n\n return Owner;\n }",
"public User getOwner() {\n return owner;\n }",
"public String ownerName() {\n\t\t\treturn null;\n\t\t}",
"protected Object getOwner(){\n return owner;\n }",
"public User getObjectOwner() {\r\n\t\treturn objectOwner;\r\n\t}",
"public com.hps.july.persistence.OrganizationAccessBean getOwner() {\n\treturn owner;\n}",
"@Column(name=\"owner\")\n\tpublic String getOwner() {\n\t\treturn owner;\n\t}",
"@DISPID(33)\r\n\t// = 0x21. The runtime will prefer the VTID if present\r\n\t@VTID(38)\r\n\tjava.lang.String owner();",
"public String getOwner() {\n return lockOwner;\n }",
"public String getOwner() {\n return mOwner;\n }",
"public Long getIdOwner() {\r\n return idOwner;\r\n }",
"public Owner getOwner() {\n return owner;\n }",
"public String getOwner();",
"@Column (name=\"OWNER\", insertable = true, updatable = false)\r\n\tpublic String getOwner() {\r\n\t\treturn owner;\r\n\t}",
"public java.lang.Long getOpcowner() {\n\t\treturn getValue(test.generated.pg_catalog.tables.PgOpclass.PG_OPCLASS.OPCOWNER);\n\t}",
"public UUID getOwner() {\n return owner;\n }",
"public UUID getOwner() {\n return owner;\n }",
"public String getOwner(){\n\t\treturn new SmartAPIModel().getCpOwner(cp.getLocalName());\n\t}",
"@Override\n\tpublic UUID getOwnerId() {\n\t\treturn this.dataManager.get(OWNER_UUID).orNull();\n\t}",
"public String getOwner() { return owner; }",
"public String getOwner() {\r\n if (mOwner==null) {\r\n return \"n/a\";\r\n }\r\n return mOwner;\r\n }",
"public int getOwnerID() {\r\n\t\treturn ownerID;\r\n\t}",
"public Owner getOwner()\n {\n return owner;\n }",
"public OwnerReference getOwnerReference() {\n return new OwnerReferenceBuilder()\n .withController(true)\n .withApiVersion(getApiVersion())\n .withKind(getKind())\n .withName(getMetaName())\n .withUid(getMetadata().getUid())\n .build();\n }",
"public AbstractGameObject getOwner() {\r\n\t\treturn owner;\r\n\t}",
"private CFComponent getOwner() {\n\t\treturn owner;\n\t}",
"public AccountEntity getOwner() {\n\t\treturn owner;\n\t}",
"public Database getDatabase() {\n return dbHandle;\n }",
"public com.sforce.soap.enterprise.sobject.SObject getOwner() {\r\n return owner;\r\n }",
"public UserModel getOwner() {\n return localOwner;\n }",
"public Integer getOwnerId() {\n return ownerId;\n }",
"public java.lang.String getOwnerId() {\r\n return ownerId;\r\n }",
"public ResultSetInternalMethods getOwner() {\n/* 452 */ return this.owner;\n/* */ }",
"public Player owner() {\n\t\treturn null;\n\t}",
"public String getOwnerName() {\n\n return ownerName;\n }",
"public String getOwnerName() {\r\n\t\treturn ownerName;\r\n\t}",
"public Database getDatabase() {\n\t\treturn this.database;\n\t}",
"public String getDataOwner();",
"int getOwnerID();",
"public String getOwnerName() {\n\t\treturn ownerName;\n\t}",
"public abstract User getOwner();",
"@Override\r\n\tpublic Principal getOwner() {\n\t\treturn null;\r\n\t}",
"@Override\n\t\tpublic String ownerName() {\n\t\t\treturn \"Tiger Owner\";\n\t\t}",
"public Player getOwner() {\n\t\tif (owner == null && possibleOwners.size() == 1)\n\t\t\towner = possibleOwners.get(0);\n\t\t\n\t\treturn owner;\n\t}",
"public WikiUI getOwner() {\n\t\treturn owner_;\n\t}",
"public User getOwner()\r\n\t\tthrows PermissionDeniedException, BaseException\r\n\t{\r\n throw new UnsupportedOperationException(\"Fix This\"); // ToDo\r\n//\t\treturn getDbControl().getItem(User.class, getData().getOwner());\r\n\t}",
"public String getOwnerId() {\n return ownerId;\n }",
"protected String getDatabaseName() {\n\t\treturn database;\n\t}",
"public String getOwner(){\n return owner;\r\n }",
"public java.lang.String getOwner() {\n java.lang.Object ref = owner_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n owner_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getOwner() {\n java.lang.Object ref = owner_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n owner_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public String getOwnerName() {\r\n return this.ownerName;\r\n }",
"protected MongoDatabase getDB() {\n return mongoClient.getDatabase(\"comp391_yourusername\");\n }",
"public Long getOwnerUserId() {\n return ownerUserId;\n }",
"public String getownerName() {\n\t return this.ownerName;\n\t}",
"Reference owner();",
"public String getDatabase() {\r\n \t\treturn properties.getProperty(KEY_DATABASE);\r\n \t}",
"Database getDataBase() {\n return database;\n }",
"public java.lang.String getOwnername() {\n\treturn ownername;\n}",
"public DatabaseManager getDatabase() {\n\t\treturn (db);\n\t}",
"@java.lang.Override\n public java.lang.String getOwner() {\n java.lang.Object ref = owner_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n owner_ = s;\n return s;\n }\n }",
"@java.lang.Override\n public java.lang.String getOwner() {\n java.lang.Object ref = owner_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n owner_ = s;\n return s;\n }\n }",
"@Override\n\tpublic EntityLivingBase getOwner() {\n\t\tif(this.owner!=null&&!(this.owner instanceof EntityPlayer && this.owner.isDead)){\n\t\t\treturn this.owner;\n\t\t}\n\t\telse if(this.getOwnerId()!=null){\n\t\t\treturn this.owner=this.worldObj.getPlayerEntityByUUID(this.getOwnerId());\n\t\t}\n\t\t//System.out.println(\"owner: \"+this.getOwnerId());\n\t\treturn null;\n\t}",
"public DB getDatabase(){\n\t\treturn database;\n\t}",
"String getLockOwner();",
"public Organisation getOwner() {\n for (final DeviceAuthorization authorization : this.authorizations) {\n if (authorization.getFunctionGroup().equals(DeviceFunctionGroup.OWNER)) {\n return authorization.getOrganisation();\n }\n }\n\n return null;\n }",
"public OwnerType getOwnerType() {\n\t\treturn ownerType;\n\t}",
"public String getOwnerType() {\n\t\treturn ownerType;\n\t}",
"public DatabaseMeta getSharedDatabase( String name ) {\n return (DatabaseMeta) getSharedObject( DatabaseMeta.class.getName(), name );\n }",
"<DB extends ODatabase> DB getUnderlying();",
"@Override\r\n\t\tpublic Document getOwnerDocument()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}",
"public String getDatabase() {\n return this.database;\n }",
"@Override\r\n\tpublic Person Owner() {\n\t\treturn Owner;\r\n\t}",
"public String getOwnerEntityType()\r\n\t{\r\n\t\treturn ownerEntityType;\r\n\t}",
"public GraphDatabaseService GetDatabaseInstance() {\r\n\t\treturn _db;\r\n\t}"
] | [
"0.7939031",
"0.7085228",
"0.70782477",
"0.7076795",
"0.7062584",
"0.6936451",
"0.6842222",
"0.6841327",
"0.6827116",
"0.6761695",
"0.674537",
"0.674537",
"0.674537",
"0.674537",
"0.674537",
"0.674537",
"0.67381173",
"0.67311627",
"0.67311627",
"0.66798335",
"0.6664565",
"0.66362375",
"0.66286343",
"0.6627747",
"0.6627747",
"0.66170716",
"0.6616634",
"0.6603459",
"0.65943974",
"0.6573137",
"0.6555193",
"0.65478307",
"0.6546997",
"0.65394735",
"0.6529505",
"0.6523706",
"0.6523492",
"0.64889294",
"0.64852613",
"0.6449015",
"0.6440359",
"0.6440359",
"0.64361435",
"0.643257",
"0.64289945",
"0.64157975",
"0.6391834",
"0.6379482",
"0.63576",
"0.6350214",
"0.6324188",
"0.63207936",
"0.63135195",
"0.63112825",
"0.6310004",
"0.6306894",
"0.62943935",
"0.6252307",
"0.6242089",
"0.62226355",
"0.6203239",
"0.61971974",
"0.6187974",
"0.61847794",
"0.61837506",
"0.61724615",
"0.61630297",
"0.6158658",
"0.61541027",
"0.6151985",
"0.61440676",
"0.6132015",
"0.6124387",
"0.61187005",
"0.6115268",
"0.6115146",
"0.6094473",
"0.60915655",
"0.60890406",
"0.60791075",
"0.60772187",
"0.6072232",
"0.60660833",
"0.6044624",
"0.6027226",
"0.60107553",
"0.60104996",
"0.6010062",
"0.60097975",
"0.5992363",
"0.5984784",
"0.59719545",
"0.596331",
"0.59628266",
"0.5950845",
"0.59346324",
"0.59320474",
"0.5924034",
"0.5919341",
"0.59150034"
] | 0.8646887 | 0 |
Internal. Sets the database owner. | ODatabaseInternal<?> setDatabaseOwner(ODatabaseInternal<?> iOwner); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setOwner(User owner) {\n this.owner = owner;\n }",
"void setOwner(String owner);",
"public void setOwner(Owner owner) {\n this.owner = owner;\n }",
"public void setOwner( String owner ){\r\n \ttry{\r\n \t\t_lockObject.lock();\r\n \t_owner = owner;\r\n \t_itDepartment.setDirector(_owner);\r\n \t}finally{\r\n \t\t_lockObject.unlock();\r\n \t}\r\n }",
"public void setOwner(String owner) {\n mOwner = owner;\n }",
"public synchronized void setOwner(String s) {\n owner = s;\n }",
"public void setOwner(String owner) {\n this.owner = owner;\n }",
"public void setOwner(String owner) {\n this.owner = owner;\n }",
"public void setOwner(String owner) {\n this.owner = owner;\n }",
"public void setOwner(String owner) {\n this.owner = owner;\n }",
"public void setOwner (String owner) {\n\t\tthis.owner=owner;\n\t}",
"void setOwner(Entity owner);",
"protected void setOwner(T owner) {\n this.owner = owner;\n }",
"public void changeOwner(String o){\n owner = o;\r\n }",
"public void setOwner(EntityLivingBase owner) {\n\t\tthis.owner=owner;\n\t\tif(owner instanceof EntityPlayer){\n\t\t\tthis.dataManager.set(OWNER_UUID,Optional.of(owner.getUniqueID()));\n\t\t}\n\t}",
"public void setOwner(String owner) {\r\n this.owner = owner == null ? null : owner.trim();\r\n }",
"public void setOwner(com.hps.july.persistence.OrganizationAccessBean newOwner) {\n\towner = newOwner;\n}",
"public void setOwner(String owner) {\n this.owner = owner == null ? null : owner.trim();\n }",
"public void setOwner(String owner) {\n this.owner = owner == null ? null : owner.trim();\n }",
"ODatabaseInternal<?> getDatabaseOwner();",
"public void setOwner(Person owner)\n {\n this.owner = owner;\n }",
"public void setOwner(String mOwner) {\r\n this.mOwner = mOwner;\r\n }",
"public void setOwner(int owner) { this.owner = owner; }",
"public void setOwner(com.sforce.soap.enterprise.sobject.SObject owner) {\r\n this.owner = owner;\r\n }",
"public void setOwner(UserModel param) {\n localOwnerTracker = true;\n\n this.localOwner = param;\n }",
"public void setOwner(Player owner) {\n\t\tthis.owner = owner;\n\t}",
"public void setDatabaseUser(String sDatabaseUser) throws IOException;",
"public void setObjectOwner(User objectOwner) {\r\n\t\tthis.objectOwner = objectOwner;\r\n\t}",
"void setOwner(StatementContribution sc) {\n\t\tthis.owner_ = sc;\n\t}",
"void SetOwner(int passedOwner) {\n if(passedOwner == 0 || passedOwner == 1) {\n owner = passedOwner;\n }\n else {\n Log.d(\"MyError\", \"Error in setting the owner of a build in the build class.\");\n }\n }",
"public void setIdOwner(Long idOwner) {\r\n this.idOwner = idOwner;\r\n }",
"@Override\n public void setLockOwner(Object lockOwner) {\n }",
"public void setDataOwner(String sDataOwner);",
"public void setOwnerName( String name ) {\n\n ownerName = name;\n }",
"public void setOwner(Owner bucketOwner)\n {\n this.owner = bucketOwner;\n }",
"public void setOwner(AbstractGameObject owner) {\r\n\t\tthis.owner = owner;\r\n\t}",
"@Column (name=\"OWNER\", insertable = true, updatable = false)\r\n\tpublic String getOwner() {\r\n\t\treturn owner;\r\n\t}",
"public void setOwner(Person person) \n {\n owner = person;\n }",
"@Column(name=\"owner\")\n\tpublic String getOwner() {\n\t\treturn owner;\n\t}",
"public void setOwner(Person person) {\n _owner = person;\n }",
"public void setOwnerName(String name) {\r\n this.ownerName = name;\r\n }",
"public Builder setOwner(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n owner_ = value;\n onChanged();\n return this;\n }",
"public Builder setOwner(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n owner_ = value;\n onChanged();\n return this;\n }",
"public void setOwner(String newOwner) {\n\t\t_pcs.firePropertyChange(\"owner\", this.owner, newOwner); //$NON-NLS-1$\n\t\tthis.owner = newOwner;\n\t}",
"void setOwner(Subject owner)\n {\n this.owner = owner;\n }",
"@Override\r\n\tpublic void setTheOwner(Player owner) {\n\t\t\r\n\t}",
"public void setOwner(String s) {\n log(\"This option is not supported by ILASM as of Beta-2, \"\n + \"and will be ignored\", Project.MSG_WARN);\n }",
"public void setOwnerId(String ownerId) {\n this.ownerId = ownerId;\n }",
"public void setOwnerId(Integer ownerId) {\n this.ownerId = ownerId;\n }",
"public void setOwner(ResultSetImpl rs) {\n/* 443 */ this.owner = rs;\n/* */ }",
"public void setOwnerName(String ownerName) {\r\n\t\tthis.ownerName = ownerName;\r\n\t}",
"public void setOwnerName(String ownerName) {\r\n\t\tthis.ownerName = ownerName;\r\n\t}",
"public void setOwnerPlayer( final PlayerModel ownerPlayer ) {\r\n\t\tthis.ownerPlayer = ownerPlayer;\r\n\t}",
"public void setownerName(String ownerName) {\n\t this.ownerName = ownerName;\n\t}",
"public void setOwnerId(java.lang.String ownerId) {\r\n this.ownerId = ownerId;\r\n }",
"public void setOwnerUserId(Long ownerUserId) {\n this.ownerUserId = ownerUserId;\n }",
"public void setOwner(Player player) {\n owner = player;\n }",
"public void setDatabase(DatabaseManager db) {\n\t\tthis.db = db;\n\t}",
"public void setOwnerString(String s) {\n ownerString = s;\r\n }",
"public void setDatabase(Connection _db);",
"public String getOwner() {\r\n\t\treturn owner;\r\n\t}",
"public void createDatabase(String dbName, String owner) throws Exception;",
"public void setOwner(ListenerOwner owner)\n {\n super.setOwner(owner);\n if (owner != null)\n this.fieldChanged(DBConstants.DISPLAY, DBConstants.INIT_MOVE); // Do this\n }",
"public void setOwnername(java.lang.String newOwnername) {\n\townername = newOwnername;\n}",
"public String ownerName() {\n\t\t\treturn null;\n\t\t}",
"public String getOwner() {\r\n return owner;\r\n }",
"public void setOwningUser(PersonAndOrganization owningUser)\r\n\t{\r\n\t\tthis.owningUser = owningUser;\r\n\t}",
"public void setOwner(AbstractBuilding building) {\n\t\tthis.owner = building;\r\n\t}",
"final int GetOwner() {\n return owner;\n }",
"public User getOwner() {\n return owner;\n }",
"public void setOwner(TLPropertyOwner propertyOwner) {\n this.propertyOwner = propertyOwner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public String getOwner() {\n return owner;\n }",
"public long getOwner() {\n\t\treturn owner;\n\t}",
"public String getOwner() {\n\n return owner;\n\n }",
"@Override\n\t\tpublic String ownerName() {\n\t\t\treturn \"Tiger Owner\";\n\t\t}",
"@JsonSetter(\"owner\")\r\n public void setOwner(String owner) {\r\n this.owner = owner;\r\n }",
"public void setDefaultOwner(boolean defaultOwner) {\r\n\t\tthis.defaultOwner = defaultOwner;\r\n\t}",
"User getOwner();",
"void setTaskOwner(ConversationalObject taskOwner);",
"@Override\r\n\tpublic Principal getOwner() {\n\t\treturn null;\r\n\t}",
"public void updateOwner(String number, String owner) throws SQLException {\r\n\t\tConnection connection = dbAdministration.getConnection();\r\n\t\tStatement statement = connection.createStatement();\r\n\t\tString sql = \"UPDATE account SET owner = '\" + owner + \"' WHERE number = '\" + number + \"'\";\r\n\t\t// Der Datensatz wird auf der Datenbank aktualisiert\r\n\t\tstatement.executeUpdate(sql);\r\n\t\tlogger.info(\"SQL-Statement ausgeführt: \" + sql);\r\n\t\tlogger.info(\"Der Besitzer des Kontos \" + number + \" wurde durch \\\"\" + owner + \"\\\" ersetzt.\");\r\n\t\tstatement.close();\r\n\t\tconnection.close();\r\n\t}",
"public ODatabaseInternal<?> db() {\n return ODatabaseRecordThreadLocal.INSTANCE.get().getDatabaseOwner();\n }",
"protected Object getOwner(){\n return owner;\n }",
"public void setIsowner(java.lang.Boolean newIsowner) {\n\tisowner = newIsowner;\n}",
"public String getOwner() { return owner; }",
"public Builder setOwner(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n owner_ = value;\n onChanged();\n return this;\n }",
"public Builder setOwner(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n owner_ = value;\n onChanged();\n return this;\n }",
"public void setOwningApplication(Application owningApplication)\r\n\t{\r\n\t\tthis.owningApplication = owningApplication;\r\n\t}",
"void setDelegateOwner(Object owner);",
"public void setOwnerPermission(TUserPermission ownerPermission) {\n\n\t\tthis.ownerPermission = ownerPermission;\n\t}",
"public int getOwnerID() {\r\n\t\treturn ownerID;\r\n\t}",
"public void setOwner(SWActor newOwner) {\n\t\t//Set this SWActors' owner to newOwner\n\t\tthis.owner = newOwner;\n\t\t\n\t\t//Set humancontrolled boolean to true\n\t\tthis.humanControlled = true;\n\t}",
"public String getOwnerName() {\r\n\t\treturn ownerName;\r\n\t}",
"public String getOwner() {\n\n return Owner;\n }",
"public OrglRoot setAllOwners(ID owner) {\n\tthrow new SubclassResponsibilityException();\n/*\nudanax-top.st:9676:OrglRoot methodsFor: 'accessing'!\n{OrglRoot} setAllOwners: owner {ID}\n\t\"Return the portiong whose owner couldn't be changed.\"\n\t\t\n\tself subclassResponsibility!\n*/\n}"
] | [
"0.71152467",
"0.68830323",
"0.672868",
"0.66890866",
"0.66514635",
"0.6624072",
"0.6565372",
"0.6565372",
"0.6565372",
"0.6565372",
"0.65104395",
"0.64999145",
"0.64575666",
"0.64447033",
"0.6355371",
"0.634847",
"0.63323706",
"0.63292223",
"0.63292223",
"0.6316079",
"0.63112706",
"0.6282833",
"0.6277508",
"0.6244668",
"0.6208297",
"0.61928195",
"0.61886126",
"0.61525756",
"0.6152414",
"0.6143605",
"0.60905904",
"0.60900164",
"0.60640466",
"0.60458106",
"0.6038467",
"0.6030548",
"0.60012597",
"0.592548",
"0.5888713",
"0.5881371",
"0.58789474",
"0.58609027",
"0.58609027",
"0.5854692",
"0.58495384",
"0.58417505",
"0.5840761",
"0.5834685",
"0.57789576",
"0.5767108",
"0.57119685",
"0.57119685",
"0.5688824",
"0.5683589",
"0.5671637",
"0.56539464",
"0.5602852",
"0.5586802",
"0.55834305",
"0.5582973",
"0.55699414",
"0.5567595",
"0.5564226",
"0.55260783",
"0.5512873",
"0.54993236",
"0.5491677",
"0.54910105",
"0.5490423",
"0.54833424",
"0.54807824",
"0.54729146",
"0.54729146",
"0.54729146",
"0.54729146",
"0.54729146",
"0.54729146",
"0.5443225",
"0.54419214",
"0.54342866",
"0.54276687",
"0.54193157",
"0.5417272",
"0.54016995",
"0.5382129",
"0.53724474",
"0.5358782",
"0.5352316",
"0.5344272",
"0.5341387",
"0.5313761",
"0.5313761",
"0.5298722",
"0.52955157",
"0.5288285",
"0.5285514",
"0.52781624",
"0.5268002",
"0.52642643",
"0.5250701"
] | 0.7929847 | 0 |
Return the underlying database. Used in wrapper instances to know the down level ODatabase instance. | <DB extends ODatabase> DB getUnderlying(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ODatabaseInternal<?> db() {\n return ODatabaseRecordThreadLocal.INSTANCE.get().getDatabaseOwner();\n }",
"public Database getDatabase() {\n return dbHandle;\n }",
"Database getDataBase() {\n return database;\n }",
"public Database getDatabase() {\n\t\treturn this.database;\n\t}",
"public GraphDatabaseService GetDatabaseInstance() {\r\n\t\treturn _db;\r\n\t}",
"public DatabaseManager getDatabase() {\n\t\treturn (db);\n\t}",
"ODatabaseInternal<?> getDatabaseOwner();",
"@Override\n public Database getDatabase() {\n return m_database;\n }",
"public DB getDatabase(){\n\t\treturn database;\n\t}",
"public Database<T> getDatabase();",
"public messages.Databaseinterface.DatabaseInterface getDatabase() {\n return database_;\n }",
"public DB getDB() {\n return database;\n }",
"public abstract ODatabaseInternal<?> openDatabase();",
"Object getDB();",
"public messages.Databaseinterface.DatabaseInterface getDatabase() {\n if (databaseBuilder_ == null) {\n return database_;\n } else {\n return databaseBuilder_.getMessage();\n }\n }",
"public static DatabaseConnection getDb() {\n return db;\n }",
"public Database getDatabase() {\n\t\tDatabase database = null;\n\t\t//TODO fail when more than one provider was found?\n\t\ttry {\n\t\t\tIterator<Database> databaseProviders = loader.iterator();\n\t\t\twhile (database == null && databaseProviders.hasNext()) {\n\t\t\t\tdatabase = databaseProviders.next();\n\t\t\t\tlog.debug(\"Found database service provider {\" + database.getClass() + \"}\");\n\t\t\t}\n\t\t} catch (ServiceConfigurationError serviceError) {\n\t\t\tserviceError.printStackTrace();\n\t\t}\n\t\tif (database == null) {\n\t\t\tthrow new RuntimeException(\"Could not find database provider.\");\n\t\t}\n\t\treturn database;\n\t}",
"public String getDatabase();",
"public String getDatabase() {\n return this.database;\n }",
"public DatabaseClient getDb() {\n return db;\n }",
"public static Database getInstance() {\n\t\treturn OfflineDatabase.getInstance();\n\t}",
"public Driving getDB() {\n\t\treturn this.db;\n\t}",
"protected abstract ODatabaseInternal<?> newDatabase();",
"public DatabaseConnection getDatabaseConnection() {\n return query.getDatabaseConnection();\n }",
"public static String getDatabase() {\r\n return database;\r\n }",
"public String getDatabase()\n {\n return m_database; \n }",
"public static Database getInstance() {\n if (database == null) database = new Database();\n return database;\n }",
"public String getDatabase() {\r\n return Database;\r\n }",
"public SQLiteDatabase getDatabaseInstance() {\n return db;\n }",
"public String getDatabase() {\r\n \t\treturn properties.getProperty(KEY_DATABASE);\r\n \t}",
"public DB getDB() {\n\treturn _db;\n }",
"public static MyDatabase getDatabase() {\n if (instance == null) {\n synchronized (MyDatabase.class) {\n if (instance == null) {\n instance = Room.databaseBuilder(Constants.context.getApplicationContext(),\n MyDatabase.class, Constants.DATABASE_NAME)\n .build();\n }\n }\n }\n return instance;\n }",
"protected static Database getInstance() {\n if (instance == null) {\n instance = new Database();\n }\n return instance;\n }",
"public String getDB() {\n return database;\n }",
"public String getDb() {\n return db;\n }",
"public String getDb() {\n return db;\n }",
"public static synchronized Database get() {\n return instance;\n }",
"public static Database getInstance() {\r\n\t\t\r\n\t\tif(database_instance == null) {\r\n\t\t\tdatabase_instance = new Database();\t\t\t\r\n\t\t}\r\n\t\treturn database_instance;\t\t\r\n\t}",
"Database getDatabase(Properties properties, ApplicationContext applicationContext);",
"public SpokaneValleyDatabaseHelper getDatabase() {\n\t\treturn helper;\n\t}",
"@Override\r\n\tpublic Database getDefaultDatabase() {\r\n\t\treturn databases.getDatabase( \"default\" );\r\n\t}",
"public DatabaseMeta getSharedDatabase( String name ) {\n return (DatabaseMeta) getSharedObject( DatabaseMeta.class.getName(), name );\n }",
"private static IOseeDatabaseService getDatabase() throws OseeDataStoreException {\n return ServiceUtil.getDatabaseService();\n }",
"public String getDB() {\n\t\treturn db;\r\n\t}",
"protected DB getDb() throws UnknownHostException {\n return new Mongo(\"localhost\", MongoDBRule.MONGO_PORT).getDB(\"yawl\");\n }",
"public gov.nih.nlm.ncbi.www.RsiteRefDocument.RsiteRef.Db getDb()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n gov.nih.nlm.ncbi.www.RsiteRefDocument.RsiteRef.Db target = null;\r\n target = (gov.nih.nlm.ncbi.www.RsiteRefDocument.RsiteRef.Db)get_store().find_element_user(DB$2, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }",
"protected MongoDatabase getDB() {\n return mongoClient.getDatabase(\"comp391_yourusername\");\n }",
"public messages.Databaseinterface.DatabaseInterfaceOrBuilder getDatabaseOrBuilder() {\n if (databaseBuilder_ != null) {\n return databaseBuilder_.getMessageOrBuilder();\n } else {\n return database_;\n }\n }",
"yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.DatabaseSpec getDatabaseSpec();",
"public static Area28Database getDatabase(final Context context) {\n if (INSTANCE == null) {\n synchronized (Area28Database.class) {\n if (INSTANCE == null) {\n INSTANCE = Room.databaseBuilder(context.getApplicationContext(),\n Area28Database.class, database_name)\n .build();\n\n // Copy pre-created database to application runtime memory space\n try {\n copyDatabase(context, database_name);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }\n return INSTANCE;\n }",
"public DBDef getCurrentDBDef() { return DBCurrent.getInstance().currentDBDef(); }",
"public DB returnDB(String database) {\r\n return mongo.getDB(database);\r\n }",
"private DB getDB() {\n\t\tServletContext context = this.getServletContext();\n\t\tsynchronized (context) {\n\t\t\tDB db = (DB)context.getAttribute(\"DB\");\n\t\t\tif(db == null) {\n\t\t\t\tdb = DBMaker.newFileDB(new File(\"db\")).closeOnJvmShutdown().make();\n\t\t\t\tcontext.setAttribute(\"DB\", db);\n\t\t\t}\n\t\t\tcheckAdminInDB(db);\n\t\t\tcheckCategoriaInDB(db);\n\t\t\treturn db;\n\t\t}\n\t}",
"private static MongoDatabase getDatabase(){\n\t\tint port_number = 27017;\n\t\tString host = \"localhost\";\n\n\t\tMongoClient mongoClient = new MongoClient(host, port_number);\n\t\treturn mongoClient.getDatabase(\"myDb\");\n\t}",
"String getDatabase();",
"private DatabaseProvider getDatabaseProvider() {\n return new DatabaseProvider(\n System.getProperty(\"url\"),\n System.getProperty(\"user\"),\n System.getProperty(\"password\")\n );\n }",
"public SQLiteDatabase getDatabase(){\n\t\treturn db;\n\t}",
"public static Database getInstance() throws SQLException, ClassNotFoundException {\r\n if (Database.instance == null) {\r\n instance = new Database();\r\n }\r\n return instance;\r\n }",
"public String getDatabaseEngine() {\n return this.databaseEngine;\n }",
"DatabaseConnector getConnector() {return db;}",
"public ODatabaseDocumentTx getOrCreateDB();",
"public SDB getPrimaryDB() throws SqlJetException,IOException {\r\n\t\treturn getDB(getPrimaryDBID());\r\n\t}",
"public messages.Databaseinterface.DatabaseInterfaceOrBuilder getDatabaseOrBuilder() {\n return database_;\n }",
"static DatabaseReference getDBRef() {\n return mDBRef;\n }",
"public SQLiteDatabase getDatabase() {\r\n if (sqliteDatabase == null) {\r\n databaseHelper = new DatabaseHelper(this.context);\r\n sqliteDatabase = databaseHelper.getWritableDatabase();\r\n }\r\n return sqliteDatabase;\r\n }",
"@java.lang.Override\n public yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.DatabaseSpec getDatabaseSpec() {\n return databaseSpec_ == null ? yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.DatabaseSpec.getDefaultInstance() : databaseSpec_;\n }",
"private Connection getDb() throws TzException {\n if (conn != null) {\n return conn;\n }\n\n try {\n dbPath = cfg.getDbPath();\n\n if (debug()) {\n debug(\"Try to open db at \" + dbPath);\n }\n\n conn = DriverManager.getConnection(\"jdbc:h2:\" + dbPath,\n \"sa\", \"\");\n\n final ResultSet rset =\n conn.getMetaData().getTables(null, null,\n aliasTable, null);\n if (!rset.next()) {\n clearDb();\n loadInitialData();\n }\n } catch (final Throwable t) {\n // Always bad.\n error(t);\n throw new TzException(t);\n }\n\n return conn;\n }",
"public DatabaseAccessor getDatabaseAccessor() {\n\t\treturn mDatabaseManager;\n\t}",
"@Override\n\tpublic DBConnection getDBConnection() {\n\t\t\n\t\tSystem.out.println(\"Started to create DB Connection Object\");\n\t\tDBConnection connection = new DBConnection();\n\t\tconnection.setImplementorName(\"MySQL Implementation\");\n\t\tSystem.out.println(\"Completed to create DB Connection Object\");\n\t\treturn connection;\n\t}",
"public DataSourceFactory getDataSourceFactory() {\n return database;\n }",
"public static DatabaseRepository getInstance() {\n if (instance == null) instance = new DatabaseRepository();\n return instance;\n }",
"@Override\r\n public Db_db currentDb(){return curDb_;}",
"public DatabaseMap getDatabaseMap()\n {\n return this.dbMap;\n }",
"public DatabaseMap getDatabaseMap()\n {\n return this.dbMap;\n }",
"static AppDatabase getDatabase(final Context context) {\n if (INSTANCE == null) { //only a single thread can run this block at once\n //we only want this because we don't want to run too many databases\n synchronized (AppDatabase.class) {\n if(INSTANCE == null) {\n INSTANCE = Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, \"saved_locations_db\").build(); //build a database object\n }\n\n }\n }\n return INSTANCE;\n }",
"public static Connection getDBInstance() {\r\n\t\tif (db == null)\r\n\t\t\ttry {\r\n\t\t\t\tloadDBDriver();\r\n\t\t\t\tdb = DriverManager.getConnection(url, user, password);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\treturn db;\r\n\t}",
"public static LevelDBAuthenticationManager getDB() {\n if (singletonDB == null) {\n synchronized (LevelDBAuthenticationManager.class) {\n if (singletonDB == null) {\n singletonDB = new LevelDBAuthenticationManager();\n }\n }\n }\n return singletonDB;\n }",
"private void getDatabase(){\n\n }",
"public static MHWDatabase getDatabase(Application app) {\n return getDatabase(app.getApplicationContext());\n }",
"public messages.Databaseinterface.DatabaseInterface.Builder getDatabaseBuilder() {\n bitField0_ |= 0x00000010;\n onChanged();\n return getDatabaseFieldBuilder().getBuilder();\n }",
"public Connection getDatabaseConnection() {\n return con;\n }",
"public abstract String getDatabaseName();",
"public static synchronized DatabaseContext getInstance() {\r\n if (instance == null) {\r\n instance = new DatabaseContext();\r\n }\r\n return instance;\r\n }",
"public DatabaseMap getDatabaseMap()\r\n {\r\n return this.dbMap;\r\n }",
"public static DatabaseManager getDatabaseManager() {\r\n return dbManager;\r\n }",
"java.lang.String getDatabaseName();",
"java.lang.String getDatabaseName();",
"java.lang.String getDatabaseName();",
"java.lang.String getDatabaseName();",
"public DBObject getDbObject() {\n if (dbObjects.length == 0) {\n throw new MongoException(\"No objects to return\");\n }\n return dbObjects[0];\n }",
"@Override\n public DatabaseType getDatabaseType() {\n return mappings.getDatabaseType();\n }",
"protected String getDatabaseName() {\n\t\treturn database;\n\t}",
"protected abstract DbType getDatabaseType();",
"public ODatabaseDocumentTx db();",
"public static Connection getDbConnection() throws SQLException {\n return getDbConnection(FxContext.get().getDivisionId());\n }",
"public static Database getInstance(Context ctx) {\n if (mInstance == null) {\n mInstance = new Database(ctx.getApplicationContext());\n }\n return mInstance;\n }",
"public Connection getDBConnection()\r\n {\r\n Connection conn = null;\r\n try\r\n {\r\n // Quitamos los drivers\r\n Enumeration e = DriverManager.getDrivers();\r\n while (e.hasMoreElements())\r\n {\r\n DriverManager.deregisterDriver((Driver) e.nextElement());\r\n }\r\n DriverManager.registerDriver(new com.geopista.sql.GEOPISTADriver());\r\n String sConn = aplicacion.getString(UserPreferenceConstants.LOCALGIS_DATABASE_URL);\r\n conn = DriverManager.getConnection(sConn);\r\n AppContext app = (AppContext) AppContext.getApplicationContext();\r\n conn = app.getConnection();\r\n conn.setAutoCommit(false);\r\n } catch (Exception e)\r\n {\r\n return null;\r\n }\r\n return conn;\r\n }",
"public yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.DatabaseSpec getDatabaseSpec() {\n if (databaseSpecBuilder_ == null) {\n return databaseSpec_ == null ? yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.DatabaseSpec.getDefaultInstance() : databaseSpec_;\n } else {\n return databaseSpecBuilder_.getMessage();\n }\n }",
"public Connection getDBConnection() {\n Connection con = connectDB();\n createTables(con);\n return con;\n }",
"public DBMeta getForeignDBMeta() {\n return _foreignDBMeta;\n }"
] | [
"0.83978015",
"0.79277074",
"0.7721114",
"0.7593208",
"0.7525497",
"0.7471233",
"0.7466934",
"0.7390085",
"0.73589337",
"0.73183495",
"0.7317557",
"0.7314007",
"0.73041624",
"0.7193584",
"0.7174424",
"0.715022",
"0.7097654",
"0.7059721",
"0.7005541",
"0.6999489",
"0.699755",
"0.69916207",
"0.6982752",
"0.6978741",
"0.69746506",
"0.6973867",
"0.6960181",
"0.694033",
"0.6935872",
"0.69299936",
"0.69053125",
"0.6892526",
"0.6871686",
"0.6848085",
"0.6845137",
"0.6845137",
"0.6844106",
"0.6813616",
"0.679191",
"0.677648",
"0.67636544",
"0.6753123",
"0.6750214",
"0.6727045",
"0.67267406",
"0.6711667",
"0.6705194",
"0.67043835",
"0.6675937",
"0.66737354",
"0.6655887",
"0.6655656",
"0.6608144",
"0.66028345",
"0.65772223",
"0.6564974",
"0.65413195",
"0.65385854",
"0.6521278",
"0.64756197",
"0.6454902",
"0.64328325",
"0.6424151",
"0.64085096",
"0.6406533",
"0.6379794",
"0.63725185",
"0.63678527",
"0.635994",
"0.63534826",
"0.6351331",
"0.6350541",
"0.63217413",
"0.63217413",
"0.6308456",
"0.6308129",
"0.6274269",
"0.6272234",
"0.6266674",
"0.6255975",
"0.62426823",
"0.62149197",
"0.6197504",
"0.6192595",
"0.6189766",
"0.6180061",
"0.6180061",
"0.6180061",
"0.6180061",
"0.61791193",
"0.61780983",
"0.61726147",
"0.6164504",
"0.6158308",
"0.6155837",
"0.6154502",
"0.6152311",
"0.6138127",
"0.60903376",
"0.6064719"
] | 0.7760888 | 2 |
Internal method. Don't call it directly unless you're building an internal component. | void setInternal(ATTRIBUTES attribute, Object iValue); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initcomponent() {\n\r\n\t}",
"Component getComponent() {\n/* 224 */ return this.component;\n/* */ }",
"@Override\n public void initComponent() {\n }",
"@Override\n public void initComponent() {\n }",
"protected void onComponentRendered()\n\t{\n\t}",
"@Override\r\n public void initComponent() {\n }",
"private void setComponentStatus() {}",
"@Override\r\n\tpublic void buildPart() {\n\t\t\r\n\t}",
"private void initComponents() {\n\t\t\n\t}",
"private void initComponents() {\n\t\t\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"public abstract void setupComponent();",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"public void build() {\r\n // TODO\r\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n protected void init() {\n }",
"private void initiateInternal() {\n\n //define adaptation listener\n this.addComponentListener(new ComponentAdapter() {\n @Override\n public void componentResized(ComponentEvent e) {\n adapt(e);\n }\n });\n\n //solve problem with unloading of internal components\n setExtendedState(ICONIFIED | MAXIMIZED_BOTH);\n //the set visible must be the last thing called \n pack();\n setExtendedState(MAXIMIZED_BOTH);\n setVisible(true);\n }",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void render() { super.render(); }",
"@Override\n public JComponent getComponent () {\n return this;\n }",
"@Override\n\tpublic void buildComponent(StructureComponent structurecomponent, List list, Random random) {\n\t}",
"private void BuildingCombo() {\n \n }",
"@Override\n\tpublic void render () {\n\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"protected abstract ActivityComponent setupComponent();",
"@Override\r\n\tpublic void render() {\n\t\t\r\n\t}",
"@Override\npublic void childComponentsAdditionStarted() {\n\t\n}",
"@Override\r\n\tpublic void apply(Component component) {\n\t\t\r\n\t}",
"@Override\n public void init() {\n }",
"@Override\n\tpublic void buildComponent(StructureComponent structurecomponent, List list, Random random) {\n\t\t;\n\t}",
"@Override\n\tpublic void render() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n public Object build() {\n return null;\n }",
"@Override\n public Object build() {\n return null;\n }",
"@Override\n public void init() {\n\n }",
"private void buildComponent() {\n\t\tStoreItemCell cell = new StoreItemCell(\"Turret\");\n\t\tcell.initialize(mySize);\n\t\tmyContainer.getChildren().add(cell.getNode());\n\t}",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"public Component prepare(){\n\t\treturn this;\n\t}",
"@Override\n void init() {\n }",
"@Override\n public void update() {\n \n }",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"@Override\n public void componentOpened() {\n }",
"@Override\n public void componentOpened() {\n }",
"@Override\n public void componentOpened() {\n }",
"@Override\n public void componentOpened() {\n }",
"@Override\n\tpublic void preUpdate() {\n\n\t}",
"@Override\r\n\tpublic void render() {\n\r\n\t}",
"protected void render(){}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n public void update() {\n }",
"@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}",
"@Override\n public void componentOpened() {\n super.componentOpened();\n\n }",
"@Override\r\n\tprotected void processInit() {\n\r\n\t}",
"protected AbstractAggregateComponent() {\n\t\tsuper();\n\t}",
"@Override\r\n\tpublic void init() {}",
"public void render() {\n\t\t// do nothing... as we should\n\t}",
"private void createUIComponents() {\n }",
"@Override\n public void init() {}",
"@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n public void render() {\n super.render();\n }",
"@Override\n public void render() {\n super.render();\n }",
"@Override\n public void componentOpened() {\n }",
"@Override\r\n\tpublic void update() {\r\n\t}",
"@Override\n\tpublic Component getComponent() {\n\t\treturn this;\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"protected ComponentInfo createComponentInfo( final String implementationKey )\n throws Exception\n {\n final Class type = getClassLoader().loadClass( implementationKey );\n return m_blockInfoReader.buildComponentInfo( type );\n }",
"@Override\r\n\tprotected String buildContent() {\n\t\treturn null;\r\n\t}"
] | [
"0.6386335",
"0.6269533",
"0.62273526",
"0.62273526",
"0.614882",
"0.61361283",
"0.59931064",
"0.59718865",
"0.59179586",
"0.59179586",
"0.58950734",
"0.5852972",
"0.58338976",
"0.58338976",
"0.58338976",
"0.58338976",
"0.58338976",
"0.58338976",
"0.58232147",
"0.57742965",
"0.5768121",
"0.5701877",
"0.5684761",
"0.56825036",
"0.5673452",
"0.56717294",
"0.5652136",
"0.56391364",
"0.5636168",
"0.56189543",
"0.56149656",
"0.56131923",
"0.56048226",
"0.56033695",
"0.5592674",
"0.55848867",
"0.5562535",
"0.5561439",
"0.55554783",
"0.55554783",
"0.5548726",
"0.55401844",
"0.55291164",
"0.55291164",
"0.5526674",
"0.5525032",
"0.5519682",
"0.5507201",
"0.5507201",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.55058146",
"0.5496389",
"0.5496389",
"0.5496389",
"0.5496389",
"0.5494008",
"0.5486849",
"0.5482648",
"0.5481879",
"0.5481879",
"0.5481879",
"0.54798573",
"0.5477071",
"0.54597193",
"0.5452354",
"0.5442793",
"0.5436806",
"0.54365623",
"0.54339916",
"0.54319507",
"0.5431945",
"0.5426598",
"0.5426598",
"0.5424824",
"0.5424824",
"0.5423738",
"0.5405267",
"0.5404563",
"0.5403502",
"0.5396546",
"0.5395172",
"0.5392078",
"0.5382852",
"0.5382831",
"0.53783447"
] | 0.0 | -1 |
Opens a database using an authentication token received as an argument. | @Deprecated
<DB extends ODatabase> DB open(final OToken iToken); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract ODatabaseInternal<?> openDatabase();",
"private void openDatabase() {\n database = new DatabaseExpenses(this);\n database.open();\n }",
"public static void openDatabase() {\n\t\ttry {\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\n\t\t\t/* change the name and password here */\n\t\t\tc = DriverManager.getConnection(\n\t\t\t\t\t\"jdbc:postgresql://localhost:5432/testdata\", \"postgres\",\n\t\t\t\t\t\" \");\n\n\t\t\tlogger.info(\"Opened database successfully\");\n\t\t\tc.setAutoCommit(false);\n\t\t\tstatus = OPEN_SUCCESS;\n\n\t\t} catch (Exception e) {\n\t\t\tstatus = OPEN_FAILED;\n\t\t\tlogger.warn(e.getClass().getName() + \": \" + e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"private Database openTestDb(ReplicatedEnvironment master)\n throws DatabaseException {\n\n Environment env = master;\n DatabaseConfig config = new DatabaseConfig();\n config.setAllowCreate(true);\n config.setTransactional(true);\n config.setSortedDuplicates(true);\n Database testDb = env.openDatabase(null, TEST_DB, config);\n return testDb;\n }",
"private void openDatabase() {\r\n if ( connect != null )\r\n return;\r\n\r\n try {\r\n // Setup the connection with the DB\r\n String host = System.getenv(\"DTF_TEST_DB_HOST\");\r\n String user = System.getenv(\"DTF_TEST_DB_USER\");\r\n String password = System.getenv(\"DTF_TEST_DB_PASSWORD\");\r\n read_only = true;\r\n if (user != null && password != null) {\r\n read_only = false;\r\n }\r\n if ( user == null || password == null ) {\r\n user = \"guest\";\r\n password = \"\";\r\n }\r\n Class.forName(\"com.mysql.jdbc.Driver\"); // required at run time only for .getConnection(): mysql-connector-java-5.1.35.jar\r\n connect = DriverManager.getConnection(\"jdbc:mysql://\"+host+\"/qa_portal?user=\"+user+\"&password=\"+password);\r\n } catch ( Exception e ) {\r\n System.err.println( \"ERROR: DescribedTemplateCore.openDatabase() could not open database connection, \" + e.getMessage() );\r\n }\r\n }",
"public void openDatabase(@NonNull Context context){\n if (databaseClosed)\n {\n NoteDatabaseHelper dbHelper = new NoteDatabaseHelper(context, Util.DATABASE_NAME, null, Util.DATABASE_VERSION);\n noteDatabase = dbHelper.getWritableDatabase();\n databaseClosed = false;\n } else if (noteDatabase.isReadOnly())\n {\n //the database is open, but in the wrong mode (i.e. readonly, and not writeable),\n // so it needs to be closed, and reopened in writable mode.\n closeDatabase();\n openDatabase(context);\n }\n }",
"public int maDBOpen(String path)\n \t{\n \t\ttry\n \t\t{\n \t\t\tMoDatabase database = MoDatabase.create(path);\n \t\t\t++mDatabaseCounter;\n \t\t\taddDatabase(mDatabaseCounter, database);\n \t\t\treturn mDatabaseCounter;\n \t\t}\n \t\tcatch (SQLiteException ex)\n \t\t{\n \t\t\tlogStackTrace(ex);\n \t\t\treturn MA_DB_ERROR;\n \t\t}\n \t}",
"private void openDB() {\n\t\tmyDb = new DBAdapter(this);\n\t\t// open the DB\n\t\tmyDb.open();\n\t\t\n\t\t//populate the list from the database\n\t\tpopulateListViewFromDB();\n\t}",
"Database createDatabase();",
"public SQLiteDatabase open(String databaseName) {\n return context.openOrCreateDatabase(databaseName);\n }",
"public void openRODB() throws SQLException {\r\n\t\tString mPath = DATABASE_PATH + DATABASE_NAME;\r\n\t\tmDataBase = SQLiteDatabase.openDatabase(mPath, null,\r\n\t\t\t\tSQLiteDatabase.OPEN_READONLY);\r\n\t}",
"private SQLiteDatabase openDatabase(String name){\n\n SQLiteDatabase result = null;\n\n try{\n result = SQLiteDatabase.openDatabase(name, null, 0);\n this.isActive = true;\n }\n catch(Exception e){\n // result = this.createDatabase(name);\n }\n\n return result;\n\n }",
"public void open() {\n\n\t\t_database = _dbHelper.getWritableDatabase();\n\t}",
"public static Transaction open(String database) {\n HashMap<String, Transaction> transactions = instance.getTransactions();\n Transaction transaction = transactions.get(database);\n if (transaction == null) {\n DataSource dataSource = instance.getDataSource(database);\n if (dataSource == null) {\n ensureConfigured(database); // throws!\n }\n transaction = new Transaction(dataSource, database);\n transactions.put(database, transaction);\n }\n return transaction;\n }",
"public void open(String consumerArg, Properties props)\n\t\tthrows DataConsumerException\n\t{\n\t\t// Get username & password from Auth file\n\t\tProperties credentials = null;\n\t\tString authFileName = DecodesSettings.instance().DbAuthFile;\t\t\n\t\ttry \n\t\t{\n\t\t\tcredentials = AuthSourceService.getFromString(authFileName)\n\t\t\t\t\t\t\t\t\t\t\t .getCredentials();\n\t\t}\n\t\tcatch(AuthException ex)\n\t\t{\n\t\t\tString msg = \"Cannot read DB auth from settings '\" \n\t\t\t\t+ authFileName+ \"': \";\n\t\t\tthrow new DataConsumerException(msg,ex);\n\t\t}\n\t\t\n\t\t// Get the Oracle Data Source & open a connection.\n\t\ttry\n\t\t{\n\t\t\thdbTsDb = new HdbTimeSeriesDb();\n\t\t\thdbTsDb.connect(\"decodes\", credentials);\n\t\t\tinfo(\"Connected to HDB Time Series Database as user \" \n\t\t\t\t+ credentials.getProperty(\"username\"));\n\t\t\tautoCreateTs = TextUtil.str2boolean(hdbTsDb.getProperty(\"autoCreateTs\"));\n\t\t\ttimeSeriesDAO = hdbTsDb.makeTimeSeriesDAO();\n\t\t}\n\t\tcatch (BadConnectException ex)\n\t\t{\n\t\t\tString msg = \"Cannot connect to HDB Time Series DB: \" + ex;\n\t\t\tfailure(msg);\n\t\t\tthrow new DataConsumerException(msg);\n\t\t}\n\t}",
"protected abstract ODatabaseInternal<?> newDatabase();",
"public DatabaseAccess(Context context) {\n this.openHelper = new OlpbhtbDatabase(context);\n }",
"private void open()\n\t\t{\n\t\t\tconfig=Db4oEmbedded.newConfiguration();\n\t\t\tconfig.common().objectClass(Census.class).cascadeOnUpdate(true);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tDB=Db4oEmbedded.openFile(config, PATH);\n\t\t\t\tSystem.out.println(\"[DB4O]Database was open\");\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"[DB4O]ERROR:Database could not be open\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}",
"private void onOpenDB() {\n\n try {\n mLoginSessionDb = new LoginSessionAdapter(this);\n mLoginSessionDb.open();\n\n mLoginSessionData = mLoginSessionDb.GetLoginSessionData();\n\n mConfigDb = new ConfigAdapter(this);\n mConfigDb.open();\n\n mConfigData = mConfigDb.GetConfigData();\n\n if (mConfigData.getPushConfig().equals(\"\")) {\n mConfigDb.DeleteConfigData();\n mConfigData.setPushConfig(\"Y\");\n mConfigData.setGpsConfig(\"Y\");\n mConfigDb.CreateConfigData(mConfigData);\n }\n } catch (Exception e) { }\n }",
"public DataBase open(){\n myDB = new MyHelper(ourContext);\n myDataBase = myDB.getWritableDatabase();\n return this;\n }",
"public void OpenDB() {\n\t\tString JDriver = \"com.microsoft.sqlserver.jdbc.SQLServerDriver\";// 数据库驱动\n\t\tSystem.out.println(\"数据库驱动成功\");\n\t\tString connectDB = \"jdbc:sqlserver://localhost:1433;DatabaseName=bookstoreDB\";// 数据库连接\n\t\ttry {\n\t\t\tClass.forName(JDriver);// 加载数据库引擎,返回给定字符串名的类\n\t\t} catch (ClassNotFoundException e) {// e.printStackTrace();\n\t\t\tSystem.out.println(\"加载数据库引擎失败\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\ttry {\n\t\t\tconDB = DriverManager.getConnection(connectDB, \"sa\", \"123456\");// 连接数据库对象\n\t\t\tSystem.out.println(\"连接数据库成功\");\n\t\t\tstaDB = conDB.createStatement();\n\t\t} // 创建SQL命令对象\n\t\tcatch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"数据库连接错误\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"protected void open() throws TzException {\n synchronized (dbLock) {\n if (!isOpen()) {\n getDb();\n open = true;\n return;\n }\n }\n }",
"private void open() {\n\t\tFile dbf = new File( dbName );\n\n\t\tif ( dbf.exists( ) == false ) {\n\t\t\tSystem.out.println(\n\t\t\t\t \"SQLite database file [\"\n\t\t\t\t+ dbName\n\t\t\t\t+ \"] does not exist\");\n\t\t\tSystem.exit( 0 );\n\t\t}\n\t\n\t\ttry {\n\t\t\tClass.forName( JDBC_DRIVER );\n\t\t\tgetConnection( );\n\t\t}\n\t\tcatch ( ClassNotFoundException cnfe ) {\n\t\t\tnotify( \"Db.Open\", cnfe );\n\t\t}\n\n\t\tif ( debug )\n\t\t\tSystem.out.println( \"Db.Open : leaving\" );\n\t}",
"public TrucksDB open() throws SQLException {\n mDbHelper = new DatabaseHelper(mCtx);\n mDb = mDbHelper.getWritableDatabase();\n return this;\n }",
"DatabaseSession openSession();",
"public void open(){\n\t\tbdd = maBaseSQLite.getWritableDatabase();\n\t}",
"public void open() {\n this.database = openHelper.getWritableDatabase();\n }",
"public void open() {\n this.database = openHelper.getWritableDatabase();\n }",
"public void open() {\n this.database = openHelper.getWritableDatabase();\n }",
"public void open() {\n this.database = openHelper.getWritableDatabase();\n }",
"public void open() {\n this.database = openHelper.getWritableDatabase();\n }",
"public void openDB() {\n\n\t\t// Connect to the database\n\t\tString url = \"jdbc:mysql://localhost:2000/X__367_2020?user=X__367&password=X__367\";\n\t\t\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(url);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"using url:\"+url);\n\t\t\tSystem.out.println(\"problem connecting to MariaDB: \"+ e.getMessage());\t\t\t\n\t\t\t//e.printStackTrace();\n\t\t}\n\n\t}",
"private static void openDBIfClosed(Context context) {\n if (mMetaDb == null || !mMetaDb.isOpen()) {\n openDB(context);\n }\n }",
"private void openStore()\n throws Exception {\n\n dbStore = Utils.openStore(master, Utils.DB_NAME);\n primaryIndex = \n dbStore.getPrimaryIndex(Integer.class, RepTestData.class);\n }",
"void open(SessionParameters sessionParameters, AuthenticationParameters authenticationParameters);",
"public void open() {\n dbHelper = new DatabaseHelper(context);\n sqLiteDatabase = dbHelper.getWritableDatabase();\n }",
"public DaoSession openReadableDb() {\n isInitOk();\n SQLiteDatabase db = openHelper.getReadableDatabase();\n DaoMaster daoMaster = new DaoMaster(db);\n DaoSession daoSession = daoMaster.newSession();\n return daoSession;\n }",
"private DatabaseAccess(Context context) {\n this.openHelper = new MyDatabase(context);\n }",
"public void open() throws SQLException {\n database = helperAngkot.getWritableDatabase();\n }",
"Database getDatabase(Properties properties, ApplicationContext applicationContext);",
"private void openDatabase() {\r\n SearchHelper = new DBHelper(this);\r\n }",
"public SQLiteDatabase openDatabase() {\n synchronized (mLock) {\n Log.d(\"Opening database.\");\n File path = mContext.getDatabasePath(DatabaseOpenHelper.NAME);\n //Check if database exists and if not copy from assests folder\n if (!path.exists()) {\n try {\n mOpenHelper = new DatabaseOpenHelper(mContext);\n mOpenHelper.getWritableDatabase();\n\n copyDataBase();\n }\n catch (IOException e) {\n Log.e(\"Could not copy dictionary.\", e);\n }\n }\n if (mOpenHelper == null) {\n mOpenHelper = new DatabaseOpenHelper(mContext);\n }\n return mOpenHelper.getWritableDatabase();\n }\n }",
"public Database(Context context)\n\t{\n\t\t/* Instanciation de l'openHelper */\n\t\tDBOpenHelper helper = new DBOpenHelper(context);\n\t\t\n\t\t/* Load de la database */\n\t\t//TODO passer en asynchrone pour les perfs\n\t\tmainDatabase = helper.getWritableDatabase();\n\t\t\n\t\t/* DEBUG PRINT */\n\t\tLog.i(\"info\", \"Database Loading Suceeded\");\n\t}",
"public void open() {\n db = dbHelper.getWritableDatabase();\n articleDAO.open(db);\n categoryDAO.open(db);\n sourceDAO.open(db);\n }",
"public void open() {\n this.db = this.mSqlHelper.getWritableDatabase();\n }",
"public void open() throws SQLException {\n\t\t \n\t\t mDatabase = mDbHelper.getWritableDatabase();\n\t\t mDatabase = mDbHelper.getWritableDatabase();\n\n\t\t //refreshCompanies();\n\t }",
"public DBinterface open() throws SQLException {\r\n db = helper.getWritableDatabase();\r\n return this;\r\n }",
"public DaoSession openWritableDb() {\n isInitOk();\n SQLiteDatabase db = openHelper.getWritableDatabase();\n DaoMaster daoMaster = new DaoMaster(db);\n DaoSession daoSession = daoMaster.newSession();\n return daoSession;\n }",
"public void open() throws SQLException {\r\n this.database = dbhelper.getWritableDatabase();\r\n }",
"public MoviesDBHelper open() throws SQLException {\n\t\tLog.d(\"INIT\", \"MoviesDBHelper.........\");\n\t\tmDbHelper = new DatabaseHelper(mContext);\n\t\tmDb = mDbHelper.getWritableDatabase();\n\t\treturn this;\n\t}",
"public synchronized SQLiteDatabase open() {\n\n mOpenCounter++;\n\n if(mOpenCounter == 1) {\n // Opening new database\n mDatabase = mDatabaseHelper.getWritableDatabase();\n }\n return mDatabase;\n }",
"private DatabaseAccess(Context context){\n this.openHelper=new DatabaseOpenHelper(context);\n }",
"public void open() throws SQLException {\n\t\t// creates or opens a database\n\t\tdatabase = dbHelper.getWritableDatabase();\n//\t\tdbHelper.onUpgrade(database, 1, 1); // Use this statement to reset database\n\t}",
"public LoginDataBaseAdapter open() throws SQLException {\n db = dbHelper.getWritableDatabase();\n return this;\n }",
"public void getTokenFromDB() {\n Cursor c = mDBManager.query(new String[]{\"token\", \"name\"}, null, null, null, null, null);\n if (c != null && c.moveToFirst()) {\n token = c.getString(0);\n name= c.getString(1);\n }\n c.close();\n\n }",
"private static ParameterDatabase openParameterDatabase(String[] args) {\n ParameterDatabase parameters = null;\n for (int x = 0; x < args.length - 1; x++) {\n if (args[x].equals(A_FILE)) {\n try {\n File parameterDatabaseFile = new File(args[x + 1]);\n parameters = new ParameterDatabase(parameterDatabaseFile.getAbsoluteFile());\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n break;\n }\n }\n if (parameters == null) {\n System.out.println(\"\\nNot in a parameter Mode\");//(\"\\nNo parameter file was specified\");\n parameters = new ParameterDatabase();\n }\n return parameters;\n }",
"public void open() {\n if (mDB == null || !mDB.isOpen()) {\n Log.d(this.getClass().getName(), \"open new DB connection\");\n mDB = mDBHelper.getWritableDatabase();\n }\n }",
"private DatabaseAccess(Context context) {\n this.openHelper = new DatabaseOpenHelper(context);\n }",
"private SQLiteDatabase openConnection() {\n\n sqlLiteHelper = new SQLLiteHelper(DatabaeServiceContext);\n return sqlLiteHelper.getWritableDatabase();\n\n }",
"public void open() throws SQLException {\n database = helper.getWritableDatabase();\n }",
"public void open() throws SQLException {\n\t\tdatabase = dbHelper.getWritableDatabase();\n\t}",
"public DatabaseReference open() {\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n myPokemonDbRef = database.getReference(PokemonDataTag);\n return myPokemonDbRef;\n }",
"public void open(){\n this.db = this.typeDatabase.getWritableDatabase();\n }",
"public RevisionDbAdapter open() throws SQLException {\n\t\tif (mDbHelper == null) {\n\t\t\tmDbHelper = new DatabaseHelper(mCtx);\n\t\t}\n\t\tmDb = mDbHelper.getWritableDatabase();\n\t\treturn this;\n\t}",
"public interface Database\r\n{\r\n\t/**\r\n\t * Opens a new database session.\r\n\t *\r\n\t * @return a database session\r\n\t */\r\n\tDatabaseSession openSession();\r\n}",
"@Override\r\n protected void openInternal(\r\n final Map<String, CassandraEmbDatabase> theDatabase) {\r\n // empty the table and query complete list of keyspaces from DB.\r\n theDatabase.clear();\r\n final List<KsDef> ksDefs;\r\n try {\r\n ksDefs = server.describe_keyspaces();\r\n for (final KsDef keyspaceDefinition : ksDefs) {\r\n final CassandraEmbDatabase db = new CassandraEmbDatabase(this,\r\n keyspaceDefinition);\r\n theDatabase.put(keyspaceDefinition.getName(), db);\r\n }\r\n } catch (final Exception e) {\r\n throw new DBException(\"Error Opening Database.\", e);\r\n }\r\n }",
"public static LevelDBAuthenticationManager getDB() {\n if (singletonDB == null) {\n synchronized (LevelDBAuthenticationManager.class) {\n if (singletonDB == null) {\n singletonDB = new LevelDBAuthenticationManager();\n }\n }\n }\n return singletonDB;\n }",
"private void openDB()\r\n \t{\n \t\tif ( lootDB != null )\r\n \t\t\treturn;\r\n \t\t\r\n \t\ttry\r\n \t\t{\r\n \t\t\tlootDB = SQLiteDatabase.openDatabase( DB_PATH, null, SQLiteDatabase.OPEN_READWRITE );\r\n \t\t\tif ( lootDB.needUpgrade( DB_VERSION ) )\r\n \t\t\t\tif ( !this.upgradeDB( DB_VERSION ) )\r\n \t\t\t\t\tlootDB = null;\r\n \t\t}\r\n \t\t// catch SQLiteException if the database doesn't exist, then create it\r\n \t\tcatch (SQLiteException sqle)\r\n \t\t{\r\n \t\t\ttry\r\n \t\t\t{\r\n \t\t\t\tlootDB = SQLiteDatabase.openOrCreateDatabase( DB_PATH, null);\r\n \t\t\t\tif ( !createDB(lootDB) )\r\n \t\t\t\t\tlootDB = null;\r\n \t\t\t}\r\n \t\t\t// something went wrong creating the database\r\n \t\t\tcatch ( SQLiteException e )\r\n \t\t\t{\r\n \t\t\t\tlootDB = null;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\t// throw an exception if we've made it through the try/catch block\r\n \t\t// and the database is still not opened\r\n \t\tif ( lootDB == null )\r\n \t\t{\r\n \t\t\tthrow new SQLException( \"Database could not be opened\" );\r\n \t\t}\r\n \t}",
"public GastoDAO(Context context){\n dbHelper = new MyDatabaseHelper(context);\n database = dbHelper.getWritableDatabase();\n }",
"public PlayerDBAdapter open() throws SQLException {\r\n\t\tthis.mDbHelper = new DatabaseHelper(this.mCtx);\r\n\t\tthis.mDb = this.mDbHelper.getWritableDatabase();\r\n\t\treturn this;\r\n\t}",
"public void openRWDB() throws SQLException {\r\n\t\tString mPath = DATABASE_PATH + DATABASE_NAME;\r\n\t\tmDataBase = SQLiteDatabase.openDatabase(mPath, null,\r\n\t\t\t\tSQLiteDatabase.OPEN_READWRITE);\r\n\t}",
"public Database(Context context) { \n\t\tsuper( context, database_MEF, null, 2); \n\t}",
"public SQLiteDatabase openDatabaseSafe() {\n SQLiteDatabase db = null;\n try {\n db = SQLiteDatabase.openDatabase(DB_PATH, null, SQLiteDatabase.OPEN_READONLY);\n } catch(SQLiteException e){\n Log.i(TAG, \"Error: could not open database.\", e);\n }\n return db;\n }",
"private void initDb() {\n\t\tif (dbHelper == null) {\n\t\t\tdbHelper = new DatabaseOpenHelper(this);\n\t\t}\n\t\tif (dbAccess == null) {\n\t\t\tdbAccess = new DatabaseAccess(dbHelper.getWritableDatabase());\n\t\t}\n\t}",
"public static LevelDB Open(Options options, String dbname) throws IOException, BadFormatException, DecodeFailedException {\n LevelDBImpl impl = new LevelDBImpl(options, dbname);\n VersionEdit version_edit = impl.Recover();\n if (version_edit != null) {\n long log_number = impl.NewFileNumber();\n DataOutputStream log_writer = new DataOutputStream(new FileOutputStream(FileName.LogFileName(dbname, log_number)));\n version_edit.SetLogNumber(log_number);\n \n impl.log_file = log_writer;\n impl.log_num = log_number;\n impl.log = new LogWriter(log_writer);\n impl.version_set.LogAndApply(version_edit);\n \n impl.DeleteObsoleteFiles();\n impl.MaybeScheduleCompaction();\n }\n return impl;\n }",
"public DBManager(Context context){ \n\t\thelper = new DBHelper(context); \n\t\tdb = helper.getWritableDatabase(); \n\t}",
"public void open() {\n\t\tbanco =BancoHelper.getWritableDatabase();\n\t}",
"private void connectDatabase(){\n }",
"public DbAdapter open() throws SQLException{\n\t\tdbHelper = new DbHelper(context);\n\t\tdb = dbHelper.getWritableDatabase();\n\t\treturn this;\n\t}",
"private DatabaseContext() {\r\n datastore = createDatastore();\r\n init();\r\n }",
"private DatabaseAccess(Context context) {\n this.openHelper = new RecipesDatabase(context);\n }",
"public static void createAuthKey() {\n\n String url = \"jdbc:sqlite:c:/Carapaca/server/db/database.db\";\n\n String sql = \"CREATE TABLE IF NOT EXISTS authenticatedkeys (\\n\" + \" id integer PRIMARY KEY AUTOINCREMENT,\\n\"\n + \" id_user integer NOT NULL,\\n\"\n + \" ipaddr text NOT NULL,\\n\"\n + \" publickey text NOT NULL,\\n\"\n + \" FOREIGN KEY(id_user) REFERENCES users(id)\" + \");\";\n\n try (Connection conn = DriverManager.getConnection(url); Statement stmt = conn.createStatement()) {\n stmt.execute(sql);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"private static ByteArrayKeyValueDatabase connectWithLocks(Properties info, Logger log) {\n DBVendor vendor = DBVendor.fromString(info.getProperty(Props.DB_TYPE));\n if (vendor == DBVendor.LEVELDB || vendor == DBVendor.ROCKSDB) {\n return new SpecialLockedDatabase(connectBasic(info, log), log);\n } else {\n return new LockedDatabase(connectBasic(info, log), log);\n }\n }",
"public void openDataBase() throws SQLException {\n try {\n this.createDataBase();\n }\n catch (IOException var1_1) {\n throw new Error(\"Ha sido imposible crear la Base de Datos\");\n }\n this.myDataBase = SQLiteDatabase.openDatabase((String)(DB_PATH + DB_NAME), (SQLiteDatabase.CursorFactory)null, (int)0);\n }",
"@Override\r\n\tprotected void doOpen() throws Exception {\n\t\tAssert.notNull(rootdir, \"rootdir must be specified\");\r\n\t\tAssert.notNull(master, \"master AND database must be set\");\r\n\t\tAssert.notNull(quorum, \"quorum must be set\");\r\n\t\tAssert.notNull(converter, \"converter must be set\");\r\n\t\tconfiguration = HBaseConfiguration.create();\r\n\t\tconfiguration.set(\"hbase.rootdir\", rootdir);\r\n\t\tconfiguration.set(\"hbase.cluster.distributed\", \"true\");\r\n\t\tconfiguration.set(\"hbase.master\", master);\r\n\t\tconfiguration.set(\"hbase.zookeeper.quorum\", quorum);\r\n\t\tconnection = HConnectionManager\r\n\t\t\t\t.createConnection(configuration);\r\n\t}",
"public void open() throws SQLException {\n database = dbHelper.getWritableDatabase();\n }",
"public void open() throws SQLException {\n database = dbHelper.getWritableDatabase();\n }",
"public void open() throws SQLException {\n database = dbHelper.getWritableDatabase();\n }",
"public DBHandler open() throws SQLException\r\n {\r\n DBHelper = new DBHelper(context);\r\n DB = DBHelper.getWritableDatabase();\r\n return this;\r\n }",
"public void openDB(String user, String pass) {\n\n\t\t// Connect to the database\n\t\tString url = \"jdbc:mysql://localhost:2000/X__367_2020?user=\" + user + \"&password=\"+pass;\n\t\t\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(url);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"using url:\"+url);\n\t\t\tSystem.out.println(\"problem connecting to MariaDB: \"+ e.getMessage());\t\t\t\n\t\t\t//e.printStackTrace();\n\t\t}\n\n\t}",
"public Connection openConnection(){\n try {\n c = DriverManager.getConnection(\"jdbc:sqlite:LIB.db\");\n s = c.createStatement();\n\n System.out.println(\"Database connection open\");\n return c;\n }catch (SQLException e) {\n System.err.println(\"Opening connection failed: \" + e.getMessage());\n }\n return null;\n }",
"private void getDatabase(){\n\n }",
"private DatabaseProvider getDatabaseProvider() {\n return new DatabaseProvider(\n System.getProperty(\"url\"),\n System.getProperty(\"user\"),\n System.getProperty(\"password\")\n );\n }",
"public static DatabaseConnection create(String... args) {\n\t\treturn new DatabaseConnection(args);\n\t}",
"@Override\n public SQLiteDatabase openOrCreateDatabase(String name,\n int mode,\n SQLiteDatabase.CursorFactory factory) {\n final File path = getDatabasePath(name);\n Logger.pii(LOG_TAG, \"Opening database through absolute path \" + path.getAbsolutePath());\n return SQLiteDatabase.openOrCreateDatabase(path, null);\n }",
"User setTokenForUser(String username, String token) throws DatabaseException;",
"private DBManager() throws Exception {\n file = new File(\"pdfLibraryDB.mv.db\");\n if (!file.exists()) {\n conn = connect();\n stmt = conn.createStatement();\n query = \"CREATE TABLE user(username VARCHAR(30) PRIMARY KEY, password VARCHAR(32));\" +\n \"CREATE TABLE category(id VARCHAR(30) PRIMARY KEY, name VARCHAR(30), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\"+\n \"CREATE TABLE favorite(id VARCHAR(30) PRIMARY KEY, path VARCHAR(500), keyword VARCHAR(200), searchType VARCHAR(10), category VARCHAR(30),username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY(category) REFERENCES category(id) ON UPDATE CASCADE ON DELETE CASCADE);\" +\n \"CREATE TABLE history(id VARCHAR(30) PRIMARY KEY, keyword VARCHAR(200), type VARCHAR(10), directory VARCHAR(500), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\";\n stmt.executeUpdate(query);\n stmt.close();\n conn.close();\n System.out.println(\"DB created!\");\n }\n }",
"public DatabaseManager open() throws SQLException {\n db = DBHelper.getWritableDatabase();\n return this;\n }",
"DataBase createDataBase();",
"private void open() throws SQLiteException {\n\n database = dbHelper.getWritableDatabase();\n }"
] | [
"0.67784965",
"0.62567025",
"0.617002",
"0.61410075",
"0.6099115",
"0.60818535",
"0.6052261",
"0.5966643",
"0.5936939",
"0.5927332",
"0.59181714",
"0.59138364",
"0.58974785",
"0.587306",
"0.5852364",
"0.5844281",
"0.5838837",
"0.58115053",
"0.578517",
"0.5779101",
"0.5769612",
"0.5758914",
"0.5756299",
"0.5729563",
"0.57215667",
"0.5711659",
"0.5705706",
"0.5705706",
"0.5705706",
"0.5705706",
"0.5705706",
"0.5705415",
"0.56680906",
"0.5645295",
"0.5635969",
"0.56327105",
"0.56297475",
"0.56135124",
"0.558699",
"0.5559775",
"0.55519557",
"0.552799",
"0.5508038",
"0.5499476",
"0.54979414",
"0.5490851",
"0.5484288",
"0.5479962",
"0.5462024",
"0.5438265",
"0.5420425",
"0.5419077",
"0.5413184",
"0.5406425",
"0.540284",
"0.53988993",
"0.539658",
"0.53799677",
"0.5373017",
"0.53724575",
"0.53723437",
"0.5365475",
"0.5350084",
"0.5334452",
"0.53267074",
"0.5313306",
"0.5302919",
"0.5297897",
"0.5291579",
"0.52880603",
"0.5280654",
"0.5280485",
"0.52764493",
"0.5275766",
"0.5264187",
"0.5252529",
"0.525041",
"0.524406",
"0.52412236",
"0.5238047",
"0.52359015",
"0.52232677",
"0.52216744",
"0.521178",
"0.5210712",
"0.520856",
"0.520856",
"0.520856",
"0.5203205",
"0.51941943",
"0.5184599",
"0.5180821",
"0.5172289",
"0.51722246",
"0.51679677",
"0.51582754",
"0.5157883",
"0.5151901",
"0.51447475",
"0.5141823"
] | 0.7022373 | 0 |
The active implicit microtransaction or active/inactive regular transaction. Use the transaction returned by this method if you are doing "system" things that affect both regular database transactions and implicit storage microtransactions wrapping nontransactional operations on the databasestorage level. | OBasicTransaction getMicroOrRegularTransaction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public GlobalTransaction getCurrentTransaction()\n {\n return getCurrentTransaction(true);\n }",
"Transaction getCurrentTransaction();",
"public GlobalTransaction getCurrentTransaction(Transaction tx)\n {\n return getCurrentTransaction(tx, true);\n }",
"public final static Transaction getCurrentTransaction() {\n return (Transaction) transactionTable.get();\n }",
"@Override\n public SimpleTransaction getTransaction() throws SystemException {\n SimpleTransaction txn = txns.get();\n if (txn == null) {\n txn = new SimpleTransaction();\n txn.setStatus(Status.STATUS_ACTIVE);\n txns.set(txn);\n }\n return txn;\n }",
"public GlobalTransaction getCurrentTransaction(boolean createIfNotExists)\n {\n Transaction tx;\n\n if ((tx = getLocalTransaction()) == null)\n {// no transaction is associated with the current thread\n return null;\n }\n\n if (!isValid(tx))\n {// we got a non-null transaction, but it is not active anymore\n int status = -1;\n try\n {\n status = tx.getStatus();\n }\n catch (SystemException e)\n {\n }\n\n // JBCACHE-982 -- don't complain if COMMITTED\n if (status != Status.STATUS_COMMITTED)\n {\n log.warn(\"status is \" + status + \" (not ACTIVE or PREPARING); returning null)\");\n }\n else\n {\n log.trace(\"status is COMMITTED; returning null\");\n }\n\n return null;\n }\n\n return getCurrentTransaction(tx, createIfNotExists);\n }",
"public Object getCurrentTransaction() {\r\n\r\n // Get the current Spring ConnectionHolder associated to the current spring managed transaction\r\n ConnectionHolder holder = (ConnectionHolder) TransactionSynchronizationManager.getResource(dataSource);\r\n\r\n if (holder == null || !holder.isSynchronizedWithTransaction()) {\r\n // no current Spring transaction\r\n SpiTransaction currentEbeanTransaction = DefaultTransactionThreadLocal.get(serverName);\r\n if (currentEbeanTransaction != null){\r\n // NOT expecting this so log WARNING\r\n String msg = \"SpringTransaction - no current spring txn BUT using current Ebean one \"+currentEbeanTransaction.getId();\r\n logger.log(Level.WARNING, msg);\r\n \r\n } else if (logger.isLoggable(Level.FINEST)) {\r\n logger.log(Level.FINEST, \"Spring Txn - no current transaction \");\r\n }\r\n return currentEbeanTransaction;\r\n }\r\n \r\n SpringTxnListener springTxnLister = getSpringTxnListener();\r\n \r\n if (springTxnLister != null){\r\n // we have already seen this transaction \r\n return springTxnLister.getTransaction();\r\n \r\n } else {\r\n // This is a new spring transaction that we have not seen before.\r\n // \"wrap\" it in a SpringJdbcTransaction for use with Ebean \r\n SpringJdbcTransaction newTrans = new SpringJdbcTransaction(holder, transactionManager);\r\n \r\n // Create and register a Spring TransactionSynchronization for this transaction\r\n springTxnLister = createSpringTxnListener(newTrans);\r\n TransactionSynchronizationManager.registerSynchronization(springTxnLister);\r\n \r\n // also put in Ebean ThreadLocal\r\n DefaultTransactionThreadLocal.set(serverName, newTrans);\r\n return newTrans;\r\n }\r\n }",
"public Transaction currentTransaction() {\r\n\t\treturn threadTransaction.get();\r\n\t}",
"protected Transaction getTransaction() {\n return sessionFactory.getCurrentSession().getTransaction();\n }",
"@Override\r\n\t@Transactional\r\n\tpublic Transactions getTransaction() {\r\n\r\n\t\tArrayList<Transactions> closedTransactions=null;\r\n\t\tif(closedTransactions == null)\r\n\t\t{\r\n\t\tclosedTransactions = new ArrayList<Transactions>();\r\n\t\tclosedTransactions = this.getClosedTransactions();\r\n\t\t}\r\n\r\n\r\n\t\tif (index < closedTransactions.size()) {\r\n\t\t\tTransactions transaction = closedTransactions.get(index++);\r\n\t\t\treturn transaction;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"boolean getTransactional();",
"@Override\r\n\tpublic Transaction getTransaction() throws SystemException {\r\n\t\tif (threadTransaction.get()==null)\r\n\t\t\tsetNewTransaction();\r\n\t\treturn threadTransaction.get();\r\n\t}",
"public TransactionIsolation isolation();",
"public boolean isTransactional()\n {\n return _isTransactional;\n }",
"public Transaction startTransaction() {\n Transaction transaction = THREADED_TRANSACTION.get();\n if (transaction == null) {\n transaction = openOrRetrieveSessionForThread().beginTransaction();\n THREADED_TRANSACTION.set(transaction);\n }\n return transaction;\n }",
"Transaction beginTx();",
"public GlobalTransaction getCurrentTransaction(Transaction tx, boolean createIfNotExists)\n {\n // removed synchronization on txTable because underlying implementation is thread safe\n // and JTA spec (section 3.4.3 Thread of Control, par 2) says that only one thread may\n // operate on the transaction at one time so no concern about 2 threads trying to call\n // this method for the same Transaction instance at the same time\n //\n GlobalTransaction gtx = get(tx);\n if (gtx == null && createIfNotExists)\n {\n Address addr = rpcManager.getLocalAddress();\n gtx = GlobalTransaction.create(addr);\n put(tx, gtx);\n TransactionContext transactionContext;\n try\n {\n transactionContext = contextFactory.createTransactionContext(tx);\n }\n catch (Exception e)\n {\n throw new CacheException(\"Unable to create a transaction entry!\", e);\n }\n\n put(gtx, transactionContext);\n if (trace)\n {\n log.trace(\"created new GTX: \" + gtx + \", local TX=\" + tx);\n }\n }\n return gtx;\n }",
"public Transaction getTransaction() throws RuntimeException{\n\t\tif(tr == null)\n\t\t\tthrow new RuntimeException(\"The transaction has not been started\");\n\t\treturn tr;\n\t}",
"public SpringJdbcTransaction getTransaction() {\r\n return transaction;\r\n }",
"public Transaction getTransaction() {\n\t\treturn null;\n\t}",
"public Transaction getTransaction() {\n return transaction;\n }",
"Transaction createTransaction();",
"Transaction getTransaction() { \r\n return tx;\r\n }",
"public Transaction startTransaction(){\n\t\ttr = new Transaction(db);\n\t\treturn tr;\n\t}",
"IDbTransaction beginTransaction(IsolationLevel il);",
"public Transaction startTransaction() {\r\n return getManager().startTransaction();\r\n }",
"public Transaction getTransaction()\n {\n return transaction;\n }",
"public static Transaction getThreadLocalTransaction() {\n return threadlocal.get();\n }",
"public Transaction getTransaction() {\n return this.transaction;\n }",
"private TaskTransaction tx() {\n if (this.taskTx == null) {\n /*\n * NOTE: don't synchronized(this) due to scheduler thread hold\n * this lock through scheduleTasks(), then query tasks and wait\n * for db-worker thread after call(), the tx may not be initialized\n * but can't catch this lock, then cause dead lock.\n * We just use this.eventListener as a monitor here\n */\n synchronized (this.eventListener) {\n if (this.taskTx == null) {\n BackendStore store = this.graph.loadSystemStore();\n TaskTransaction tx = new TaskTransaction(this.graph, store);\n assert this.taskTx == null; // may be reentrant?\n this.taskTx = tx;\n }\n }\n }\n assert this.taskTx != null;\n return this.taskTx;\n }",
"public ArrayList<Transaction> getActiveTransactions() throws SQLException {\n return transactions.getCurrent();\n }",
"Optional<TransactionIsolation> getTransactionIsolation();",
"TransactionManager getTransactionManager();",
"public PlatformTransactionManager getTransactionManager() {\n return _transactionTemplate.getTransactionManager();\n }",
"IDbTransaction beginTransaction();",
"public boolean isTransactionRunning();",
"@Transactional(Transactional.TxType.SUPPORTS)\n\tpublic void supports() {\n\t System.out.println(getClass().getName() + \"Transactional.TxType.SUPPORTS\");\n\t // Here the container will allow the method to be called by a client whether the client already has a transaction or not\n\t}",
"@Override\n\tpublic EntityTransaction getTransaction() {\n\t\treturn null;\n\t}",
"@Override\r\n\t\tpublic int getTransactionIsolation() throws SQLException {\n\t\t\treturn 0;\r\n\t\t}",
"void beginTransaction();",
"@Transactional(Transactional.TxType.NOT_SUPPORTED)\n\tpublic void notSupported() {\n\t System.out.println(getClass().getName() + \"Transactional.TxType.NOT_SUPPORTED\");\n\t // Here the container will make sure that the method will run in no transaction scope and will suspend any transaction started by the client\n\t}",
"public boolean beginTransaction() {\n boolean result = false;\n if (_canDisableAutoCommit) {\n try {\n _connection.setAutoCommit(false);\n result = true;\n } catch (SQLException e) {\n Log.warning(\"Transactions not supported\", this, \"startTransaction\");\n _canDisableAutoCommit = false;\n }\n }\n return result;\n }",
"void readOnlyTransaction();",
"public interface TransactionManager {\n\n\t/**\n\t * Start a new read only transaction.\n\t */\n\n\tStableView view();\n\n\t/**\n\t * Start a transaction for mutation.\n\t */\n\n\tMutableView begin();\n\n\t/**\n\t * Commit a previously prepared transaction for a two phase commit.\n\t *\n\t * @param tpcid\n\t * The client supplied two phase commit identifier.\n\t */\n\n\tvoid commit(String tpcid);\n\n}",
"public boolean is_global_transaction(){\n\t\treturn transaction_type == TransactionType.GLOBAL;\n\t}",
"public static void ignoreTransaction() {\n if (active) {\n TransactionAccess.ignore();\n }\n }",
"@Override\n\tpublic boolean supportsTransactions() {\n\n\t\treturn false;\n\t}",
"protected abstract Object newTransaction(int isolationLevel) throws TransactionInfrastructureException;",
"public Double getTransaction() {\r\n return transaction;\r\n }",
"public TransactionContext startTransaction() {\n MyConnection connection;\n try {\n connection = supplyConnection();\n } catch (SQLException e) {\n throw new UncheckedSQLException(e);\n }\n return new TransactionContext(connection);\n }",
"public javax.resource.spi.LocalTransaction getLocalTransaction()\n throws ResourceException {\n throw new NotSupportedException(resource.getString(\"NO_TRANSACTION\"));\n }",
"interface TransactionSupport {\n\n\n /*\n * Static fields.\n */\n\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_ACTIVE}.\n */\n int STATUS_ACTIVE = 0;\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_MARKED_ROLLBACK}.\n */\n int STATUS_MARKED_ROLLBACK = 1;\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_PREPARED}.\n */\n int STATUS_PREPARED = 2;\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_COMMITTED}.\n */\n int STATUS_COMMITTED = 3;\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_ROLLEDBACK}.\n */\n int STATUS_ROLLEDBACK = 4;\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_UNKNOWN}.\n */\n int STATUS_UNKNOWN = 5;\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_NO_TRANSACTION}.\n */\n int STATUS_NO_TRANSACTION = 6;\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_PREPARING}.\n */\n int STATUS_PREPARING = 7;\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_COMMITTING}.\n */\n int STATUS_COMMITTING = 8;\n\n /**\n * Equal in value and meaning to {@link\n * jakarta.transaction.Status#STATUS_ROLLING_BACK}.\n */\n int STATUS_ROLLING_BACK = 9;\n\n\n /*\n * Method signatures.\n */\n\n\n /**\n * Returns {@code true} if JTA facilities are available.\n *\n * @return {@code true} if JTA facilities are available; {@code\n * false} otherwise\n */\n boolean isEnabled();\n\n /**\n * Returns the {@linkplain Context#isActive() active} {@link\n * Context}, if any, that supports JTA facilities at the moment of\n * invocation, or {@code null}.\n *\n * <p>Implementations of this method may, and often do, return\n * {@code null}.</p>\n *\n * <p>The {@link Context} returned by implementations of this\n * method may become active or inactive at any moment.</p>\n *\n * @return the {@link Context}, if any, that supports JTA\n * facilities, or {@code null}\n *\n * @see Context#isActive()\n */\n Context getContext();\n\n /**\n * Returns a constant indicating the current transaction status.\n *\n * <p>Implementations of this method must return {@link\n * #STATUS_NO_TRANSACTION} ({@code 6}) if JTA is not supported.</p>\n *\n * @return a JTA {@link jakarta.transaction.Status} constant\n * indicating the current transaction status\n */\n int getStatus();\n\n}",
"protected TransactionManager getTransactionManager()\n {\n if (getTransactionIntegration() != null)\n return getTransactionIntegration().getTransactionManager();\n\n return null;\n }",
"public Connection getTransactionConnection(){\n try {\n return rawDataSource.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return null;\n }",
"public void beginTransaction() {\n\r\n\t}",
"public void beginTransaction() throws Exception;",
"public static boolean isActive(Transaction tx)\n {\n if (tx == null) return false;\n int status;\n try\n {\n status = tx.getStatus();\n return status == Status.STATUS_ACTIVE;\n }\n catch (SystemException e)\n {\n return false;\n }\n }",
"public String getTransaction() {\n return transaction;\n }",
"protected abstract Object getTransactionObject() throws TransactionInfrastructureException;",
"public Object doInTransaction(TransactionStatus status) {\n sendEvent();\n sendEvent();\n sendEvent();\n sendEvent();\n status.setRollbackOnly();\n return null;\n }",
"@Nullable\n public Transaction getNonStandard() {\n return nonStandard;\n }",
"public Object getTransactionManager()\n\t{\n\t\treturn transactionManager;\n\t}",
"public int startTransaction();",
"public TransactionConcurrency concurrency();",
"public static Optional<SoftTransactionConfiguration> getCurrentTransactionConfiguration() {\n Object transactionConfig = ExecutorDataMap.getDataMap().get(TRANSACTION_CONFIG);\n return (null == transactionConfig)\n ? Optional.<SoftTransactionConfiguration>absent()\n : Optional.of((SoftTransactionConfiguration) transactionConfig);\n }",
"public interface InstrumentedTransaction extends Transaction, UserDataStorage, DataSourceMember {\n\n /**\n * Returns a unique identifier for this transaction.\n */\n String getTransactionId();\n\n /**\n * Returns the metadata-aware ConnectionProvider that is being used for connections that resulted in this\n * transaction.\n */\n InstrumentedConnectionProvider getConnectionProvider();\n\n /**\n * Returns the timestamp when this transaction began, in nanoseconds since the Unix epoch. If this transaction\n * has not yet begun (from the perspective of the database server), then this method will return zero.\n */\n long getOpenedTimestampNanos();\n\n /**\n * Returns the duration in milliseconds that this transaction has been active. If the transaction object has been\n * created but the transaction has not yet begun, then this method will return <code>-1</code>.\n */\n long getDurationNanos();\n\n /**\n * Returns the Connection currently associated with this Transaction, if one has been leased already. If there is no\n * connection attached and connected, then this method will return <code>null</code> rather than forcing the\n * acquisition of one now.\n */\n InstrumentedConnection getConnection();\n\n /**\n * Attaches a single transaction listener instance to this transaction. Whenever this transaction performs any\n * operations, it will invoke callbacks on any attached listeners.\n */\n void addTransactionListener(TransactionListener listener);\n\n /**\n * Returns the optional user data object that may have been attached to this transaction.\n */\n Object getUserData();\n\n /**\n * Attaches a custom user data object to this transaction. This user data object will be removed automatically as\n * soon as the transaction is finished.\n */\n void setUserData(Object userData);\n}",
"public boolean createTransaction() {\n\t\t\treturn false;\n\t\t}",
"public interface IndexTransaction\n{\n\tpublic static final int STATUS_ACTIVE = 0;\n\n\tpublic static final int STATUS_COMMITTED = 3;\n\n\tpublic static final int STATUS_COMMITTING = 8;\n\n\tpublic static final int STATUS_MARKED_ROLLBACK = 1;\n\n\tpublic static final int STATUS_NO_TRANSACTION = 6;\n\n\tpublic static final int STATUS_PREPARED = 2;\n\n\tpublic static final int STATUS_PREPARING = 7;\n\n\tpublic static final int STATUS_ROLLEDBACK = 4;\n\n\tpublic static final int STATUS_ROLLING_BACK = 9;\n\n\tpublic static final int STATUS_UNKNOWN = 5;\n\n\tpublic static final String[] TRANSACTION_STATUS = { \"Created\", \"Marked for Rollback\",\n\t\t\t\"Prepared\", \"Committed\", \"Rolled Back\", \"Unknown\", \"No Transaction\",\n\t\t\t\"Preparing\", \"Committing\", \"Rolling Back\" };\n\n\tpublic static final boolean[] TRANSACTION_ACTIVE = { true, false, true, false, false,\n\t\t\tfalse, false, true, false, false };\n\n\t/**\n\t * Prepare to commit this transaction, all the work is done, but all the\n\t * listeners need to be ready and able to performa commit without failure\n\t */\n\tvoid prepare() throws IndexTransactionException;\n\n\t/**\n\t * Commit the transaction and make it available to others in the cluster\n\t * \n\t * @throws IndexTransactionException\n\t */\n\tvoid commit() throws IndexTransactionException;\n\n\t/**\n\t * @throws IndexTransactionException\n\t * if the transaction is not open\n\t */\n\tvoid rollback() throws IndexTransactionException;\n\n\t/**\n\t * @return\n\t */\n\tlong getTransactionId();\n\n\t/**\n\t * @throws IndexTransactionException\n\t */\n\tvoid close() throws IndexTransactionException;\n\n\t/**\n\t * get the transaction status\n\t * \n\t * @return\n\t */\n\tint getStatus();\n\n\t/**\n\t * get an Object from the transaction, that may have been placed in the\n\t * transaction by earlier phases.\n\t * \n\t * @param key\n\t * @return\n\t */\n\tObject get(String key);\n\n\t/**\n\t * Clear an object placed in the transaction\n\t * \n\t * @param key\n\t */\n\tvoid clear(String key);\n\n\t/**\n\t * Put an object into the transaction for use in later phases\n\t * \n\t * @param key\n\t * @param obj\n\t */\n\tvoid put(String key, Object obj);\n\n\t/**\n\t * @throws IndexTransactionException\n\t */\n\tvoid open() throws IndexTransactionException;\n\n}",
"public interface TransactionService {\n\n /**\n * @return TransactionManager\n */\n TransactionManager getTransactionManager();\n\n /**\n * @return UserTransaction\n */\n UserTransaction getUserTransaction();\n\n /**\n * @return default timeout in seconds\n */\n int getDefaultTimeout();\n\n /**\n * Sets timeout in seconds,\n * \n * @param seconds int\n * @throws SystemException\n */\n void setTransactionTimeout(int seconds) throws SystemException;\n\n /**\n * Enlists XA resource in transaction manager.\n * \n * @param xares XAResource\n * @throws RollbackException\n * @throws SystemException\n */\n void enlistResource(ExoResource xares) throws RollbackException, SystemException;\n\n /**\n * Delists XA resource from transaction manager.\n * \n * @param xares XAResource\n * @throws RollbackException\n * @throws SystemException\n */\n void delistResource(ExoResource xares) throws RollbackException, SystemException;\n\n /**\n * Creates unique XA transaction identifier.\n * \n * @return Xid\n */\n Xid createXid();\n\n}",
"public void createTransaction(Transaction trans);",
"public HibernateTransactionTemplate getHibernateTransactionTemplate() {\n return new HibernateTransactionTemplate();\n }",
"public boolean use1PcForAutoCommitTransactions() {\n return use1PcForAutoCommitTransactions;\n }",
"public void openTheTransaction() {\n openTransaction();\n }",
"private TransactionManager obtainTransactionManager()\n {\n TransactionManager tm = ec.getNucleusContext().getJtaTransactionManager();\n if (tm == null)\n {\n throw new NucleusTransactionException(LOCALISER.msg(\"015030\"));\n }\n else\n {\n return tm;\n }\n }",
"public TransID beginTransaction()\n {\n\t //TransID tid = new TransID();\n\t Transaction collect_trans = new Transaction(this);\n\t atranslist.put(collect_trans);\n\t return collect_trans.getTid();\n }",
"@Override\n public void begin() throws NotSupportedException, SystemException {\n SimpleTransaction txn = getTransaction();\n int status = txn.getStatus();\n if (status == Status.STATUS_COMMITTED || status == Status.STATUS_ROLLEDBACK || status == Status.STATUS_UNKNOWN\n || status == Status.STATUS_ACTIVE)\n txn.setStatus(Status.STATUS_ACTIVE);\n else\n throw new IllegalStateException(\"Can not begin \" + txn);\n }",
"public static Transaction getRequiredThreadLocalTransaction() {\n Transaction tx = threadlocal.get();\n\n if (tx == null) {\n throw new NoTransactionFoundException(\"No transaction is found on the ThreadLocalTransaction\");\n }\n\n return tx;\n }",
"public Session createTransactionAwareSession() throws TopLinkException {\n\t\tthrow new UnsupportedOperationException(\"SingleSessionFactory does not support transaction-aware Sessions\");\n\t}",
"public String getmDefaultTransaction() {\n return mDefaultTransaction;\n }",
"public Object getObject()\n\t{\n\t\treturn transactionManager;\n\t}",
"@Override\n\tpublic EquationStandardTransaction getTransaction() throws Exception\n\t{\n\t\tEquationStandardTransaction transaction = getEquationStandardTransaction(programName + optionId);\n\t\ttransaction.setWorkStationId(WORKSTATIONID);\n\t\treturn transaction;\n\t}",
"@Override\n\tpublic EquationStandardTransaction getTransaction() throws Exception\n\t{\n\t\tEquationStandardTransaction transaction = getEquationStandardTransaction(programName + optionId);\n\t\ttransaction.setWorkStationId(WORKSTATIONID);\n\t\treturn transaction;\n\t}",
"@Override\n\tpublic EquationStandardTransaction getTransaction() throws Exception\n\t{\n\t\tEquationStandardTransaction transaction = getEquationStandardTransaction(programName + optionId);\n\t\ttransaction.setWorkStationId(WORKSTATIONID);\n\t\treturn transaction;\n\t}",
"@Override\n\tpublic EquationStandardTransaction getTransaction() throws Exception\n\t{\n\t\tEquationStandardTransaction transaction = getEquationStandardTransaction(programName + optionId);\n\t\ttransaction.setWorkStationId(WORKSTATIONID);\n\t\treturn transaction;\n\t}",
"public boolean isLocalTransaction()\n {\n if (_connectionConfig.isReadOnly())\n return false;\n else if (_driverList.size() > 0) {\n DriverConfig driver = _driverList.get(0);\n \n return driver.isLocalTransaction();\n }\n else\n return false;\n }",
"public boolean hasActiveTx()\n{\n\treturn depth > 0;\n}",
"@Bean\n ODatabaseDocumentTx getODatabaseDocumentTx() {\n return factory().createPool().acquire();\n }",
"public interface ITransaction extends Serializable {\n /**\n * Open a transaction.\n * @throws Exception exception.\n */\n void open() throws Exception;\n\n /**\n * Close the current transaction.\n * @throws Exception exception.\n */\n void close() throws Exception;\n\n /**\n * Return true if transaction is opened.\n * @return true/false.\n * @throws Exception exception.\n */\n boolean isOpened() throws Exception;\n\n /**\n * Return true if transaction is marked as rollabck.\n * @return true/false.\n * @throws Exception exception.\n */\n boolean isMarkedRollback() throws Exception;\n\n /**\n * Join current transaction.\n * @throws Exception exception.\n */\n void join() throws Exception;\n\n /**\n * Unjoin current transaction.\n * @throws Exception exception.\n */\n void unjoin() throws Exception;\n}",
"@Override\n public Object doInTransaction(TransactionStatus transactionStatus) {\n transactionStatus.setRollbackOnly();\n return null;\n }",
"@Test\n public void testTransactional() throws Exception {\n try (CloseableCoreSession session = coreFeature.openCoreSessionSystem()) {\n IterableQueryResult results = session.queryAndFetch(\"SELECT * from Document\", \"NXQL\");\n TransactionHelper.commitOrRollbackTransaction();\n TransactionHelper.startTransaction();\n assertFalse(results.mustBeClosed());\n assertWarnInLogs();\n }\n }",
"void beginTransaction(ConnectionContext context) throws IOException;",
"public boolean transactionStarted();",
"Transaction createTransaction(Settings settings);",
"public boolean is_record_transaction(){\n\t\treturn transaction_type == TransactionType.OPERATION;\n\t}",
"@Test\n public void existingTransaction() {\n Transaction t1 = startTransaction();\n IntRef intValue = new IntRef(10);\n t1.commit();\n\n Transaction t2 = startTransaction();\n assertEquals(10, intValue.get());\n\n intValue.inc();\n assertEquals(11, intValue.get());\n t2.commit();\n }",
"public boolean isRunInBackgroundTransaction () {\n return runInBackgroundTransaction;\n }",
"@Override\n\tpublic void createTransaction(Transaction t) { \n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction(); \n\n\t\t/* save */ \n\t\tsession.save(t);\n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\t}",
"void startTransaction();",
"public TransactionStatus getStatus() {\n return status;\n }",
"public Transaction getTransaction(int id){\n return accSystem.get(id);\n }"
] | [
"0.7755285",
"0.76654655",
"0.72753453",
"0.7158676",
"0.70968956",
"0.70745975",
"0.70102954",
"0.6881463",
"0.67931443",
"0.671026",
"0.66566384",
"0.66437393",
"0.64952564",
"0.6450906",
"0.6409189",
"0.63840026",
"0.6378296",
"0.6377901",
"0.6311305",
"0.6308209",
"0.6268032",
"0.6260167",
"0.62443733",
"0.62367535",
"0.6220949",
"0.62139726",
"0.62124896",
"0.61965626",
"0.6153431",
"0.60948527",
"0.60860866",
"0.6052516",
"0.60451686",
"0.6037539",
"0.60101914",
"0.6006805",
"0.60041165",
"0.59885836",
"0.59865534",
"0.5953101",
"0.59249073",
"0.59123987",
"0.5907851",
"0.590663",
"0.58806026",
"0.5880182",
"0.58773977",
"0.58670557",
"0.5836241",
"0.5826282",
"0.5820272",
"0.58197325",
"0.5814521",
"0.5810925",
"0.5780852",
"0.578063",
"0.57269126",
"0.56975967",
"0.569603",
"0.56805176",
"0.56778246",
"0.5669157",
"0.56668997",
"0.56661755",
"0.56660885",
"0.5662936",
"0.56362605",
"0.5621518",
"0.56011343",
"0.55952466",
"0.55897075",
"0.55758595",
"0.5569873",
"0.5560312",
"0.55567586",
"0.5544447",
"0.55431724",
"0.5535694",
"0.55270916",
"0.5526657",
"0.5524079",
"0.5524079",
"0.5524079",
"0.5524079",
"0.550111",
"0.55001044",
"0.54955095",
"0.54888",
"0.5480883",
"0.5470016",
"0.54625803",
"0.545486",
"0.54314864",
"0.542788",
"0.5426894",
"0.54256094",
"0.54165727",
"0.5411321",
"0.5407231",
"0.54048723"
] | 0.7860662 | 0 |
returns the cluster map for current deploy. The keys of the map are node names, the values contain names of clusters (data files) available on the single node. | default String getLocalNodeName() {
return "local";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"default Map<String, Set<String>> getActiveClusterMap() {\n Map<String, Set<String>> result = new HashMap<>();\n result.put(getLocalNodeName(), getStorage().getClusterNames());\n return result;\n }",
"public Map<String, String> getDistributedDevicePathToClusterMap()\n throws VPlexApiException {\n return _discoveryMgr.getDistributedDevicePathToClusterMap();\n }",
"public Map<String, String> getClusterIdToNameMap() {\n if (vplexClusterIdToNameCache.isEmpty()) {\n List<VPlexClusterInfo> clusterInfos = getClusterInfoLite();\n for (VPlexClusterInfo clusterInfo : clusterInfos) {\n vplexClusterIdToNameCache.put(clusterInfo.getClusterId(), clusterInfo.getName());\n }\n s_logger.info(\"refreshed cluster id to name map is \" + vplexClusterIdToNameCache.toString());\n }\n\n return vplexClusterIdToNameCache;\n }",
"default Map<String, Set<String>> getActiveDataCenterMap() {\n Map<String, Set<String>> result = new HashMap<>();\n Set<String> val = new HashSet<>();\n val.add(getLocalNodeName());\n result.put(\"local\", val);\n return result;\n }",
"public String getCluster() {\n return this.cluster;\n }",
"public String getCluster() {\n return this.cluster;\n }",
"io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();",
"String getClusterName();",
"java.lang.String getClusterName();",
"public ClusterConfig getClusterConfig() {\n return cluster;\n }",
"@Override\n\tpublic java.lang.String getCluster() {\n\t\treturn _scienceApp.getCluster();\n\t}",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterBytes() {\n java.lang.Object ref = cluster_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n cluster_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public com.google.protobuf.ByteString\n getClusterBytes() {\n java.lang.Object ref = cluster_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n cluster_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public java.lang.String getCluster() {\n java.lang.Object ref = cluster_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n cluster_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public Map<ConstraintType, ClusterConstraints> getConstraintMap() {\n return _constraintMap;\n }",
"public com.tangosol.net.Cluster getCluster()\n {\n return __m_Cluster;\n }",
"com.google.protobuf.ByteString\n getClusterNameBytes();",
"@Override\n @GET\n @Produces(\"application/json\")\n public Response getCluster() throws JSONException {\n if (log.isTraceEnabled()) {\n log.trace(String.format(\"getCluster(ID=%d) started.\", cluster.getClusterId()));\n }\n\n JSONObject json = cluster.toJSON();\n\n json.put(\"uri\", rootUri);\n json.put(\"servers\", rootUri + \"/servers\");\n json.put(\"vms\", rootUri + \"/vms\");\n\n return Response.ok(json.toString()).build();\n }",
"@java.lang.Override\n public java.lang.String getCluster() {\n java.lang.Object ref = cluster_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n cluster_ = s;\n return s;\n }\n }",
"public SME_Cluster[] getClusters();",
"java.util.Map<String, String>\n getReplicationMap();",
"public CustomClusterManager getClusterManager(){\n return mClusterManager;\n }",
"public int[] getCluster() {\r\n return this.clusters[this.clusterIndex];\r\n }",
"public Map<String, INode> getNodeMap() {\n\n return Collections.unmodifiableMap(nodeMap);\n }",
"Map getConnectionManagerMap();",
"public String getClusterId() {\n return this.ClusterId;\n }",
"io.envoyproxy.envoy.type.metadata.v3.MetadataKind.ClusterOrBuilder getClusterOrBuilder();",
"@Override\n\n public java.util.Map<String, String> getReplicationMap() {\n return internalGetReplication().getMap();\n }",
"public Map<String, String> getInitiatorWwnToNameMap(String clusterName) {\n return _discoveryMgr.getInitiatorWwnToNameMap(clusterName);\n }",
"@Override\n\n public java.util.Map<String, String> getReplicationMap() {\n return internalGetReplication().getMap();\n }",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"public String getClusterId() {\n return clusterId;\n }",
"public java.util.Map<java.lang.String, java.lang.String> getAppClientParas() {\n return internalGetAppClientParas().getMap();\n }",
"public java.util.Map<java.lang.String, java.lang.String> getAppClientParas() {\n return internalGetAppClientParas().getMap();\n }",
"DescribeClustersResult describeClusters(DescribeClustersRequest describeClustersRequest);",
"public String clusterId() {\n return this.clusterId;\n }",
"@Override\n public Map<String, String> createDefaultClusterRole(String rolename) throws\n HoyaException, IOException {\n Map<String, String> rolemap = new HashMap<String, String>();\n if (rolename.equals(HBaseKeys.ROLE_MASTER)) {\n // master role\n Configuration conf = ConfigHelper.loadMandatoryResource(\n \"org/apache/hoya/providers/hbase/role-hbase-master.xml\");\n HoyaUtils.mergeEntries(rolemap, conf);\n } else if (rolename.equals(HBaseKeys.ROLE_WORKER)) {\n // worker settings\n Configuration conf = ConfigHelper.loadMandatoryResource(\n \"org/apache/hoya/providers/hbase/role-hbase-worker.xml\");\n HoyaUtils.mergeEntries(rolemap, conf);\n }\n return rolemap;\n }",
"public java.util.List<EinsteinClusterTracker.Cluster> getClusters() {\n return this.clusters;\n }",
"java.util.List<String>\n getClusteringKeyList();",
"EffectiveClusterSpec getCluster(ClusterSpec clusterSpec);",
"public String getCacheClusterSize() {\n return cacheClusterSize;\n }",
"public TrackerCluster getCluster() {return _cluster;}",
"public Map<String, Object> map() {\n Map<String, Object> tomcatInstanceMap = new HashMap<>();\n tomcatInstanceMap.put(\"instanceUUID\", tomcatInstanceUUID);\n tomcatInstanceMap.put(\"instanceName\", instanceName);\n tomcatInstanceMap.put(\"environmentName\", environmentName);\n tomcatInstanceMap.put(\"tomcatVersion\", tomcatVersion);\n tomcatInstanceMap.put(\"destinationFolder\", destinationFolder.getAbsolutePath());\n tomcatInstanceMap.put(\"compressed\", compressed);\n tomcatInstanceMap.put(\"primaryPort\", primaryPort);\n tomcatInstanceMap.put(\"protocolPrimaryPort\", protocolPrimaryPort);\n tomcatInstanceMap.put(\"shutdownPort\", shutdownPort);\n tomcatInstanceMap.put(\"ajpPort\", ajpPort);\n tomcatInstanceMap.put(\"secureInstance\", secureInstance);\n tomcatInstanceMap.put(\"securePort\", securePort);\n tomcatInstanceMap.put(\"protocolSecurePort\", protocolSecurePort);\n tomcatInstanceMap.put(\"keystoreSourceFilename\", keystoreSourceFilename);\n tomcatInstanceMap.put(\"keystoreCredentials\", keystoreCredentials);\n tomcatInstanceMap.put(\"jvmOptionXms\", jvmOptionXms);\n tomcatInstanceMap.put(\"jvmOptionXmx\", jvmOptionXmx);\n tomcatInstanceMap.put(\"jvmOptionXss\", jvmOptionXss);\n tomcatInstanceMap.put(\"jvmOptionXXMaxMetaspaceSize\", jvmOptionXXMaxMetaspaceSize);\n tomcatInstanceMap.put(\"jvmOptions\", jvmOptions);\n tomcatInstanceMap.put(\"instanceManagement\", instanceManagement);\n /**\n * Serialize our Instance Management Properties\n */\n List<Map<String,String>> instanceManagementPropertiesMapList =\n new ArrayList<>(instanceManagementProperties.size());\n for(TomcatInstanceProperty tomcatInstanceProperty : instanceManagementProperties) {\n instanceManagementPropertiesMapList.add(tomcatInstanceProperty.map());\n }\n tomcatInstanceMap.put(\"instanceManagementProperties\", instanceManagementPropertiesMapList);\n /**\n * Serialize our Instance Properties\n */\n List<Map<String,String>> instancePropertiesMapList =\n new ArrayList<>(instanceProperties.size());\n for(TomcatInstanceProperty tomcatInstanceProperty : instanceProperties) {\n instancePropertiesMapList.add(tomcatInstanceProperty.map());\n }\n tomcatInstanceMap.put(\"instanceProperties\", instancePropertiesMapList);\n /**\n * Return the Map for Persisting as YAML.\n */\n return tomcatInstanceMap;\n }",
"java.util.List<com.zibea.recommendations.webserver.core.dao.proto.AttributesMapProto.Map.KeyValue> \n getNodesList();",
"public String clusterId() {\n return this.innerProperties() == null ? null : this.innerProperties().clusterId();\n }",
"public java.lang.String getClusterName() {\n return clusterName;\n }",
"public Map getPartitionMap(int nPid);",
"public String getClusterIdentifier() {\n return this.clusterIdentifier;\n }",
"public ArrayList<NodeRef> getDataNodes() {\r\n\t\tArrayList<NodeRef> slaves = new ArrayList<NodeRef>();\r\n\t\tfor (NodeRef node : nodeMap.values()) {\r\n\t\t\tslaves.add(node);\r\n\t\t}\r\n\t\treturn slaves;\r\n\t}",
"public Map<String, String> buildSiteConfFromSpec(ClusterDescription clusterSpec)\n throws BadConfigException {\n\n Map<String, String> master = clusterSpec.getMandatoryRole(\n HBaseKeys.ROLE_MASTER);\n\n Map<String, String> worker = clusterSpec.getMandatoryRole(\n HBaseKeys.ROLE_WORKER);\n\n Map<String, String> sitexml = new HashMap<String, String>();\n \n //map all cluster-wide site. options\n providerUtils.propagateSiteOptions(clusterSpec, sitexml);\n/*\n //this is where we'd do app-indepdenent keytabs\n\n String keytab =\n clusterSpec.getOption(OptionKeys.OPTION_KEYTAB_LOCATION, \"\");\n \n*/\n\n\n sitexml.put(KEY_HBASE_CLUSTER_DISTRIBUTED, \"true\");\n sitexml.put(KEY_HBASE_MASTER_PORT, \"0\");\n\n sitexml.put(KEY_HBASE_MASTER_INFO_PORT, master.get(\n RoleKeys.APP_INFOPORT));\n sitexml.put(KEY_HBASE_ROOTDIR,\n clusterSpec.dataPath);\n sitexml.put(KEY_REGIONSERVER_INFO_PORT,\n worker.get(RoleKeys.APP_INFOPORT));\n sitexml.put(KEY_REGIONSERVER_PORT, \"0\");\n providerUtils.propagateOption(clusterSpec, OptionKeys.ZOOKEEPER_PATH,\n sitexml, KEY_ZNODE_PARENT);\n providerUtils.propagateOption(clusterSpec, OptionKeys.ZOOKEEPER_PORT,\n sitexml, KEY_ZOOKEEPER_PORT);\n providerUtils.propagateOption(clusterSpec, OptionKeys.ZOOKEEPER_HOSTS,\n sitexml, KEY_ZOOKEEPER_QUORUM);\n\n return sitexml;\n }",
"public Cluster[] getClusters () {\n if (clusters != null) {\n return clusters;\n }\n \n try {\n List sort = org.openide.util.Utilities.topologicalSort (allPages.keySet (), deps);\n \n // ok, no cycles in between pages\n clusters = new Cluster[sort.size ()];\n for (int i = 0; i < clusters.length; i++) {\n clusters[i] = new Cluster (Collections.singleton (findPage ((String)sort.get (i))));\n }\n } catch (org.openide.util.TopologicalSortException ex) {\n // ok, there are cycles\n \n Set[] sets = ex.topologicalSets();\n clusters = new Cluster[sets.length];\n for (int i = 0; i < clusters.length; i++) {\n Set s = new TreeSet ();\n Iterator it = sets[i].iterator();\n while (it.hasNext ()) {\n String name = (String)it.next ();\n Page p = findPage (name);\n if (p != null) {\n s.add (p);\n }\n }\n clusters[i] = new Cluster (s);\n }\n }\n \n // references <Page -> Cluster>\n refs = new HashMap ();\n for (int i = 0; i < clusters.length; i++) {\n java.util.Iterator it = clusters[i].getPages ().iterator ();\n while (it.hasNext()) {\n Page p = (Page)it.next ();\n refs.put (p, clusters[i]);\n }\n }\n \n for (int i = 0; i < clusters.length; i++) {\n Set references = new HashSet ();\n java.util.Iterator it = clusters[i].getPages ().iterator ();\n while (it.hasNext()) {\n Page contained = (Page)it.next ();\n Collection c = (Collection)deps.get (contained.getFileName());\n if (c != null) {\n Iterator d = c.iterator();\n while (d.hasNext()) {\n String pageName = (String)d.next ();\n references.add (refs.get (findPage (pageName)));\n }\n }\n }\n // prevent self references\n references.remove (clusters[i]);\n clusters[i].references = (Cluster[])references.toArray (new Cluster[0]);\n }\n \n return clusters;\n }",
"public Collection<String> getContigs() {\n\t\treturn infoMap.keySet();\n\t}",
"public int getNumClusters() {\n return clusters.size();\n }",
"public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}",
"public String getClusterAddress() {\r\n return clusterAddress;\r\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic Map<String,List<ContentItem>> getTagDocCluster() {\r\n\t\tSet<String> tagLabels = getDistinctTagLabels();\r\n\t\t\r\n\t\tList<ContentItem> pages = new ArrayList<ContentItem>(getTaggedPages()); \r\n\r\n\t\tSpectralClusterBean [][] spectralClusterBeans = new SpectralClusterBean[tagLabels.size()][pages.size()];\r\n\t\t\r\n\t\tList<String> tagCollection = new ArrayList(tagLabels);\r\n\r\n\t\tfor (int i = 0; i < tagCollection.size(); i++) {\r\n\t\t\tfor (int j = 0; j < pages.size(); j++) {\r\n\t\t\t\tfloat tagFrequency = taggingService.getTagFrequencyByContentItem(((String)tagCollection.get(i)).toLowerCase() , pages.get(j), new Float(pages.size()));\r\n\t\t//\t\tSystem.out.println(\" tag \"+((String)tagCollection.get(i)).toLowerCase() +\" has freq \" + tagFrequency+\" for page \"+pages.get(j).getTitle());\r\n\t\t\t\tspectralClusterBeans[i][j] = new SpectralClusterBean(pages.get(j).getId(),(String)tagCollection.get(i),i,j,tagFrequency);\r\n\t\t\t}\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\tdouble [][] userTags = new double[tagCollection.size()][pages.size()];\r\n\t\tfor (int i = 0; i < tagCollection.size(); i++) {\r\n\t\t\tfor (int j = 0; j < pages.size(); j++) {\r\n\t\t\t\tuserTags[i][j] = (double)spectralClusterBeans[i][j].getScore();\t\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\tSpectralClusteringModel spectralClusteringRecommendation = new SpectralClusteringModel();\r\n\t\tMatrix frequencyMatrix = new Matrix(userTags);\r\n\t\t\r\n\t\tSingularValueDecomposition singularValueDecomposition=null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tsingularValueDecomposition = spectralClusteringRecommendation.computeLeftSigularValueDecompositionMatrix(frequencyMatrix);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tDataset[] dataSets = null;\r\n\t\ttry {\r\n\t\t\tdataSets = spectralClusteringRecommendation.clusterSpectralClusteringMatrix(singularValueDecomposition);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tMap<Set<Double>,Set<Double>> mapClusters = getMappingPositions(dataSets);\r\n\t\t\r\n\t\tMap<String,List<ContentItem>> showCLuster = new HashMap<String, List<ContentItem>>();\t\r\n\r\n\t\tfor (Set<Double> keys : mapClusters.keySet()) {\r\n\t\t\tStringBuffer tagStringBuffer = new StringBuffer();\r\n\t\t\tfor (Double tagPos : keys) {\r\n\t\t\t\ttagStringBuffer.append((spectralClusterBeans[tagPos.intValue()][0]).getTagLabel());\r\n\t\t\t\ttagStringBuffer.append(\"+\");\r\n\t\t\t}\r\n\t\t\tSet<ContentItem> cis = new HashSet<ContentItem>(); \r\n\t\t\t\r\n\t\t\tfor (Double tagPos : keys) {\r\n\t\t\t\tfor (int i = 0; i < pages.size(); i++) {\r\n\t\t\t\t\tif (spectralClusterBeans[tagPos.intValue()][i].getScore()>0) {\r\n\t\t\t\t\t\tLong ciId = spectralClusterBeans[tagPos.intValue()][i].getContentItemId();\r\n\t\t\t\t\t\tContentItem contentItem = getPagesById(ciId);\r\n\t\t\t\t\t\tcis.add(contentItem);\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tshowCLuster.put(tagStringBuffer.substring(0,tagStringBuffer.lastIndexOf(\"+\")), new ArrayList(cis));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn showCLuster;\r\n\t}",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"public static Map<String, Client> getClientMap() {\r\n return clientMap;\r\n }",
"public java.lang.Integer getClusterSize() {\n return clusterSize;\n }",
"public Map<String, Component> getMapa_componentes() {\r\n\t\treturn tabboxContendor.getMapa_componentes();\r\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic List<String> getClusterIDs() {\r\n\t\tArrayList<String> clusterIDs = new ArrayList<String>();\r\n\t\t//xPath expression to get the classname\r\n\t\tString xPath = \"//jdbcluster/clustertype/cluster\";\r\n\r\n\t\tList<Node> nodes = document.selectNodes(xPath);\r\n\t\tif(nodes != null) {\r\n\t\t\tfor(Node n : nodes){\r\n\t\t\t\tclusterIDs.add(n.valueOf(\"@id\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn clusterIDs;\r\n\t}",
"public Boolean getCacheClusterEnabled() {\n return cacheClusterEnabled;\n }",
"public File cluster() throws IOException, InterruptedException {\n Runtime r = Runtime.getRuntime();\n Process p = r.exec(mclExecutablePath + \" \" + fileName + \" -o \" + fileName + \".I20\");\n p.waitFor();\n clusterResultFile = new File(fileName + \".I20\");\n return clusterResultFile;\n }",
"public List<VPlexClusterInfo> getClusterInfoDetails() throws VPlexApiException {\n s_logger.info(\"Request for complete detailed cluster info for VPlex at {}\", _baseURI);\n return _discoveryMgr.getClusterInfo(false, true);\n }",
"public List<VPlexClusterInfo> getClusterInfoLite() throws VPlexApiException {\n s_logger.info(\"Request for lightweight cluster info for VPlex at {}\", _baseURI);\n if (vplexClusterInfoLiteCache.isEmpty()) {\n vplexClusterInfoLiteCache.addAll(_discoveryMgr.getClusterInfo(true, false));\n s_logger.info(\"refreshed lightweight cluster info list is \" + vplexClusterInfoLiteCache.toString());\n }\n\n return vplexClusterInfoLiteCache;\n }",
"public int getClusterSize() {\r\n \treturn this.clusterSize;\r\n }",
"public com.google.protobuf.ByteString\n getClusterNameBytes() {\n java.lang.Object ref = \"\";\n if (endpointConfigCase_ == 2) {\n ref = endpointConfig_;\n }\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n if (endpointConfigCase_ == 2) {\n endpointConfig_ = b;\n }\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@Override\n\tpublic long getClusterId() {\n\t\treturn model.getClusterId();\n\t}",
"public ImmutableMap<String, Boolean> getAttributeClusteringConfig();",
"public String getCloudHsmClusterId() {\n return this.cloudHsmClusterId;\n }",
"boolean hasCluster();",
"public String getClusterName() {\n\t\treturn clusterName;\n\t}",
"public List<Object> invokeMapReduce(Invoker invoker) {\n List<Pair<Pair<Short, Integer>, String>> list = clientConnections.getMapClientFromAll();\n List<KeyCluster> keyClusterList = new ArrayList<KeyCluster>(list.size());\n for ( Pair<Pair<Short, Integer>, String> each : list) {\n //key is represented by node 1 separate by , total nodes example 1,3\n //will passed by key to store proc to determine the how partition data node\n KeyCluster keyCluster = new KeyCluster(each.getFirst().getFirst(), Key.createKey(each.getSecond()),\n each.getFirst().getSecond() );\n keyClusterList.add( keyCluster);\n }\n //add Key must be true, key carry information about how to split cluster\n return executeStoreProc(invoker, keyClusterList, true);\n }",
"private Map<String, DataContainer> getDataContainerMap() {\r\n\r\n if (this.dataContainerMap == null) {\r\n if (this.dataContainerList == null) {\r\n parse();\r\n }\r\n\r\n this.dataContainerMap = new HashMap<>();\r\n for (DataContainer dataContainer : this.dataContainerList) {\r\n this.dataContainerMap.put(dataContainer.getVariableName(), dataContainer);\r\n }\r\n }\r\n return this.dataContainerMap;\r\n }",
"public static Map<String, String> getMapping() {\n\t\treturn ThreadContext.getMapping();\n\t}",
"@Override\n\tpublic Map<String, Map<Integer, List<String>>> getOverlayNetwork() throws TimeSeriesException {\n\t\tIConfig configurationService = ServiceFactory.getConfigurationService();\n\t\tMap<String, Map<Integer, List<String>>> overlayNetwork = configurationService.getOverlayNetwork(this.clusterName);\n\t\t//configurationService.close();\n\t\treturn overlayNetwork;\n\t}",
"public long getNClusters() {\n return cGetNClusters(this.cObject);\n }",
"public OpenIntIntHashMap getClusterSizes() {\n\n if (sizeMap != null) return sizeMap;\n\n sizeMap = new OpenIntIntHashMap();\n\n ValueIterator imageIterator = labelledVolume.valueIterator();\n //Map<Integer, Integer> sizes = new HashMap<Integer, Integer>();\n\n do {\n int label = (int) imageIterator.next();\n if (label > 0) {\n if (sizeMap.containsKey(label)) {\n int crt = sizeMap.get(label) + 1;\n sizeMap.put(label, crt);\n } else {\n sizeMap.put(label, 1);\n }\n }\n\n\n } while (imageIterator.hasNext());\n\n return sizeMap;\n }",
"public Map getPartitionMap(PartitionSet partitions);",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }"
] | [
"0.7194086",
"0.7031039",
"0.63740027",
"0.6236113",
"0.5910831",
"0.5910831",
"0.5905066",
"0.5889952",
"0.5834386",
"0.58161587",
"0.57949483",
"0.57916355",
"0.57210386",
"0.5655143",
"0.56470054",
"0.5628712",
"0.559838",
"0.5591501",
"0.5585798",
"0.5578832",
"0.55695456",
"0.5460155",
"0.5457804",
"0.53873193",
"0.536964",
"0.53631866",
"0.5350625",
"0.53471947",
"0.53428996",
"0.53348744",
"0.53258294",
"0.53258294",
"0.53258294",
"0.53258294",
"0.53258294",
"0.53258294",
"0.5304475",
"0.5272078",
"0.5264227",
"0.5243573",
"0.5234304",
"0.5234092",
"0.5211483",
"0.5201226",
"0.5200711",
"0.51991767",
"0.51769066",
"0.51738983",
"0.5159305",
"0.5137139",
"0.51241076",
"0.5118175",
"0.51140946",
"0.5106098",
"0.5103068",
"0.5084752",
"0.50771606",
"0.5076834",
"0.5074619",
"0.50611144",
"0.5059804",
"0.5056529",
"0.5056529",
"0.5056529",
"0.5056529",
"0.5056529",
"0.5056529",
"0.5049564",
"0.504847",
"0.5034871",
"0.5034867",
"0.5032351",
"0.5023709",
"0.50024456",
"0.49993962",
"0.4977156",
"0.4953737",
"0.4950646",
"0.49473834",
"0.4945822",
"0.49416703",
"0.49383637",
"0.49341613",
"0.49331942",
"0.49215043",
"0.4911847",
"0.49021778",
"0.48978013",
"0.48973623",
"0.4894762",
"0.4894762",
"0.4894762",
"0.4894762",
"0.4894762",
"0.4894762",
"0.48908204",
"0.48908204",
"0.48908204",
"0.48908204",
"0.48908204",
"0.48908204"
] | 0.0 | -1 |
returns the cluster map for current deploy. The keys of the map are node names, the values contain names of clusters (data files) available on the single node. | default Map<String, Set<String>> getActiveClusterMap() {
Map<String, Set<String>> result = new HashMap<>();
result.put(getLocalNodeName(), getStorage().getClusterNames());
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Map<String, String> getDistributedDevicePathToClusterMap()\n throws VPlexApiException {\n return _discoveryMgr.getDistributedDevicePathToClusterMap();\n }",
"public Map<String, String> getClusterIdToNameMap() {\n if (vplexClusterIdToNameCache.isEmpty()) {\n List<VPlexClusterInfo> clusterInfos = getClusterInfoLite();\n for (VPlexClusterInfo clusterInfo : clusterInfos) {\n vplexClusterIdToNameCache.put(clusterInfo.getClusterId(), clusterInfo.getName());\n }\n s_logger.info(\"refreshed cluster id to name map is \" + vplexClusterIdToNameCache.toString());\n }\n\n return vplexClusterIdToNameCache;\n }",
"default Map<String, Set<String>> getActiveDataCenterMap() {\n Map<String, Set<String>> result = new HashMap<>();\n Set<String> val = new HashSet<>();\n val.add(getLocalNodeName());\n result.put(\"local\", val);\n return result;\n }",
"public String getCluster() {\n return this.cluster;\n }",
"public String getCluster() {\n return this.cluster;\n }",
"io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();",
"String getClusterName();",
"java.lang.String getClusterName();",
"public ClusterConfig getClusterConfig() {\n return cluster;\n }",
"@Override\n\tpublic java.lang.String getCluster() {\n\t\treturn _scienceApp.getCluster();\n\t}",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterBytes() {\n java.lang.Object ref = cluster_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n cluster_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public com.google.protobuf.ByteString\n getClusterBytes() {\n java.lang.Object ref = cluster_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n cluster_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public java.lang.String getCluster() {\n java.lang.Object ref = cluster_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n cluster_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public Map<ConstraintType, ClusterConstraints> getConstraintMap() {\n return _constraintMap;\n }",
"public com.tangosol.net.Cluster getCluster()\n {\n return __m_Cluster;\n }",
"com.google.protobuf.ByteString\n getClusterNameBytes();",
"@Override\n @GET\n @Produces(\"application/json\")\n public Response getCluster() throws JSONException {\n if (log.isTraceEnabled()) {\n log.trace(String.format(\"getCluster(ID=%d) started.\", cluster.getClusterId()));\n }\n\n JSONObject json = cluster.toJSON();\n\n json.put(\"uri\", rootUri);\n json.put(\"servers\", rootUri + \"/servers\");\n json.put(\"vms\", rootUri + \"/vms\");\n\n return Response.ok(json.toString()).build();\n }",
"@java.lang.Override\n public java.lang.String getCluster() {\n java.lang.Object ref = cluster_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n cluster_ = s;\n return s;\n }\n }",
"public SME_Cluster[] getClusters();",
"java.util.Map<String, String>\n getReplicationMap();",
"public CustomClusterManager getClusterManager(){\n return mClusterManager;\n }",
"public int[] getCluster() {\r\n return this.clusters[this.clusterIndex];\r\n }",
"public Map<String, INode> getNodeMap() {\n\n return Collections.unmodifiableMap(nodeMap);\n }",
"Map getConnectionManagerMap();",
"public String getClusterId() {\n return this.ClusterId;\n }",
"io.envoyproxy.envoy.type.metadata.v3.MetadataKind.ClusterOrBuilder getClusterOrBuilder();",
"@Override\n\n public java.util.Map<String, String> getReplicationMap() {\n return internalGetReplication().getMap();\n }",
"public Map<String, String> getInitiatorWwnToNameMap(String clusterName) {\n return _discoveryMgr.getInitiatorWwnToNameMap(clusterName);\n }",
"@Override\n\n public java.util.Map<String, String> getReplicationMap() {\n return internalGetReplication().getMap();\n }",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"public String getClusterId() {\n return clusterId;\n }",
"public java.util.Map<java.lang.String, java.lang.String> getAppClientParas() {\n return internalGetAppClientParas().getMap();\n }",
"public java.util.Map<java.lang.String, java.lang.String> getAppClientParas() {\n return internalGetAppClientParas().getMap();\n }",
"DescribeClustersResult describeClusters(DescribeClustersRequest describeClustersRequest);",
"public String clusterId() {\n return this.clusterId;\n }",
"@Override\n public Map<String, String> createDefaultClusterRole(String rolename) throws\n HoyaException, IOException {\n Map<String, String> rolemap = new HashMap<String, String>();\n if (rolename.equals(HBaseKeys.ROLE_MASTER)) {\n // master role\n Configuration conf = ConfigHelper.loadMandatoryResource(\n \"org/apache/hoya/providers/hbase/role-hbase-master.xml\");\n HoyaUtils.mergeEntries(rolemap, conf);\n } else if (rolename.equals(HBaseKeys.ROLE_WORKER)) {\n // worker settings\n Configuration conf = ConfigHelper.loadMandatoryResource(\n \"org/apache/hoya/providers/hbase/role-hbase-worker.xml\");\n HoyaUtils.mergeEntries(rolemap, conf);\n }\n return rolemap;\n }",
"public java.util.List<EinsteinClusterTracker.Cluster> getClusters() {\n return this.clusters;\n }",
"EffectiveClusterSpec getCluster(ClusterSpec clusterSpec);",
"java.util.List<String>\n getClusteringKeyList();",
"public String getCacheClusterSize() {\n return cacheClusterSize;\n }",
"public TrackerCluster getCluster() {return _cluster;}",
"public Map<String, Object> map() {\n Map<String, Object> tomcatInstanceMap = new HashMap<>();\n tomcatInstanceMap.put(\"instanceUUID\", tomcatInstanceUUID);\n tomcatInstanceMap.put(\"instanceName\", instanceName);\n tomcatInstanceMap.put(\"environmentName\", environmentName);\n tomcatInstanceMap.put(\"tomcatVersion\", tomcatVersion);\n tomcatInstanceMap.put(\"destinationFolder\", destinationFolder.getAbsolutePath());\n tomcatInstanceMap.put(\"compressed\", compressed);\n tomcatInstanceMap.put(\"primaryPort\", primaryPort);\n tomcatInstanceMap.put(\"protocolPrimaryPort\", protocolPrimaryPort);\n tomcatInstanceMap.put(\"shutdownPort\", shutdownPort);\n tomcatInstanceMap.put(\"ajpPort\", ajpPort);\n tomcatInstanceMap.put(\"secureInstance\", secureInstance);\n tomcatInstanceMap.put(\"securePort\", securePort);\n tomcatInstanceMap.put(\"protocolSecurePort\", protocolSecurePort);\n tomcatInstanceMap.put(\"keystoreSourceFilename\", keystoreSourceFilename);\n tomcatInstanceMap.put(\"keystoreCredentials\", keystoreCredentials);\n tomcatInstanceMap.put(\"jvmOptionXms\", jvmOptionXms);\n tomcatInstanceMap.put(\"jvmOptionXmx\", jvmOptionXmx);\n tomcatInstanceMap.put(\"jvmOptionXss\", jvmOptionXss);\n tomcatInstanceMap.put(\"jvmOptionXXMaxMetaspaceSize\", jvmOptionXXMaxMetaspaceSize);\n tomcatInstanceMap.put(\"jvmOptions\", jvmOptions);\n tomcatInstanceMap.put(\"instanceManagement\", instanceManagement);\n /**\n * Serialize our Instance Management Properties\n */\n List<Map<String,String>> instanceManagementPropertiesMapList =\n new ArrayList<>(instanceManagementProperties.size());\n for(TomcatInstanceProperty tomcatInstanceProperty : instanceManagementProperties) {\n instanceManagementPropertiesMapList.add(tomcatInstanceProperty.map());\n }\n tomcatInstanceMap.put(\"instanceManagementProperties\", instanceManagementPropertiesMapList);\n /**\n * Serialize our Instance Properties\n */\n List<Map<String,String>> instancePropertiesMapList =\n new ArrayList<>(instanceProperties.size());\n for(TomcatInstanceProperty tomcatInstanceProperty : instanceProperties) {\n instancePropertiesMapList.add(tomcatInstanceProperty.map());\n }\n tomcatInstanceMap.put(\"instanceProperties\", instancePropertiesMapList);\n /**\n * Return the Map for Persisting as YAML.\n */\n return tomcatInstanceMap;\n }",
"java.util.List<com.zibea.recommendations.webserver.core.dao.proto.AttributesMapProto.Map.KeyValue> \n getNodesList();",
"public String clusterId() {\n return this.innerProperties() == null ? null : this.innerProperties().clusterId();\n }",
"public java.lang.String getClusterName() {\n return clusterName;\n }",
"public Map getPartitionMap(int nPid);",
"public String getClusterIdentifier() {\n return this.clusterIdentifier;\n }",
"public ArrayList<NodeRef> getDataNodes() {\r\n\t\tArrayList<NodeRef> slaves = new ArrayList<NodeRef>();\r\n\t\tfor (NodeRef node : nodeMap.values()) {\r\n\t\t\tslaves.add(node);\r\n\t\t}\r\n\t\treturn slaves;\r\n\t}",
"public Map<String, String> buildSiteConfFromSpec(ClusterDescription clusterSpec)\n throws BadConfigException {\n\n Map<String, String> master = clusterSpec.getMandatoryRole(\n HBaseKeys.ROLE_MASTER);\n\n Map<String, String> worker = clusterSpec.getMandatoryRole(\n HBaseKeys.ROLE_WORKER);\n\n Map<String, String> sitexml = new HashMap<String, String>();\n \n //map all cluster-wide site. options\n providerUtils.propagateSiteOptions(clusterSpec, sitexml);\n/*\n //this is where we'd do app-indepdenent keytabs\n\n String keytab =\n clusterSpec.getOption(OptionKeys.OPTION_KEYTAB_LOCATION, \"\");\n \n*/\n\n\n sitexml.put(KEY_HBASE_CLUSTER_DISTRIBUTED, \"true\");\n sitexml.put(KEY_HBASE_MASTER_PORT, \"0\");\n\n sitexml.put(KEY_HBASE_MASTER_INFO_PORT, master.get(\n RoleKeys.APP_INFOPORT));\n sitexml.put(KEY_HBASE_ROOTDIR,\n clusterSpec.dataPath);\n sitexml.put(KEY_REGIONSERVER_INFO_PORT,\n worker.get(RoleKeys.APP_INFOPORT));\n sitexml.put(KEY_REGIONSERVER_PORT, \"0\");\n providerUtils.propagateOption(clusterSpec, OptionKeys.ZOOKEEPER_PATH,\n sitexml, KEY_ZNODE_PARENT);\n providerUtils.propagateOption(clusterSpec, OptionKeys.ZOOKEEPER_PORT,\n sitexml, KEY_ZOOKEEPER_PORT);\n providerUtils.propagateOption(clusterSpec, OptionKeys.ZOOKEEPER_HOSTS,\n sitexml, KEY_ZOOKEEPER_QUORUM);\n\n return sitexml;\n }",
"public Cluster[] getClusters () {\n if (clusters != null) {\n return clusters;\n }\n \n try {\n List sort = org.openide.util.Utilities.topologicalSort (allPages.keySet (), deps);\n \n // ok, no cycles in between pages\n clusters = new Cluster[sort.size ()];\n for (int i = 0; i < clusters.length; i++) {\n clusters[i] = new Cluster (Collections.singleton (findPage ((String)sort.get (i))));\n }\n } catch (org.openide.util.TopologicalSortException ex) {\n // ok, there are cycles\n \n Set[] sets = ex.topologicalSets();\n clusters = new Cluster[sets.length];\n for (int i = 0; i < clusters.length; i++) {\n Set s = new TreeSet ();\n Iterator it = sets[i].iterator();\n while (it.hasNext ()) {\n String name = (String)it.next ();\n Page p = findPage (name);\n if (p != null) {\n s.add (p);\n }\n }\n clusters[i] = new Cluster (s);\n }\n }\n \n // references <Page -> Cluster>\n refs = new HashMap ();\n for (int i = 0; i < clusters.length; i++) {\n java.util.Iterator it = clusters[i].getPages ().iterator ();\n while (it.hasNext()) {\n Page p = (Page)it.next ();\n refs.put (p, clusters[i]);\n }\n }\n \n for (int i = 0; i < clusters.length; i++) {\n Set references = new HashSet ();\n java.util.Iterator it = clusters[i].getPages ().iterator ();\n while (it.hasNext()) {\n Page contained = (Page)it.next ();\n Collection c = (Collection)deps.get (contained.getFileName());\n if (c != null) {\n Iterator d = c.iterator();\n while (d.hasNext()) {\n String pageName = (String)d.next ();\n references.add (refs.get (findPage (pageName)));\n }\n }\n }\n // prevent self references\n references.remove (clusters[i]);\n clusters[i].references = (Cluster[])references.toArray (new Cluster[0]);\n }\n \n return clusters;\n }",
"public Collection<String> getContigs() {\n\t\treturn infoMap.keySet();\n\t}",
"public int getNumClusters() {\n return clusters.size();\n }",
"public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}",
"public String getClusterAddress() {\r\n return clusterAddress;\r\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic Map<String,List<ContentItem>> getTagDocCluster() {\r\n\t\tSet<String> tagLabels = getDistinctTagLabels();\r\n\t\t\r\n\t\tList<ContentItem> pages = new ArrayList<ContentItem>(getTaggedPages()); \r\n\r\n\t\tSpectralClusterBean [][] spectralClusterBeans = new SpectralClusterBean[tagLabels.size()][pages.size()];\r\n\t\t\r\n\t\tList<String> tagCollection = new ArrayList(tagLabels);\r\n\r\n\t\tfor (int i = 0; i < tagCollection.size(); i++) {\r\n\t\t\tfor (int j = 0; j < pages.size(); j++) {\r\n\t\t\t\tfloat tagFrequency = taggingService.getTagFrequencyByContentItem(((String)tagCollection.get(i)).toLowerCase() , pages.get(j), new Float(pages.size()));\r\n\t\t//\t\tSystem.out.println(\" tag \"+((String)tagCollection.get(i)).toLowerCase() +\" has freq \" + tagFrequency+\" for page \"+pages.get(j).getTitle());\r\n\t\t\t\tspectralClusterBeans[i][j] = new SpectralClusterBean(pages.get(j).getId(),(String)tagCollection.get(i),i,j,tagFrequency);\r\n\t\t\t}\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\tdouble [][] userTags = new double[tagCollection.size()][pages.size()];\r\n\t\tfor (int i = 0; i < tagCollection.size(); i++) {\r\n\t\t\tfor (int j = 0; j < pages.size(); j++) {\r\n\t\t\t\tuserTags[i][j] = (double)spectralClusterBeans[i][j].getScore();\t\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\tSpectralClusteringModel spectralClusteringRecommendation = new SpectralClusteringModel();\r\n\t\tMatrix frequencyMatrix = new Matrix(userTags);\r\n\t\t\r\n\t\tSingularValueDecomposition singularValueDecomposition=null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tsingularValueDecomposition = spectralClusteringRecommendation.computeLeftSigularValueDecompositionMatrix(frequencyMatrix);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tDataset[] dataSets = null;\r\n\t\ttry {\r\n\t\t\tdataSets = spectralClusteringRecommendation.clusterSpectralClusteringMatrix(singularValueDecomposition);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tMap<Set<Double>,Set<Double>> mapClusters = getMappingPositions(dataSets);\r\n\t\t\r\n\t\tMap<String,List<ContentItem>> showCLuster = new HashMap<String, List<ContentItem>>();\t\r\n\r\n\t\tfor (Set<Double> keys : mapClusters.keySet()) {\r\n\t\t\tStringBuffer tagStringBuffer = new StringBuffer();\r\n\t\t\tfor (Double tagPos : keys) {\r\n\t\t\t\ttagStringBuffer.append((spectralClusterBeans[tagPos.intValue()][0]).getTagLabel());\r\n\t\t\t\ttagStringBuffer.append(\"+\");\r\n\t\t\t}\r\n\t\t\tSet<ContentItem> cis = new HashSet<ContentItem>(); \r\n\t\t\t\r\n\t\t\tfor (Double tagPos : keys) {\r\n\t\t\t\tfor (int i = 0; i < pages.size(); i++) {\r\n\t\t\t\t\tif (spectralClusterBeans[tagPos.intValue()][i].getScore()>0) {\r\n\t\t\t\t\t\tLong ciId = spectralClusterBeans[tagPos.intValue()][i].getContentItemId();\r\n\t\t\t\t\t\tContentItem contentItem = getPagesById(ciId);\r\n\t\t\t\t\t\tcis.add(contentItem);\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tshowCLuster.put(tagStringBuffer.substring(0,tagStringBuffer.lastIndexOf(\"+\")), new ArrayList(cis));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn showCLuster;\r\n\t}",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"com.google.protobuf.ByteString\n getClusterIdBytes();",
"public java.lang.Integer getClusterSize() {\n return clusterSize;\n }",
"public static Map<String, Client> getClientMap() {\r\n return clientMap;\r\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic List<String> getClusterIDs() {\r\n\t\tArrayList<String> clusterIDs = new ArrayList<String>();\r\n\t\t//xPath expression to get the classname\r\n\t\tString xPath = \"//jdbcluster/clustertype/cluster\";\r\n\r\n\t\tList<Node> nodes = document.selectNodes(xPath);\r\n\t\tif(nodes != null) {\r\n\t\t\tfor(Node n : nodes){\r\n\t\t\t\tclusterIDs.add(n.valueOf(\"@id\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn clusterIDs;\r\n\t}",
"public Map<String, Component> getMapa_componentes() {\r\n\t\treturn tabboxContendor.getMapa_componentes();\r\n\t}",
"public Boolean getCacheClusterEnabled() {\n return cacheClusterEnabled;\n }",
"public File cluster() throws IOException, InterruptedException {\n Runtime r = Runtime.getRuntime();\n Process p = r.exec(mclExecutablePath + \" \" + fileName + \" -o \" + fileName + \".I20\");\n p.waitFor();\n clusterResultFile = new File(fileName + \".I20\");\n return clusterResultFile;\n }",
"public List<VPlexClusterInfo> getClusterInfoDetails() throws VPlexApiException {\n s_logger.info(\"Request for complete detailed cluster info for VPlex at {}\", _baseURI);\n return _discoveryMgr.getClusterInfo(false, true);\n }",
"public List<VPlexClusterInfo> getClusterInfoLite() throws VPlexApiException {\n s_logger.info(\"Request for lightweight cluster info for VPlex at {}\", _baseURI);\n if (vplexClusterInfoLiteCache.isEmpty()) {\n vplexClusterInfoLiteCache.addAll(_discoveryMgr.getClusterInfo(true, false));\n s_logger.info(\"refreshed lightweight cluster info list is \" + vplexClusterInfoLiteCache.toString());\n }\n\n return vplexClusterInfoLiteCache;\n }",
"public int getClusterSize() {\r\n \treturn this.clusterSize;\r\n }",
"public com.google.protobuf.ByteString\n getClusterNameBytes() {\n java.lang.Object ref = \"\";\n if (endpointConfigCase_ == 2) {\n ref = endpointConfig_;\n }\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n if (endpointConfigCase_ == 2) {\n endpointConfig_ = b;\n }\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@Override\n\tpublic long getClusterId() {\n\t\treturn model.getClusterId();\n\t}",
"public ImmutableMap<String, Boolean> getAttributeClusteringConfig();",
"public String getCloudHsmClusterId() {\n return this.cloudHsmClusterId;\n }",
"boolean hasCluster();",
"public String getClusterName() {\n\t\treturn clusterName;\n\t}",
"public List<Object> invokeMapReduce(Invoker invoker) {\n List<Pair<Pair<Short, Integer>, String>> list = clientConnections.getMapClientFromAll();\n List<KeyCluster> keyClusterList = new ArrayList<KeyCluster>(list.size());\n for ( Pair<Pair<Short, Integer>, String> each : list) {\n //key is represented by node 1 separate by , total nodes example 1,3\n //will passed by key to store proc to determine the how partition data node\n KeyCluster keyCluster = new KeyCluster(each.getFirst().getFirst(), Key.createKey(each.getSecond()),\n each.getFirst().getSecond() );\n keyClusterList.add( keyCluster);\n }\n //add Key must be true, key carry information about how to split cluster\n return executeStoreProc(invoker, keyClusterList, true);\n }",
"private Map<String, DataContainer> getDataContainerMap() {\r\n\r\n if (this.dataContainerMap == null) {\r\n if (this.dataContainerList == null) {\r\n parse();\r\n }\r\n\r\n this.dataContainerMap = new HashMap<>();\r\n for (DataContainer dataContainer : this.dataContainerList) {\r\n this.dataContainerMap.put(dataContainer.getVariableName(), dataContainer);\r\n }\r\n }\r\n return this.dataContainerMap;\r\n }",
"public static Map<String, String> getMapping() {\n\t\treturn ThreadContext.getMapping();\n\t}",
"@Override\n\tpublic Map<String, Map<Integer, List<String>>> getOverlayNetwork() throws TimeSeriesException {\n\t\tIConfig configurationService = ServiceFactory.getConfigurationService();\n\t\tMap<String, Map<Integer, List<String>>> overlayNetwork = configurationService.getOverlayNetwork(this.clusterName);\n\t\t//configurationService.close();\n\t\treturn overlayNetwork;\n\t}",
"public long getNClusters() {\n return cGetNClusters(this.cObject);\n }",
"public OpenIntIntHashMap getClusterSizes() {\n\n if (sizeMap != null) return sizeMap;\n\n sizeMap = new OpenIntIntHashMap();\n\n ValueIterator imageIterator = labelledVolume.valueIterator();\n //Map<Integer, Integer> sizes = new HashMap<Integer, Integer>();\n\n do {\n int label = (int) imageIterator.next();\n if (label > 0) {\n if (sizeMap.containsKey(label)) {\n int crt = sizeMap.get(label) + 1;\n sizeMap.put(label, crt);\n } else {\n sizeMap.put(label, 1);\n }\n }\n\n\n } while (imageIterator.hasNext());\n\n return sizeMap;\n }",
"public Map getPartitionMap(PartitionSet partitions);",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getClusterIdBytes() {\n java.lang.Object ref = clusterId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n clusterId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getClusterId() {\n java.lang.Object ref = clusterId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n clusterId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }"
] | [
"0.7030216",
"0.63742477",
"0.62352127",
"0.59134483",
"0.59134483",
"0.5907195",
"0.58926624",
"0.5836969",
"0.5817204",
"0.57974035",
"0.5793733",
"0.5723047",
"0.56578916",
"0.56467724",
"0.56308454",
"0.5600261",
"0.5592557",
"0.55886203",
"0.5580798",
"0.5569368",
"0.5461473",
"0.54597306",
"0.5385135",
"0.5368465",
"0.53646606",
"0.5352233",
"0.5346252",
"0.53421015",
"0.53339195",
"0.5327889",
"0.5327889",
"0.5327889",
"0.5327889",
"0.5327889",
"0.5327889",
"0.53059375",
"0.52709943",
"0.52631235",
"0.52440625",
"0.5235681",
"0.52337396",
"0.5212671",
"0.52031326",
"0.52030015",
"0.5199382",
"0.51792496",
"0.5173324",
"0.5160121",
"0.5138367",
"0.51262397",
"0.51181024",
"0.5115868",
"0.5106564",
"0.5103428",
"0.50852203",
"0.5077254",
"0.5077169",
"0.50752944",
"0.5062864",
"0.50615346",
"0.5057655",
"0.5057655",
"0.5057655",
"0.5057655",
"0.5057655",
"0.5057655",
"0.5049025",
"0.5048019",
"0.50375885",
"0.50346",
"0.5032921",
"0.50238425",
"0.5003709",
"0.5000981",
"0.49779302",
"0.49555802",
"0.49521384",
"0.49479085",
"0.4946542",
"0.49428928",
"0.49404493",
"0.49352816",
"0.49328178",
"0.49196208",
"0.49127826",
"0.49031636",
"0.48970658",
"0.48965797",
"0.48959908",
"0.48959908",
"0.48959908",
"0.48959908",
"0.48959908",
"0.48959908",
"0.4892728",
"0.4892728",
"0.4892728",
"0.4892728",
"0.4892728",
"0.4892728"
] | 0.719396 | 0 |
returns the data center map for current deploy. The keys are data center names, the values are node names per data center | default Map<String, Set<String>> getActiveDataCenterMap() {
Map<String, Set<String>> result = new HashMap<>();
Set<String> val = new HashSet<>();
val.add(getLocalNodeName());
result.put("local", val);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Map<String, String> getDistributedDevicePathToClusterMap()\n throws VPlexApiException {\n return _discoveryMgr.getDistributedDevicePathToClusterMap();\n }",
"default Map<String, Set<String>> getActiveClusterMap() {\n Map<String, Set<String>> result = new HashMap<>();\n result.put(getLocalNodeName(), getStorage().getClusterNames());\n return result;\n }",
"public String getDataCenter() {\n return this.dataCenter;\n }",
"private Map<String, DataContainer> getDataContainerMap() {\r\n\r\n if (this.dataContainerMap == null) {\r\n if (this.dataContainerList == null) {\r\n parse();\r\n }\r\n\r\n this.dataContainerMap = new HashMap<>();\r\n for (DataContainer dataContainer : this.dataContainerList) {\r\n this.dataContainerMap.put(dataContainer.getVariableName(), dataContainer);\r\n }\r\n }\r\n return this.dataContainerMap;\r\n }",
"public String getDataCenterName() {\n return dataCenterName;\n }",
"@Override\n public final Map<Class<? extends MiWithConfigurationSupport<?>>, EntityCentre<?>> getCentres() {\n return webUiBuilder.getCentres();\n }",
"public Map<String, String> getClusterIdToNameMap() {\n if (vplexClusterIdToNameCache.isEmpty()) {\n List<VPlexClusterInfo> clusterInfos = getClusterInfoLite();\n for (VPlexClusterInfo clusterInfo : clusterInfos) {\n vplexClusterIdToNameCache.put(clusterInfo.getClusterId(), clusterInfo.getName());\n }\n s_logger.info(\"refreshed cluster id to name map is \" + vplexClusterIdToNameCache.toString());\n }\n\n return vplexClusterIdToNameCache;\n }",
"public java.lang.String getDataCenterId() {\r\n return dataCenterId;\r\n }",
"public native vector kbGetMapCenter();",
"public Map getMDCData()\n\t{\n\t\tString reqId = getCurrentRequestId();\n\t\tMap mdcData = new HashMap();\n\t\tmdcData.put(REQUEST_ID, reqId);\n\t\tmdcData.put(USER_ID, MDC.get(USER_ID));\n\t\tmdcData.put(HOST_IP, MDC.get(HOST_IP));\n\n\t\treturn mdcData;\n\t}",
"private static Datacenter Create_Datacenter(String name){\n\t\t// creating list of host machine \n\t\tList<Host> hostList = new ArrayList<Host>();\n\t\t// creating list of CPU for each host machine, In our simulation with choose 1 core per machine \n\t\tList<Pe> peList1 = new ArrayList<Pe>();\n\t\tint mips = 1000; // computing power of each core\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\tpeList1.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t}\n\t\t// configuring host\n\t\tint hostId=0;\n\t\tint ram = 56320; //host memory 40 GB\n\t\tlong storage = 10240000; //host storage 10000 GB\n\t\tint bw = 102400; // bandwidth 100 Gbps\n\t\t// create first host machine with 4 cores \n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList1,\n \t\t\t\tnew VmSchedulerTimeShared(peList1)\n \t\t\t)\n \t\t);\n\t\t// create another host machine with 1 cores\n\t\tList<Pe> peList2 = new ArrayList<Pe>();\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\t\tpeList2.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t\t}\n\t\thostId++;\n\n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList2,\n \t\t\t\tnew VmSchedulerTimeShared(peList2)\n \t\t\t)\n \t\t);\n\t\t\n\t // configuring datacenter \n\t\tString arch = \"x86\"; // system architecture\n\t\tString os = \"Linux\"; // operating system\n\t\tString vmm = \"Xen\";\n\t\tdouble time_zone = 10.0; // time zone this resource located\n\t\tdouble cost = 3.0; // the cost of using processing in this resource\n\t\tdouble costPerMem = 0.05;\t\t// the cost of using memory in this resource\n\t\tdouble costPerStorage = 0.001;\t// the cost of using storage in this resource\n\t\tdouble costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n\t\tLinkedList<Storage> storageList = new LinkedList<Storage>();\n\t\tDatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n\t\t// creating data center \n\t\tDatacenter datacenter = null;\n\t\ttry {\n\t\t\tdatacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn datacenter;\n\t\t\n\t}",
"public Vector getCenters(){\n\treturn synchroCenters;\n }",
"public Map<ConstraintType, ClusterConstraints> getConstraintMap() {\n return _constraintMap;\n }",
"private static Datacenter CreateDataCenter() {\n\t\tList<Pe> peList = new ArrayList<Pe>();\n\t\t//One PE with 1000 Mips\n\t\tPeProvisionerSimple peProvisioner = new PeProvisionerSimple(1000);\n\t\t////Four 1000 MIPS PEs\n\t\tfor (int id = 0; id < 4; id++) {\n\t\t\tPe core = new Pe(id, peProvisioner);\n\t\t\tpeList.add(core);\n\t\t}\n\t\t//Initialize the hosts\n\t\tList<Host> hostList = new ArrayList<Host>();\n\t\t//8 GB RAM\n\t\tint ram = 8000;\n\t\t//1 MPBS network bandwidth\n\t\tint bw = 1000;\n\t\t//100 GB storage\n\t\tlong storage = 100000;\n\t\tfor (int id = 0; id < 4; id++) {\n\t\t\tHost host = new Host(id, new RamProvisionerSimple(ram), new BwProvisionerSimple(bw), storage, peList,\n\t\t\t\t\tnew VmSchedulerSpaceShared(peList));\n\t\t\thostList.add(host);\n\t\t}\n\t\t//Initialize the data center\n\t\tString architecture = \"x64\";\n\t\tString os = \"Kelly Linux\";\n\t\tString vmm = \"XEN\";\n\t\tdouble timeZone = -4.0;\n\t\tdouble computeCostPerSec = 3.0;\n\t\tdouble costPerMem = 1.0;\n\t\tdouble costPerStorage = 0.05;\n\t\tdouble costPerBW = 0.10;\n\t\tDatacenterCharacteristics datacenterCharacteristics = new DatacenterCharacteristics(architecture, os, vmm,\n\t\t\t\thostList, timeZone, computeCostPerSec, costPerMem, costPerStorage, costPerBW);\n\t\tLinkedList<Storage> SANstorage = new LinkedList<Storage>();\n\t\tDatacenter datacenter = null;\n\t\ttry {\n\t\t\tdatacenter = new Datacenter(\"datacenter0\", datacenterCharacteristics,\n\t\t\t\t\tnew VmAllocationPolicySimple(hostList), SANstorage, 1);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn datacenter;\n\t}",
"private List<Integer> getCentList(DiscreteAttribute attr, ClusterSet data) {\n\t\treturn ChartF.getCentDisValues(data, attr);\n\t}",
"private List<Double> getCentList(ContinuousAttribute attr, ClusterSet data) {\n\t\treturn ChartF.getCentContValues(data, attr);\n\t}",
"public ArrayList<NodeRef> getDataNodes() {\r\n\t\tArrayList<NodeRef> slaves = new ArrayList<NodeRef>();\r\n\t\tfor (NodeRef node : nodeMap.values()) {\r\n\t\t\tslaves.add(node);\r\n\t\t}\r\n\t\treturn slaves;\r\n\t}",
"public String getCostCenter() {\n\t\treturn _CostCenter;\n\t}",
"public Map<String, String> getMdc() {\n return null;\n }",
"java.util.Map<String, String>\n getReplicationMap();",
"@Override\n\n public java.util.Map<String, String> getReplicationMap() {\n return internalGetReplication().getMap();\n }",
"@Override\n\n public java.util.Map<String, String> getReplicationMap() {\n return internalGetReplication().getMap();\n }",
"String getClusterName();",
"java.lang.String getClusterName();",
"public void setDataCenter(String dataCenter) {\n this.dataCenter = dataCenter;\n }",
"public Map<String, String> getInitiatorWwnToNameMap(String clusterName) {\n return _discoveryMgr.getInitiatorWwnToNameMap(clusterName);\n }",
"private Datacenter createDatacenter(String name){\n List<Host> hostList = new ArrayList<Host>();\n\n for (int i=0; i<HostCount; i++){\n\n // 2. A Machine contains one or more PEs or CPUs/Cores.\n List<Pe> peList = new ArrayList<Pe>();\n\n // 3. Create PEs and add these into a list.\n for (int j=0; j<HostCoreCount; j++){\n peList.add(new Pe(j, new PeProvisionerSimple(HostCoreMips)));\n }\n\n\n //in this example, the VMAllocatonPolicy in use is SpaceShared. It means that only one VM\n //is allowed to run on each Pe. As each Host has only one Pe, only one VM can run on each Host.\n hostList.add(\n new Host(\n i,\n new RamProvisionerSimple(HostRam),\n new BwProvisionerSimple(HostBandwidth),\n HostStorage,\n peList,\n new VmSchedulerSpaceShared(peList)\n )\n );\n }\n\n\n // 5. Create a DatacenterCharacteristics object that stores the\n // properties of a data center: architecture, OS, list of\n // Machines, allocation policy: time- or space-shared, time zone\n // and its price (G$/Pe time unit).\n String arch = \"x86\"; // system architecture\n String os = \"Linux\"; // operating system\n String vmm = \"Xen\";\n double time_zone = 10.0; // time zone this resource located\n double cost = 3.0; // the cost of using processing in this resource\n double costPerMem = 0.05;\t\t// the cost of using memory in this resource\n double costPerStorage = 0.001;\t// the cost of using storage in this resource\n double costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n LinkedList<Storage> storageList = new LinkedList<Storage>();\t//we are not adding SAN devices by now\n\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n // 6. Finally, we need to create a PowerDatacenter object.\n Datacenter datacenter = null;\n\n try {\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return datacenter;\n }",
"public NodeMap<CDMNode, DapNode> create() throws DapException {\n // Netcdf Dataset will already have a root group\n Group cdmroot = ncfile.getRootGroup();\n this.nodemap.put(cdmroot, this.dmr);\n fillGroup(cdmroot, this.dmr, ncfile);\n return this.nodemap;\n }",
"java.util.List<com.zibea.recommendations.webserver.core.dao.proto.AttributesMapProto.Map.KeyValue> \n getNodesList();",
"public Map<String, Integer> getDataMap() {\n\t\tMap<String, Integer> dataMap = new HashMap<>();\n\t\tdataMap.putAll(temperature.getDataMap());\n\t\tdataMap.putAll(wind.getDataMap());\n\t\tdataMap.putAll(precipitation.getDataMap());\n\t\tdataMap.putAll(condition.getDataMap());\n\t\tdataMap.putAll(hazard.getDataMap());\n\t\tdataMap.putAll(wave.getDataMap());\n\t\t\n\t\treturn dataMap;\n\t}",
"public String getCenterName() {\n\t\treturn centerName;\r\n\t}",
"public SME_Cluster[] getClusters();",
"public String getCenterid() {\n return centerid;\n }",
"public Map<String, INode> getNodeMap() {\n\n return Collections.unmodifiableMap(nodeMap);\n }",
"public Coord3d getCenter() {\n return new Coord3d((xmin + xmax) / 2, (ymin + ymax) / 2, (zmin + zmax) / 2);\n }",
"public java.util.Map<java.lang.String, java.lang.String> getAppClientParas() {\n return internalGetAppClientParas().getMap();\n }",
"public java.util.Map<java.lang.String, java.lang.String> getAppClientParas() {\n return internalGetAppClientParas().getMap();\n }",
"public MapInfo getAllCovidCasesMapinfo() {\n GeoJsonGenerator generator = new GeoJsonGenerator();\n return generator.getAllMapInfo(getMapParamsOfMany(covidDataRepository.findAll()));\n }",
"public Map<Integer, HealthMapDisease> getDiseaseMap() {\n if (diseaseMap == null) {\n List<HealthMapDisease> diseases = healthMapService.getAllHealthMapDiseases();\n diseaseMap = index(diseases, on(HealthMapDisease.class).getId());\n }\n return diseaseMap;\n }",
"public double[] getCenter() {\n return this.center;\n }",
"private static Datacenter createDatacenter(String name) {\n List<Host> hostList = new ArrayList<Host>();\r\n\r\n // 2. A Machine contains one or more PEs or CPUs/Cores.\r\n // In this example, it will have only one core.\r\n List<Pe> peList = new ArrayList<Pe>();\r\n\r\n\r\n // 3. Create PEs and add these into a list.\r\n peList.add(new Pe(0, new PeProvisionerSimple(mips+100))); // need to store Pe id and MIPS Rating\r\n\r\n // 4. Create Host with its id and list of PEs and add them to the list\r\n // of machines\r\n long storage = 1000000; // host storage\r\n\r\n\r\n for (int hostId = 0; hostId < vmNum; hostId++) {\r\n hostList.add(\r\n new Host(\r\n hostId,\r\n new RamProvisionerSimple((int)((ram*1.1)/Constants.MB)),\r\n new BwProvisionerSimple(bw+10),\r\n storage,\r\n peList,\r\n new VmSchedulerTimeShared(peList)\r\n )\r\n ); // This is our machine\r\n }\r\n\r\n\r\n // 5. Create a DatacenterCharacteristics object that stores the\r\n // properties of a data center: architecture, OS, list of\r\n // Machines, allocation policy: time- or space-shared, time zone\r\n // and its price (G$/Pe time unit).\r\n String arch = \"x86\"; // system architecture\r\n String os = \"Linux\"; // operating system\r\n String vmm = \"Xen\";\r\n double time_zone = 10.0; // time zone this resource located\r\n double cost = 3.0; // the cost of using processing in this resource\r\n double costPerMem = 0.05; // the cost of using memory in this resource\r\n double costPerStorage = 0.001; // the cost of using storage in this\r\n // resource\r\n double costPerBw = 0.0; // the cost of using bw in this resource\r\n LinkedList<Storage> storageList = new LinkedList<Storage>(); // we are not adding SAN\r\n // devices by now\r\n\r\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\r\n arch, os, vmm, hostList, time_zone, cost, costPerMem,\r\n costPerStorage, costPerBw);\r\n\r\n // 6. Finally, we need to create a PowerDatacenter object.\r\n Datacenter datacenter = null;\r\n try {\r\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return datacenter;\r\n }",
"@Override\n\tpublic java.lang.String getCluster() {\n\t\treturn _scienceApp.getCluster();\n\t}",
"public ClusterConfig getClusterConfig() {\n return cluster;\n }",
"public Map<Integer, Data> getDataMap() {\n Map<Integer, Data> result = new HashMap<Integer, Data>();\n for (Integer varIndex : _dataMap.keySet()) {\n List<Data> dataList = _dataMap.get(varIndex);\n result.put(varIndex, dataList.get(dataList.size() - 1));\n }\n return result;\n }",
"public Map<String, Component> getMapa_componentes() {\r\n\t\treturn tabboxContendor.getMapa_componentes();\r\n\t}",
"public static Map<Variable, Array> createDataMap(D4DSP dsp, NodeMap nodemap) throws DapException {\n Map<DapVariable, D4Array> datamap = dsp.getVariableDataMap();\n DapDataset dmr = dsp.getDMR();\n Map<Variable, Array> arraymap = new HashMap<>();\n // iterate over the variables represented in the nodemap\n List<DapVariable> topvars = dmr.getTopVariables();\n Map<Variable, Array> map = null;\n for (DapVariable var : topvars) {\n D4Array cursor = datamap.get(var);\n Variable v = (Variable) nodemap.get(var);\n assert cursor != null && v != null;\n Array array = cursor.getArray();\n assert array != null;\n arraymap.put(v, array);\n }\n return arraymap;\n }",
"public Map<String, List<Object>> getDCModelMap(){\n\t\tDBCollection dcModel = db.getCollection(\"dcModel\");\n\t\tMap<String, List<Object>> varModelMap = new HashMap<String, List<Object>>();\n \tDBCursor varModelCursor = dcModel.find();\n \tfor(DBObject varModelObj: varModelCursor) {\n \t\tvarModelMap.put((String) varModelObj.get(\"v\"), (List<Object>) varModelObj.get(\"m\")); \t\t\n \t}\n \treturn varModelMap;\n\t}",
"public Map<Axis, Double> getMachineCoordinates() {\n return Collections.unmodifiableMap(machineCoordinates);\n }",
"public String getCluster() {\n return this.cluster;\n }",
"public String getCluster() {\n return this.cluster;\n }",
"public Collection<String> getContigs() {\n\t\treturn infoMap.keySet();\n\t}",
"public LatLng getCenter() {\n return center;\n }",
"public static Map<String,String> getGeoTargetsFromCache(){\n\t\tMap<String,String> dataMap=null; \t\n \tif(memcache !=null && memcache.contains(ALL_GEO_TARGETS_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_GEO_TARGETS_KEY);\n \t\tlog.info(\"Memcache getGeoTargetsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}",
"private Map<String, Object> getSectorData() {\r\n Map<String, Object> data = new LinkedHashMap<String, Object>();\r\n for (String key : sectorData) {\r\n if (lineData.containsKey(key)) {\r\n if (channelMap.containsKey(key)) {\r\n channelMap.put(key, channelMap.get(key) + 1);\r\n }\r\n data.put(key, lineData.get(key));\r\n }\r\n }\r\n return data;\r\n }",
"private static void locateCenters(final int[] cluster, double[][] centers, final double[][] data) {\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n // reset centers to 0\n for (int c = 0; c < numCluster; c++) {\n Arrays.fill(centers[c], 0);\n }\n\n int[] countCluster = new int[numCluster];\n\n // sum over all samples\n for (int n = 0; n < N; n++) {\n vectorSumInPlace(centers[cluster[n]], data[n]);\n countCluster[cluster[n]]++;\n }\n\n // divide by number of samples in each cluster\n for (int c = 0; c < numCluster; c++) {\n vectorDivideInPlace(centers[c], countCluster[c]);\n }\n }",
"java.util.List<String>\n getClusteringKeyList();",
"public static Map<String, Integer> getK8sCurrContainerDetails(int envId, String platform) {\n\t\tfinal java.sql.Date todayDate = new java.sql.Date(Calendar.getInstance().getTimeInMillis());;\n\t\tSession session = HibernateConfig.getSessionFactory().getCurrentSession();\n\t\tTransaction txn = session.beginTransaction();\n\t\tCriteria contCriteria = session.createCriteria(K8sPodsContainersEntity.class, \"contSts\");\n\t\tcontCriteria.add(Restrictions.eq(\"contSts.statusDate\", todayDate ));\n\t\tcontCriteria.add(Restrictions.eq(\"contSts.environment.environmentId\", envId));\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<K8sPodsContainersEntity> contEntityList = contCriteria.list();\n\t\tMap<String, Integer> mapContSts = new HashMap<String, Integer>();\n\t\tfor(K8sPodsContainersEntity contStsEntity : contEntityList){\n\t\t\tif(contStsEntity.getComponent() != null && contStsEntity.getComponent().getParentComponent() != null){\n\t\t\t\tString fullAppName = contStsEntity.getComponent().getParentComponent().getComponentName() + \"/\" + contStsEntity.getComponent().getComponentName();\n\t\t\t\tmapContSts.put(fullAppName, contStsEntity.getTotalContainers());\n\t\t }else if(contStsEntity.getComponent() != null){\n\t\t \tmapContSts.put(contStsEntity.getComponent().getComponentName(), contStsEntity.getTotalContainers());\n\t\t }\n\t }\n\t\ttxn.commit();\n\t\treturn mapContSts;\n\t}",
"public Collection<String> loadAllDataSourcesNodes() {\n return repository.getChildrenKeys(node.getDataSourcesNodeFullRootPath());\n }",
"public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}",
"public Map<String, Customer> getCustomer(){\r\n\t\treturn treeData;\r\n\t}",
"public Map<String,KeystoreMetadata> getKeystores()\r\n {\r\n return _keystoreMap;\r\n }",
"Map getConnectionManagerMap();",
"public CustomClusterManager getClusterManager(){\n return mClusterManager;\n }",
"io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();",
"public int[] getCluster() {\r\n return this.clusters[this.clusterIndex];\r\n }",
"public Point2D getGraphViewCenter() {\n \n \t\t// be explicit\n \t\treturn (graphViewCenterX != null && graphViewCenterY != null) ? new Point2D.Double(\n \t\t\t\tgraphViewCenterX.doubleValue(), graphViewCenterY.doubleValue())\n \t\t\t\t: null;\n \t}",
"public String getCacheClusterSize() {\n return cacheClusterSize;\n }",
"public Map<String, ICodeBaseEntry> getApplicationCodebaseEntries();",
"public static Map<String, Map<String,String>> getDataMap() throws Exception\r\n\t{\r\n\t\tif(sheet==null)\r\n\t\t{\r\n\t\t\tloadExcel();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String,Map<String,String>> superMap = new HashMap<String, Map<String,String>>();\r\n\t\tMap<String,String> myMap = new HashMap<String, String>();\r\n\t\t\r\n\t\tfor(int i=1;i<sheet.getLastRowNum()+1;i++)\r\n\t\t{\r\n\t\t\trow=sheet.getRow(i);\r\n\t\t\tString keyCell = row.getCell(0).getStringCellValue();\r\n\t\t\t\r\n\t\t\tint colNum = row.getLastCellNum();\r\n\t\t\tfor(int j=1;j<colNum;j++)\r\n\t\t\t{\r\n\t\t\t\tString value = row.getCell(j).getStringCellValue();\r\n\t\t\t\tmyMap.put(keyCell, value);\r\n\t\t\t}\r\n\t\t\tsuperMap.put(\"MasterData\", myMap);\r\n\t\t}\r\n\t\t\r\n\t\treturn superMap;\r\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic Map<String,List<ContentItem>> getTagDocCluster() {\r\n\t\tSet<String> tagLabels = getDistinctTagLabels();\r\n\t\t\r\n\t\tList<ContentItem> pages = new ArrayList<ContentItem>(getTaggedPages()); \r\n\r\n\t\tSpectralClusterBean [][] spectralClusterBeans = new SpectralClusterBean[tagLabels.size()][pages.size()];\r\n\t\t\r\n\t\tList<String> tagCollection = new ArrayList(tagLabels);\r\n\r\n\t\tfor (int i = 0; i < tagCollection.size(); i++) {\r\n\t\t\tfor (int j = 0; j < pages.size(); j++) {\r\n\t\t\t\tfloat tagFrequency = taggingService.getTagFrequencyByContentItem(((String)tagCollection.get(i)).toLowerCase() , pages.get(j), new Float(pages.size()));\r\n\t\t//\t\tSystem.out.println(\" tag \"+((String)tagCollection.get(i)).toLowerCase() +\" has freq \" + tagFrequency+\" for page \"+pages.get(j).getTitle());\r\n\t\t\t\tspectralClusterBeans[i][j] = new SpectralClusterBean(pages.get(j).getId(),(String)tagCollection.get(i),i,j,tagFrequency);\r\n\t\t\t}\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\tdouble [][] userTags = new double[tagCollection.size()][pages.size()];\r\n\t\tfor (int i = 0; i < tagCollection.size(); i++) {\r\n\t\t\tfor (int j = 0; j < pages.size(); j++) {\r\n\t\t\t\tuserTags[i][j] = (double)spectralClusterBeans[i][j].getScore();\t\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\tSpectralClusteringModel spectralClusteringRecommendation = new SpectralClusteringModel();\r\n\t\tMatrix frequencyMatrix = new Matrix(userTags);\r\n\t\t\r\n\t\tSingularValueDecomposition singularValueDecomposition=null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tsingularValueDecomposition = spectralClusteringRecommendation.computeLeftSigularValueDecompositionMatrix(frequencyMatrix);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tDataset[] dataSets = null;\r\n\t\ttry {\r\n\t\t\tdataSets = spectralClusteringRecommendation.clusterSpectralClusteringMatrix(singularValueDecomposition);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tMap<Set<Double>,Set<Double>> mapClusters = getMappingPositions(dataSets);\r\n\t\t\r\n\t\tMap<String,List<ContentItem>> showCLuster = new HashMap<String, List<ContentItem>>();\t\r\n\r\n\t\tfor (Set<Double> keys : mapClusters.keySet()) {\r\n\t\t\tStringBuffer tagStringBuffer = new StringBuffer();\r\n\t\t\tfor (Double tagPos : keys) {\r\n\t\t\t\ttagStringBuffer.append((spectralClusterBeans[tagPos.intValue()][0]).getTagLabel());\r\n\t\t\t\ttagStringBuffer.append(\"+\");\r\n\t\t\t}\r\n\t\t\tSet<ContentItem> cis = new HashSet<ContentItem>(); \r\n\t\t\t\r\n\t\t\tfor (Double tagPos : keys) {\r\n\t\t\t\tfor (int i = 0; i < pages.size(); i++) {\r\n\t\t\t\t\tif (spectralClusterBeans[tagPos.intValue()][i].getScore()>0) {\r\n\t\t\t\t\t\tLong ciId = spectralClusterBeans[tagPos.intValue()][i].getContentItemId();\r\n\t\t\t\t\t\tContentItem contentItem = getPagesById(ciId);\r\n\t\t\t\t\t\tcis.add(contentItem);\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tshowCLuster.put(tagStringBuffer.substring(0,tagStringBuffer.lastIndexOf(\"+\")), new ArrayList(cis));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn showCLuster;\r\n\t}",
"public Vector3d getCurrentCollisionCenter() {\r\n return new Vector3d(collisionCenter.x + currentPosition.x, collisionCenter.y + currentPosition.y, collisionCenter.z + currentPosition.z);\r\n }",
"public Map<String, DataCenterPushInfo> getDataCenterPushInfo() {\n return dataCenterPushInfo;\n }",
"protected static WorkflowDVFSDatacenter createDatacenter(String name) {\n List<PowerHost> hostList = new ArrayList<>();\n \n // 2. A Machine contains one or more PEs or CPUs/Cores. Therefore, should\n // create a list to store these PEs before creating\n // a Machine.\n for (int i = 1; i <= 20; i++) {\n List<Pe> peList1 = new ArrayList<>();\n double maxPower = 250; // 250W\n \t\tdouble staticPowerPercent = 0.7; // 70%\n int mips = 1500;\n \n boolean enableDVFS = true; // is the Dvfs enable on the host\n \t\tArrayList<Double> freqs = new ArrayList<>(); // frequencies available by the CPU\n \t\tfreqs.add(59.925); // frequencies are defined in % , it make free to use Host MIPS like we want.\n \t\tfreqs.add(69.93); // frequencies must be in increase order !\n \t\tfreqs.add(79.89);\n \t\tfreqs.add(89.89);\n \t\tfreqs.add(100.0);\n \t\t\n \t\tHashMap<Integer,String> govs = new HashMap<Integer,String>(); // Define wich governor is used by each CPU\n \t\tgovs.put(0, \"ondemand\"); // CPU 1 use OnDemand Dvfs mode\n \t\t//govs.put(0, \"powersave\");\n \t\t//govs.put(0, \"performance\");\n \t\t//govs.put(0, \"conservative\");\n \t\t\n \t\tConfigDvfs = new DvfsDatas();\n\t\t\tHashMap<String,Integer> tmp_HM_OnDemand = new HashMap<>();\n\t\t\ttmp_HM_OnDemand.put(\"up_threshold\", 95);\n\t\t\ttmp_HM_OnDemand.put(\"sampling_down_factor\", 100);\n\t\t\tHashMap<String,Integer> tmp_HM_Conservative = new HashMap<>();\n\t\t\ttmp_HM_Conservative.put(\"up_threshold\", 80);\n\t\t\ttmp_HM_Conservative.put(\"down_threshold\", 20);\n\t\t\ttmp_HM_Conservative.put(\"enablefreqstep\", 0);\n\t\t\ttmp_HM_Conservative.put(\"freqstep\", 5);\n\t\t\tHashMap<String,Integer> tmp_HM_UserSpace = new HashMap<>();\n\t\t\ttmp_HM_UserSpace.put(\"frequency\", 3);\n\t\t\tConfigDvfs.setHashMapOnDemand(tmp_HM_OnDemand);\n\t\t\tConfigDvfs.setHashMapConservative(tmp_HM_Conservative);\n\t\t\tConfigDvfs.setHashMapUserSpace(tmp_HM_UserSpace);\n \t\t\n // 3. Create PEs and add these into the list.\n //for a quad-core machine, a list of 4 PEs is required:\n peList1.add(new Pe(0, new PeProvisionerSimple(mips), freqs, govs.get(0), ConfigDvfs)); // need to store Pe id and MIPS Rating\n //peList1.add(new Pe(1, new PeProvisionerSimple(mips), freqs, govs.get(0), ConfigDvfs));//\n \n int hostId = i;\n int ram = 2048; //host memory (MB)\n long storage = 1000000; //host storage\n int bw = 10000;\n hostList.add(\n \tnew PowerHost(\n \thostId,\n \tnew RamProvisionerSimple(ram),\n \tnew BwProvisionerSimple(bw),\n \tstorage,\n \tpeList1,\n \tnew VmSchedulerTimeShared(peList1),\n \tnew PowerModelSpecPower_BAZAR(peList1),\n\t\t\t\t\tfalse,\n\t\t\t\t\tenableDVFS\n )\n ); \t// This is our first machine\n \t//hostId++;\n }\n \n // 4. Create a DatacenterCharacteristics object that stores the\n // properties of a data center: architecture, OS, list of\n // Machines, allocation policy: time- or space-shared, time zone\n // and its price (G$/Pe time unit).\n String arch = \"x86\"; \t\t// system architecture\n String os = \"Linux\"; \t// operating system\n String vmm = \"Xen\";\n double time_zone = 10.0; // time zone this resource located\n double cost = 3.0; // the cost of using processing in this resource\n double costPerMem = 0.05;\t\t// the cost of using memory in this resource\n double costPerStorage = 0.1;\t// the cost of using storage in this resource\n double costPerBw = 0.1;\t\t\t// the cost of using bw in this resource\n LinkedList<Storage> storageList = new LinkedList<>();\t//we are not adding SAN devices by now\n WorkflowDVFSDatacenter datacenter = null;\n \n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n \n // 5. Finally, we need to create a storage object.\n /**\n * The bandwidth within a data center in MB/s.\n */\n int maxTransferRate = 15; // the number comes from the futuregrid site, you can specify your bw\n \n try {\n // Here we set the bandwidth to be 15MB/s\n HarddriveStorage s1 = new HarddriveStorage(name, 1e12);\n s1.setMaxTransferRate(maxTransferRate);\n storageList.add(s1);\n datacenter = new WorkflowDVFSDatacenter(name, characteristics, new PowerVmAllocationPolicySimpleWattPerMipsMetric(hostList), storageList, 0.01);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return datacenter;\n }",
"public Coordinate getCenter() {\n return center;\n }",
"public String getCloudHsmClusterId() {\n return this.cloudHsmClusterId;\n }",
"public static Map<String, String> getMapping() {\r\n\t\treturn data.get();\r\n\t}",
"public int getCenter() {\n\t\t\treturn center;\n\t\t}",
"public Map getServicesInUseMap() {\n \t\tsynchronized (contextLock) {\n \t\t\treturn servicesInUse;\n \t\t}\n \t}",
"@Nullable\n private static Map<Integer, String> readNwsoSubCenter(String path) {\n Map<Integer, String> result = new HashMap<>();\n\n try (InputStream is = GribResourceReader.getInputStream(path);\n BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {\n while (true) {\n String line = br.readLine();\n if (line == null) {\n break;\n }\n if ((line.isEmpty()) || line.startsWith(\"#\")) {\n continue;\n }\n\n StringBuilder lineb = new StringBuilder(line);\n StringUtil2.removeAll(lineb, \"'+,/\");\n String[] flds = lineb.toString().split(\"[:]\");\n\n int val = Integer.parseInt(flds[0].trim()); // must have a number\n String name = flds[1].trim() + \": \" + flds[2].trim();\n\n result.put(val, name);\n }\n return Collections.unmodifiableMap(result); // all at once - thread safe\n\n } catch (IOException ioError) {\n logger.warn(\"An error occurred in Grib1Tables while trying to open the table \" + path + \" : \" + ioError);\n return null;\n }\n }",
"public Map<String, Object> map() {\n Map<String, Object> tomcatInstanceMap = new HashMap<>();\n tomcatInstanceMap.put(\"instanceUUID\", tomcatInstanceUUID);\n tomcatInstanceMap.put(\"instanceName\", instanceName);\n tomcatInstanceMap.put(\"environmentName\", environmentName);\n tomcatInstanceMap.put(\"tomcatVersion\", tomcatVersion);\n tomcatInstanceMap.put(\"destinationFolder\", destinationFolder.getAbsolutePath());\n tomcatInstanceMap.put(\"compressed\", compressed);\n tomcatInstanceMap.put(\"primaryPort\", primaryPort);\n tomcatInstanceMap.put(\"protocolPrimaryPort\", protocolPrimaryPort);\n tomcatInstanceMap.put(\"shutdownPort\", shutdownPort);\n tomcatInstanceMap.put(\"ajpPort\", ajpPort);\n tomcatInstanceMap.put(\"secureInstance\", secureInstance);\n tomcatInstanceMap.put(\"securePort\", securePort);\n tomcatInstanceMap.put(\"protocolSecurePort\", protocolSecurePort);\n tomcatInstanceMap.put(\"keystoreSourceFilename\", keystoreSourceFilename);\n tomcatInstanceMap.put(\"keystoreCredentials\", keystoreCredentials);\n tomcatInstanceMap.put(\"jvmOptionXms\", jvmOptionXms);\n tomcatInstanceMap.put(\"jvmOptionXmx\", jvmOptionXmx);\n tomcatInstanceMap.put(\"jvmOptionXss\", jvmOptionXss);\n tomcatInstanceMap.put(\"jvmOptionXXMaxMetaspaceSize\", jvmOptionXXMaxMetaspaceSize);\n tomcatInstanceMap.put(\"jvmOptions\", jvmOptions);\n tomcatInstanceMap.put(\"instanceManagement\", instanceManagement);\n /**\n * Serialize our Instance Management Properties\n */\n List<Map<String,String>> instanceManagementPropertiesMapList =\n new ArrayList<>(instanceManagementProperties.size());\n for(TomcatInstanceProperty tomcatInstanceProperty : instanceManagementProperties) {\n instanceManagementPropertiesMapList.add(tomcatInstanceProperty.map());\n }\n tomcatInstanceMap.put(\"instanceManagementProperties\", instanceManagementPropertiesMapList);\n /**\n * Serialize our Instance Properties\n */\n List<Map<String,String>> instancePropertiesMapList =\n new ArrayList<>(instanceProperties.size());\n for(TomcatInstanceProperty tomcatInstanceProperty : instanceProperties) {\n instancePropertiesMapList.add(tomcatInstanceProperty.map());\n }\n tomcatInstanceMap.put(\"instanceProperties\", instancePropertiesMapList);\n /**\n * Return the Map for Persisting as YAML.\n */\n return tomcatInstanceMap;\n }",
"com.google.protobuf.ByteString\n getClusterNameBytes();",
"public Map<Integer, Integer> getMemoryDataMap(){\n return dataMemory.getMemoryMap();\n }",
"public ConcurrentNavigableMap<String, String> getCrawlData() {\n\t\tDB db = DBMaker.newFileDB(dbCrawlFile).closeOnJvmShutdown().make();\n\t\treturn db.getTreeMap(\"WadaTechData\");\n\t}",
"@Override\n\tpublic void startDatacenters() throws Exception {\n\t}",
"public Map<String, Dataset> getLocalClientSideDatasets() {\n HashMap<String, Dataset> result = new HashMap<String, Dataset>();\n for (String clientSideName : this._clientSideDatasetNames) {\n result.put(clientSideName, _localDatasets.get(clientSideName));\n }\n \n return result;\n }",
"public Map<String, String> getMDCPropertyMap() {\n return null;\n }",
"public com.tangosol.net.Cluster getCluster()\n {\n return __m_Cluster;\n }",
"Map<String,String> getNodeData(T node);",
"public java.util.List<EinsteinClusterTracker.Cluster> getClusters() {\n return this.clusters;\n }",
"public Map<String, String> getData() {\n if (data == null) data = new HashMap<>();\n return data;\n }",
"public String getKeyspace() {\n return keyspace;\n }",
"private void getMapping() {\n double [][] chars = new double[CHAR_SET_SIZE][1];\n for (int i = 0; i < chars.length; i++) {\n chars[i][0] = i;\n }\n Matrix b = new Matrix(key).times(new Matrix(chars));\n map = b.getArray();\n }",
"public String getClusterId() {\n return this.ClusterId;\n }",
"public List<VPlexClusterInfo> getClusterInfoDetails() throws VPlexApiException {\n s_logger.info(\"Request for complete detailed cluster info for VPlex at {}\", _baseURI);\n return _discoveryMgr.getClusterInfo(false, true);\n }",
"public Map<ComponentId, CHILD> getComponentMap() {\n return Collections.unmodifiableMap(producerById);\n }",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();"
] | [
"0.66389865",
"0.6376439",
"0.6052528",
"0.5974383",
"0.5788758",
"0.576424",
"0.5699067",
"0.5442242",
"0.5423877",
"0.538855",
"0.5371179",
"0.53255653",
"0.528228",
"0.5280446",
"0.5245425",
"0.52413464",
"0.51994854",
"0.50603557",
"0.5020666",
"0.50052696",
"0.49450317",
"0.49238834",
"0.49201068",
"0.49197176",
"0.49112797",
"0.4910253",
"0.49061546",
"0.490417",
"0.48747587",
"0.48532823",
"0.48492718",
"0.48462948",
"0.48265892",
"0.48086512",
"0.47938216",
"0.47933927",
"0.47881547",
"0.47878483",
"0.47796613",
"0.47679344",
"0.4764502",
"0.4757516",
"0.4748119",
"0.47426957",
"0.47319645",
"0.4724816",
"0.47044942",
"0.469281",
"0.46868593",
"0.46868593",
"0.46823722",
"0.46800548",
"0.46724746",
"0.46712923",
"0.4669482",
"0.4666718",
"0.4654173",
"0.46473905",
"0.46445388",
"0.46443027",
"0.46395123",
"0.46370146",
"0.46352702",
"0.46349323",
"0.46287623",
"0.4617835",
"0.46160182",
"0.46110776",
"0.46081394",
"0.46038324",
"0.4594548",
"0.45934305",
"0.45858106",
"0.4580014",
"0.4578632",
"0.45767376",
"0.45750013",
"0.45734656",
"0.4570122",
"0.45682627",
"0.45658648",
"0.45536295",
"0.45493403",
"0.4543742",
"0.45427877",
"0.45420417",
"0.45387402",
"0.45334312",
"0.45264763",
"0.4517446",
"0.45166463",
"0.45080543",
"0.45063835",
"0.44969562",
"0.44916415",
"0.4491169",
"0.4491169",
"0.4491169",
"0.4491169",
"0.4491169"
] | 0.6977031 | 0 |
checks the cluster map and tells whether this is a sharded database (ie. a distributed DB where at least two nodes contain distinct subsets of data) or not | default boolean isSharded() {
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isNeedSharding();",
"boolean hasCluster();",
"boolean getIsClusteringKey();",
"protected boolean isClusterRequired() {\n return true;\n }",
"boolean isAllowClusterGet();",
"boolean hasClusterName();",
"public boolean isShardable() {\n return SHARDABLE_RUNNERS.contains(runnerName);\n }",
"boolean isClusterBulkLoadEnabled();",
"private boolean shardExistsInNode(final NodeGatewayStartedShards response) {\n return response.storeException() != null || response.allocationId() != null;\n }",
"private boolean distBeltExists(){ \n String table = \"DISTBELT\";\n \n try {\n stmt = conn.createStatement();\n rs = stmt.executeQuery(\"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC'\");\n \n while(rs.next()){\n if(table.equalsIgnoreCase(rs.getString(\"TABLE_NAME\"))){\n return true;\n }\n }\n \n stmt.close();\n rs.close();\n \n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return false; \n }",
"private boolean isRankConsistent() {\r\n for (int i = 0; i < size(); i++)\r\n if (i != rank(select(i))) return false;\r\n for (Key key : keys())\r\n if (key.compareTo(select(rank(key))) != 0) return false;\r\n return true;\r\n }",
"private boolean isRankConsistent() {\n for (int i = 0; i < size(); i++)\n if (i != rank(select(i))) return false;\n for (K key : keys())\n if (key.compareTo(select(rank(key))) != 0) return false;\n return true;\n }",
"boolean isTerracottaClustered();",
"@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }",
"@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }",
"public static boolean tile_in_cluster(int x, int y){\n int cx = (int)Math.floor((float)x / WorldChunk.CHUNK_SIZE);\n int cy = (int)Math.floor((float)y / WorldChunk.CHUNK_SIZE);\n\n return chunk_in_cluster(cx,cy);\n }",
"private boolean basemapExists(String basemap) {\r\n ArrayList args = new ArrayList();\r\n args.add(basemap);\r\n int nbase = magicDataTpl.queryForObject(\r\n \"SELECT count(id) FROM \" + env.getProperty(\"postgres.local.mapsTable\") + \" WHERE name=? AND \" + \r\n userAuthoritiesProvider.getInstance().sqlRoleClause(\"allowed_usage\", \"owner_name\", args, \"read\"), \r\n Integer.class, \r\n args.toArray()\r\n );\r\n return(nbase > 0);\r\n }",
"public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}",
"public abstract boolean isDatabaseSet();",
"boolean hasSharedSet();",
"public abstract boolean hasMapped(Long queryNode);",
"private boolean hasExistingReplica(String collection, String shard, String node) throws IOException, SolrServerException {\n \n CollectionAdminRequest.ClusterStatus statusRequest = new CollectionAdminRequest.ClusterStatus();\n statusRequest.setCollectionName(collection);\n NamedList<Object> response = statusRequest.process(solr).getResponse();\n\n HashMap<String, Object> collectionObj = (HashMap<String, Object>) response.findRecursive(\"cluster\", \"collections\", collection);\n HashMap<String, Object> replicasObj = get(get(get(collectionObj, \"shards\"), shard), \"replicas\");\n for (String key : replicasObj.keySet()) {\n HashMap<String, Object> replica = get(replicasObj, key);\n String nodeName = (String)replica.get(\"node_name\");\n if (nodeName.equals(node)) return true;\n }\n return false;\n }",
"public boolean isFullHouse() {\n // TODO: complete this method. Hint: could you call the pair and three-of-a-kind\n // methods here?\n \treturn rankSet().size() ==2 && sameSet.size() == 2;\n }",
"@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }",
"boolean hasPermissionOfCluster(String clusterId, String userName);",
"public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }",
"public static boolean isClusterOK() {\n\t\ttry {\n\t\t\tHealthStatus status = getRESTClient().cluster().health().status();\n\t\t\treturn !HealthStatus.Red.equals(status);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(null, e);\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isDistributed() {\n\t\treturn distributed;\n\t}",
"boolean hasMasterKey();",
"public boolean isRedisClusterMode()\n\t{\n\t\tString isCluster = provider.getRedisSettings().get(IConfigProvider.REDIS_CLUSTER_MODE);\n\t\tif( StringUtils.isNotBlank( isCluster ) && \"true\".equals(isCluster)){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public boolean hasMid() {\n return genClient.cacheHasKey(CacheKey.mid);\n }",
"public boolean isSmapDumped();",
"public abstract boolean hasMapped(Edge queryEdge);",
"public boolean isMasterKey()\n {\n return (subSigs == null);\n }",
"boolean piecesContiguous(Piece side) {\n int k;\n int l;\n sideAbbrev = side.abbrev();\n for (int i = 0; i < M; i++) {\n for (int j = 0; j < M; j++) {\n _visited[i][j] = false;\n }\n }\n contSum = 0;\n for (k = 0; k < M; k++) {\n for (l = 0; l < M; l++) {\n if (boardArr[k][l].abbrev().equals(sideAbbrev)) {\n return dfs(k, l) == totalCount(side);\n }\n }\n }\n return false;\n }",
"private boolean isNeedCut(Map<Set<String>, Integer> preMap, Set<String> set) {\n\t\tboolean flag = false;\n\t\tList<Set<String>> subSets = getSubSets(set);\n\t\tfor(Set<String> subSet : subSets){\n\t\t\tif(!preMap.containsKey(subSet)){\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}",
"@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }",
"public boolean isSetNumClusteringCols() {\n return EncodingUtils.testBit(__isset_bitfield, __NUMCLUSTERINGCOLS_ISSET_ID);\n }",
"public boolean isCollectorHostExternal(String clusterName);",
"public boolean isSharded() {\n return sharded;\n }",
"public static void main(String[] args) {\n System.out.println(DiskSpace.isWritable(10, 2, new HashSet<>(Arrays.asList(2, 3, 5, 8, 9))));\n }",
"public boolean isWebsiteInCluster(String website) {\r\n\t\tCluster temp = getACluster(website);\r\n\t\tif(temp == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor(Cluster c : this.clusters) {\r\n\t\t\tfor(Cluster.Point point : c.getPoints()) {\r\n\t\t\t\tfor(Cluster.Point tempPoint : temp.getPoints()) {\r\n\t\t\t\t\tif(point == tempPoint)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean run()\n throws Exception {\n\n _startTreeCluster.start();\n _refCluster.start();\n\n SegmentInfoProvider segmentInfoProvider = new SegmentInfoProvider(_segmentDirName);\n StarTreeQueryGenerator queryGenerator =\n new StarTreeQueryGenerator(_tableName, segmentInfoProvider.getSingleValueDimensionColumns(),\n segmentInfoProvider.getMetricColumns(), segmentInfoProvider.getSingleValueDimensionValuesMap());\n\n boolean ret = true;\n for (int i = 0; i < _numQueries; i++) {\n String query = queryGenerator.nextQuery();\n LOGGER.info(\"QUERY: {}\", query);\n\n JsonNode refResponse = JsonUtils.stringToJsonNode(_refCluster.query(query));\n JsonNode starTreeResponse = JsonUtils.stringToJsonNode((_startTreeCluster.query(query)));\n\n if (QueryComparison.compare(refResponse, starTreeResponse, false)) {\n LOGGER.error(\"Comparison PASSED: {}\", query);\n } else {\n ret = false;\n LOGGER.error(\"Comparison FAILED: {}\", query);\n LOGGER.info(\"Ref Response: {}\", _refCluster.query(query));\n LOGGER.info(\"StarTree Response: {}\", _startTreeCluster.query(query));\n }\n }\n\n return ret;\n }",
"boolean misfireIfRunning(Collection<Integer> shardingItems);",
"int getClusteringKeyCount();",
"public boolean isSparseColumnSet(int column) throws SQLServerException\n {\n checkClosed();\n \n CryptoMetadata cryptoMetadata = rs.getColumn(column).getCryptoMetadata();\n if(null != cryptoMetadata){\n \treturn cryptoMetadata.getBaseTypeInfo().isSparseColumnSet();\n }\n \n return rs.getColumn(column).getTypeInfo().isSparseColumnSet();\n }",
"boolean shouldRebalance() {\n if (ThreadLocalRandom.current().nextInt(100) > REBALANCE_PROB_PERC) {\n return false;\n }\n\n // if another thread already runs rebalance -- skip it\n if (!isEngaged(null)) {\n return false;\n }\n int numOfEntries = entryIndex.get() / FIELDS;\n int numOfItems = statistics.getCompactedCount();\n int sortedCount = this.sortedCount.get();\n // Reasons for executing a rebalance:\n // 1. There are no sorted keys and the total number of entries is above a certain threshold.\n // 2. There are sorted keys, but the total number of unsorted keys is too big.\n // 3. Out of the occupied entries, there are not enough actual items.\n return (sortedCount == 0 && numOfEntries * MAX_ENTRIES_FACTOR > maxItems) ||\n (sortedCount > 0 && (sortedCount * SORTED_REBALANCE_RATIO) < numOfEntries) ||\n (numOfEntries * MAX_IDLE_ENTRIES_FACTOR > maxItems && numOfItems * MAX_IDLE_ENTRIES_FACTOR < numOfEntries);\n }",
"private boolean inDatabase() {\r\n \t\treturn inDatabase(0, null);\r\n \t}",
"public boolean checkDbStructure(){\n\t\tboolean isStructureOk = false;\n\t\t\n\t\ttry {\n\t\t\tmMysqlConnection = DriverManager\n\t\t\t\t.getConnection(getConnectionURI());\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Description, Version from \" + mDbName + \".\" + TABLE_AREA);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Area_ID, Route_ID from \" + mDbName + \".\" + TABLE_AREA_HAS_ROUTES);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Ticket_ID, Name, StartName, EndName from \" + mDbName + \".\" + TABLE_ROUTE);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Route_ID, Station_ID, Position from \" + mDbName + \".\" + TABLE_ROUTE_HAS_STATIONS);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Abbreviation, Latitude, Longitude from \" + mDbName + \".\" + TABLE_STATION);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Icon, Is_Superior from \" + mDbName + \".\" + TABLE_TICKET);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tisStructureOk = true;\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t\tisStructureOk = false;\n\t\t}\n\t\t\n\t\treturn isStructureOk;\n\t}",
"public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}",
"public boolean evaluateDataClientHeavy() {\n // reset labels\n resetLabels();\n // get IDs of players\n // create one map with playerName and playerID\n // create one map with playerID and the count how often this player participates in this game\n List<Map<String, Object>> returnList;\n Map<String, Integer> mapNameToID = new HashMap<>();\n HashMap<Integer, Integer> mapIDToCount = new HashMap<>();\n if (!dbAccess.openConn()) {\n showAlertDBError();\n return false;\n }\n for (String playerName : playerNameList) {\n returnList = dbAccess.selectSQL(\"SELECT players.id FROM players WHERE players.name = '\" + playerName + \"';\");\n if (returnList == null || returnList.isEmpty()) {\n showAlertDBError();\n return false;\n } else {\n int playerID = (int) returnList.get(0).get(\"id\");\n if (!mapNameToID.containsKey(playerName)) {\n mapNameToID.put(playerName, playerID);\n }\n if (!mapIDToCount.containsKey(playerID)) {\n mapIDToCount.put(playerID, 1);\n } else {\n mapIDToCount.put(playerID, mapIDToCount.get(playerID) + 1);\n }\n }\n }\n\n // get all games and all participants from DB\n List<Map<String, Object>> dbGames = dbAccess.selectSQL(\"SELECT * FROM games;\");\n List<Map<String, Object>> dbParticipants = dbAccess.selectSQL(\"SELECT * FROM participants;\");\n if (dbGames == null || dbParticipants == null) {\n showAlertDBError();\n return false;\n }\n dbAccess.closeConn();\n\n // create winners map\n // holds gameID and ID of winning participant, if game has no winner participantID is -1\n HashMap<Integer, Integer> mapGameIDToWinnerID = new HashMap<>();\n\n // iterate all games\n for (Map<String, Object> rowGames : dbGames) {\n boolean dumpGame = false;\n int gameId = (int) rowGames.get(\"id\");\n String endTime = null;\n if (rowGames.get(\"end_time\") != null)\n endTime = rowGames.get(\"end_time\").toString();\n boolean isAIOnly = (boolean) rowGames.get(\"ai_only\");\n // get deepCopy of mapIDToCount\n Map<Integer, Integer> idToCountCopy = copyHashMapIntInt(mapIDToCount);\n // check if game was aborted preemptively\n if (endTime == null)\n continue;\n int winner = -1;\n\n //iterate all participants\n for (Map<String, Object> rowParticipants : dbParticipants) {\n // check if game.id matches participants.game\n if (gameId == (int) rowParticipants.get(\"game\")) {\n // get participants.id\n int playerID = (int) rowParticipants.get(\"player\");\n // check if participant is in the map of participants, if not skip to next game (break)\n if (idToCountCopy.containsKey(playerID)) {\n // check if the count in this map is higher than 0, if not skip to next game (break)\n if (idToCountCopy.get(playerID) > 0) {\n // lower value of count in map of participants for this participant\n idToCountCopy.put(playerID, idToCountCopy.get(playerID) - 1);\n // if this participant is winner - store it temporarily\n if (rowParticipants.get(\"winner\") != null) {\n winner = playerID;\n }\n } else {\n dumpGame = true;\n break;\n }\n } else {\n dumpGame = true;\n break;\n }\n }\n }\n // check if every value in idToCountCopy is 0\n // if yes -> save game and winner in winners map\n // if not -> dump game\n for (Map.Entry<Integer, Integer> entry : idToCountCopy.entrySet()) {\n if (entry.getValue() != 0) {\n dumpGame = true;\n }\n }\n if (dumpGame == false) {\n mapGameIDToWinnerID.put(gameId, winner);\n }\n }\n\n // check if any games with this constellation of players was played\n if (mapGameIDToWinnerID.isEmpty()) {\n resetPieChart();\n resetLabels();\n showAlertSelectionFail(\"Selection error\", \"No games with this constellation were found.\");\n return false;\n }\n\n // calculate average turns until winner is determined\n if (!dbAccess.openConn()) {\n showAlertDBError();\n return false;\n }\n Integer turnSum = 0;\n Integer gameCounter = 0;\n int averageTurns = 0;\n for (Map.Entry<Integer, Integer> entry : mapGameIDToWinnerID.entrySet()) {\n // check if game has winner\n if (entry.getValue() != -1) {\n // get number of turns for this game\n List<Map<String, Object>> resultList = dbAccess.selectSQL(\"SELECT MAX(turn) FROM moves WHERE game = \" + entry.getKey() + \";\");\n if (resultList == null || resultList.isEmpty()) {\n showAlertDBError();\n return false;\n } else {\n turnSum += (int) resultList.get(0).get(\"MAX(turn)\");\n gameCounter++;\n }\n }\n }\n\n // calculate average turns\n String strAverageTurns = \"\";\n if (gameCounter > 0) {\n averageTurns = Math.round(turnSum / gameCounter);\n }\n strAverageTurns = String.valueOf(averageTurns);\n dbAccess.closeConn();\n\n // now process mapGameIDToWinnerID to pieChart and labels\n Map<String, Integer> mapNameToWins = new HashMap<>();\n // iterate over GameID-WinnerID map and count wins for each player\n int endlessGames = 0;\n for (Map.Entry<Integer, Integer> entryWins : mapGameIDToWinnerID.entrySet()) {\n if (entryWins.getValue() == -1)\n endlessGames++;\n for (Map.Entry<String, Integer> entryName : mapNameToID.entrySet()) {\n if (entryName.getValue() == entryWins.getValue()) {\n if (!mapNameToWins.containsKey(entryName.getKey())) {\n mapNameToWins.put(entryName.getKey(), 1);\n } else {\n mapNameToWins.put(entryName.getKey(), mapNameToWins.get(entryName.getKey()) + 1);\n }\n }\n }\n }\n // add players without wins to the map\n for (Map.Entry<String, Integer> entry : mapNameToID.entrySet()) {\n if (!mapNameToWins.containsKey(entry.getKey()))\n mapNameToWins.put(entry.getKey(), 0);\n }\n\n // fill labels with numbers\n lblTotalGames.setText(String.valueOf(mapGameIDToWinnerID.size()));\n lblGamesWithoutWinner.setText(String.valueOf(endlessGames));\n if (averageTurns == 0) {\n lblAverageTurns.setText(\"Not available\");\n } else {\n lblAverageTurns.setText(strAverageTurns);\n }\n int labelCounter = 1;\n for (Map.Entry<String, Integer> entry : mapNameToWins.entrySet()) {\n vBoxDesc.getChildren().add(labelCounter, new Label(entry.getKey() + \":\"));\n vBoxNumbers.getChildren().add(labelCounter, new Label(String.valueOf(entry.getValue()) + \" wins\"));\n }\n\n // fill pieChart\n pieChartData = FXCollections.observableArrayList();\n for (Map.Entry<String, Integer> entry : mapNameToWins.entrySet()) {\n pieChartData.add(new PieChart.Data(entry.getKey(), entry.getValue()));\n }\n if (endlessGames > 0) {\n pieChartData.add(new PieChart.Data(\"No winner\", endlessGames));\n }\n chart.setData(pieChartData);\n chart.setTitle(\"Winners by percentage\");\n\n lblCaption.setTextFill(Color.web(\"#404040\", 1.0));\n lblCaption.setStyle(\"-fx-font: 24 arial;\");\n\n // set percentages\n for (PieChart.Data data : chart.getData()) {\n data.getNode().addEventHandler(MouseEvent.MOUSE_PRESSED,\n new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent e) {\n lblCaption.setTranslateX(e.getSceneX());\n lblCaption.setTranslateY(e.getSceneY());\n double percentage = (data.getPieValue() * 100) / Integer.valueOf(mapGameIDToWinnerID.size()).doubleValue();\n String strPercentage = formatDec(percentage);\n lblCaption.setText(String.valueOf(strPercentage + \"%\"));\n }\n });\n }\n // add pieChart and caption\n if (!diagramBox.getChildren().contains(chart))\n diagramBox.getChildren().add(chart);\n if (!root.getChildren().contains(lblCaption))\n root.getChildren().add(lblCaption);\n return true;\n }",
"protected boolean datasetExists(URI dataset) {\n return Db.getStatements(dataset, RDF.TYPE, Sparql.namespaced(\"dcat\",\"Dataset\"),true,dataset).size() == 1;\n }",
"ConsistencyLevel consistency();",
"public boolean win(){\r\n for(int row = 0; row<map.length; row++){\r\n for(int col = 0; col<map[0].length; col++){\r\n if(map[row][col].getSafe() == false && (map[row][col].getVisual().equals(square) || map[row][col].getVisual().equals(bomb))){\r\n return false;\r\n }\r\n if(map[row][col].getSafe() == true && map[row][col].getVisual().equals(flag)){\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMergeStore();",
"public Clusters()\r\n\t{\r\n\t\tcluster = new boolean[MAX_CLUSTERS];\r\n\t}",
"@Override\r\n public boolean isSatisfied(Configuration cfg) {\r\n Set<Node> firstNodes = new HashSet<Node>();\r\n Set<Node> secondNodes = new HashSet<Node>();\r\n if (getFirstSet().size() == 0 || getSecondSet().size() == 0) {\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Some sets of virtual machines are empty\");\r\n return false;\r\n }\r\n\r\n for (VirtualMachine vm : getFirstSet()) {\r\n if (cfg.isRunning(vm)) {\r\n firstNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n for (VirtualMachine vm : getSecondSet()) {\r\n if (cfg.isRunning(vm)) {\r\n secondNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n\r\n for (Node n : firstNodes) {\r\n if (secondNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(firstNodes);\r\n ns.retainAll(secondNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n for (Node n : secondNodes) {\r\n if (firstNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(secondNodes);\r\n ns.retainAll(firstNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"void findMatchings(boolean isProtein) {\n\n GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();\n HashSet<String > searchSpaceList = new HashSet<>();\n GraphDatabaseService databaseService = dbFactory.newEmbeddedDatabase(graphFile);\n for (int id: queryGraphNodes.keySet()) {\n if(isProtein)\n searchSpaceList.add(queryGraphNodes.get(id).label);\n else\n searchSpaceList.add(String.valueOf(queryGraphNodes.get(id).labels.get(0)));\n }\n for(String x: searchSpaceList) {\n ResourceIterator<Node> xNodes;\n try(Transaction tx = databaseService.beginTx()) {\n xNodes = databaseService.findNodes(Label.label(x));\n tx.success();\n }\n\n while (xNodes.hasNext()) {\n Node node = xNodes.next();\n if (searchSpaceProtein.containsKey(x))\n searchSpaceProtein.get(x).add(node.getId());\n else {\n HashSet<Long> set = new HashSet<>();\n set.add(node.getId());\n searchSpaceProtein.put(x, set);\n }\n }\n\n }\n\n if(isProtein)\n search(0, databaseService, true);\n else\n search(0, databaseService, false);\n databaseService.shutdown();\n }",
"@Override\n public boolean isConnected() {\n for (node_data n : G.getV()) {\n bfs(n.getKey());\n for (node_data node : G.getV()) {\n if (node.getTag() == 0)\n return false;\n }\n }\n return true;\n }",
"public boolean deleteSpectralCluster(){\r\n\t\tList<TagCluster> tagClusters = this.listTagCluster();\r\n\t\tfor (TagCluster tagCluster : tagClusters) {\r\n\t\t\tentityManager.remove(tagCluster);\r\n//\t\t\tentityManager.flush();\r\n\t\t}\r\n\t\treturn listTagCluster().isEmpty();\r\n\t}",
"public boolean minSize(){\n\t\tboolean result; \n\t\tif(keys.size() < (MAXKEYS/2) -1){\n\t\t\tresult = true;\n\t\t}\n\t\telse{ \n\t\t\tresult = false;\n\t\t}\n\t\treturn result;\n\t}",
"private boolean isLeafStage(DispatchablePlanMetadata dispatchablePlanMetadata) {\n return dispatchablePlanMetadata.getScannedTables().size() == 1;\n }",
"@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}",
"boolean hasDatabaseSpec();",
"public static boolean safePrimer(String primer) throws ClientProtocolException, IOException {\n\t\tString primerMatch = PhagesDB.locallyBLAST(primer);\n\t\tScanner primerFinder = new Scanner(primerMatch);\n\t\tprimerFinder.useDelimiter(\"\\n\");\n\t\tdo {\n\t\t\tString nextLine = primerFinder.next();\n\t\t\tif (nextLine.startsWith(\">\") && nextLine.contains(\"Mycobacterium\")) {\n\t\t\t\tboolean blackListed = false;\n\t\t\t\tfor (String phage : OUT_BLACK_LIST)\n\t\t\t\t\tblackListed = blackListed || nextLine.contains(phage);\n\t\t\t\tnextLine = primerFinder.next();\n\t\t\t\tif (nextLine.indexOf(\"Cluster\") > 0 && !blackListed) {\n\t\t\t\t\tString cluster;\n\t\t\t\t\tif (nextLine.endsWith(\"Cluster\")) \n\t\t\t\t\t\tcluster = primerFinder.next().replace(\" \", \"\");\n\t\t\t\t\telse \n\t\t\t\t\t\tcluster = nextLine.substring(nextLine.indexOf(\"Cluster\") + 8);\n\t\t\t\t\tif (!cluster.equals(CLUSTER) && ((CLUSTER.startsWith(cluster) && !cluster.matches(\".*\\\\d+.*\")) || (cluster.startsWith(CLUSTER) && !CLUSTER.matches(\".*\\\\d+.*\"))))\n\t\t\t\t\t\tcluster = CLUSTER;\n\t\t\t\t\tcluster= cluster.replaceAll(\"\\\\s+\",\"\");\n\t\t\t\t\tString matchString = primerFinder.next();\n\t\t\t\t\twhile (!matchString.contains(\"Identities\"))\n\t\t\t\t\t\tmatchString = primerFinder.next();\n\t\t\t\t\tint matchLength = Integer.parseInt(matchString.substring(matchString.indexOf(\"=\") + 2, matchString.indexOf(\"/\")));\n\t\t\t\t\tif ((double) (matchLength / primer.length()) > MAX_FALSE_FRACTION && !CLUSTER.equals(cluster)) {\n\t\t\t\t\t\tprimerFinder.close();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while(primerFinder.hasNext());\n\t\tprimerFinder.close();\n\t\treturn true;\n\t}",
"private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }",
"public boolean hasFrontendMid() {\n return genClient.cacheHasKey(CacheKey.frontendMid);\n }",
"public boolean hasSingleNodeExecutionPreference(Session session, Metadata metadata)\n {\n return (hasEmptyGroupingSet() && !hasNonEmptyGroupingSet()) || (hasDefaultOutput() && !isDecomposable(session, metadata));\n }",
"boolean hasServerId();",
"boolean isExecuteMisfired(Collection<Integer> shardingItems);",
"boolean hasPartitionLimit();",
"public boolean hasProduction() {\n return genClient.cacheHasKey(CacheKey.production);\n }",
"protected boolean hasOverlap(Cluster cluster1, Cluster cluster2) {\n return (cluster1.startTime < cluster2.endTime &&\n cluster2.startTime < cluster1.endTime);\n }",
"@Override public boolean isConsistent(List<TraceLockEntry> seq)\n{\n for (TraceLockEntry te : seq) {\n TraceLockLocation tll = te.getLocation();\n switch (te.getEntryType()) {\n\t case PREJOIN :\n\t location_set.add(tll);\n\t break;\n\t case NOJOIN :\n\t location_set.add(tll);\n\t break;\n\t case JOIN :\n\t location_set.add(tll);\n\t have_join = true;\n\t break;\n\t default :\n\t break;\n }\n }\n\n return true;\n}",
"boolean piecesContiguous(Side player) {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n if (_pieces[i][j].side() == player) {\n boolean[][] traverse = new boolean[8][8];\n return getCount(player) == contiguousHelp(traverse, i,\n j, player);\n }\n }\n }\n\n }",
"@Test\n public void testColocatedPartitionedRegion() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = SEPARATOR + \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = SEPARATOR + \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = SEPARATOR + \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = SEPARATOR + \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = SEPARATOR + \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }",
"private Result checkAllNodesAreUp(ClusterState clusterState) {\n\n for (NodeInfo storageNodeInfo : clusterInfo.getStorageNodeInfo()) {\n State wantedState = storageNodeInfo.getUserWantedState().getState();\n if (wantedState != State.UP && wantedState != State.RETIRED) {\n return Result.createDisallowed(\"Another storage node wants state \" +\n wantedState.toString().toUpperCase() + \": \" + storageNodeInfo.getNodeIndex());\n }\n\n State state = clusterState.getNodeState(storageNodeInfo.getNode()).getState();\n if (state != State.UP && state != State.RETIRED) {\n return Result.createDisallowed(\"Another storage node has state \" + state.toString().toUpperCase() +\n \": \" + storageNodeInfo.getNodeIndex());\n }\n }\n\n for (NodeInfo distributorNodeInfo : clusterInfo.getDistributorNodeInfo()) {\n State wantedState = distributorNodeInfo.getUserWantedState().getState();\n if (wantedState != State.UP && wantedState != State.RETIRED) {\n return Result.createDisallowed(\"Another distributor wants state \" + wantedState.toString().toUpperCase() +\n \": \" + distributorNodeInfo.getNodeIndex());\n }\n\n State state = clusterState.getNodeState(distributorNodeInfo.getNode()).getState();\n if (state != State.UP && state != State.RETIRED) {\n return Result.createDisallowed(\"Another distributor has state \" + state.toString().toUpperCase() +\n \": \" + distributorNodeInfo.getNodeIndex());\n }\n }\n\n return Result.allowSettingOfWantedState();\n }",
"public static boolean isConfigured(String database) {\n return instance.dataSources.containsKey(database);\n }",
"public Boolean getCacheClusterEnabled() {\n return cacheClusterEnabled;\n }",
"boolean hasSsid();",
"public abstract boolean isUsing(Long graphNode);",
"public boolean hasBackendMid() {\n return genClient.cacheHasKey(CacheKey.backendMid);\n }",
"private boolean checkSharedVertex(Segment s1, Segment s2){\n\t\tdouble wp1x = s1.w1.getX();\n\t\tdouble wp1y = s1.w1.getY();\n\t\tdouble wp2x = s1.w2.getX();\n\t\tdouble wp2y = s1.w2.getY();\n\t\tdouble wp3x = s2.w1.getX();\n\t\tdouble wp3y = s2.w1.getY();\n\t\tdouble wp4x = s2.w2.getX();\n\t\tdouble wp4y = s2.w2.getY();\n\n\t\tif (((wp1x == wp3x && wp1y == wp3y) || (wp1x == wp4x && wp1y == wp4y)) \n\t\t|| ((wp2x == wp3x && wp2y == wp3y) || (wp2x == wp4x && wp2y == wp4y)))\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}",
"public boolean isMaster();",
"public boolean isRunning(){\r\n try{\r\n List<String> dbNames = mongo.getDatabaseNames();\r\n if(!dbNames.isEmpty()){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } catch (MongoException e){\r\n// e.printStackTrace();\r\n return false;\r\n }\r\n }",
"public boolean isGravarDadosSH() throws ACBrException {\n return ACBrAACInterop.INSTANCE.AAC_GetGravarDadosSH(getHandle()) != 0;\n }",
"private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"void checkStationExists() {\n\n stationExists = false;\n dataExists = false;\n stationExistsCount = 0;\n thisSubdesCount = 0;\n// stationIgnore = false;\n\n for (int i = 0; i < MAX_STATIONS; i++) {\n stationExistsArray[i] = false;\n loadedDepthMin[i] = 9999;\n loadedDepthMax[i] = -9999;\n spldattimArray[i] = \"\";\n currentsRecordCountArray[i] = 0;\n watphyRecordCountArray[i] = 0;\n stationStatusDB[i] = \"\";\n subdesCount[i] = 0;\n for (int j = 0; j < MAX_SUBDES; j++) {\n subdesArray[i][j] = \"\";\n } // for (int j = 0; j < MAX_SUBDES; j++)\n\n } // for (int i = 0; i < MAX_STATIONS; i++)\n\n // true if station with same station Id (first select) or\n // station with same date_start & latitude & longitude &\n // <data>.spltim & <data>.subdes (second select)\n String where = MrnStation.STATION_ID + \"='\" + station.getStationId() + \"'\";\n if (dbg) System.out.println(\"<br>checkStationExists: station: where = \" +\n where);\n\n // Is there already a station record with the same station-id?\n MrnStation[] tStation2 = new MrnStation().get(where);\n if (dbg) System.out.println(\"<br>checkStationExists: tStation2.length = \" +\n tStation2.length);\n if (tStation2.length > 0) {\n //stationStatusLD = \"di\"; // == duplicate station-id\n outputDebug(\"checkStationExists: station Id found: \" +\n station.getStationId(\"\"));\n stationExists = true;\n stationExistsArray[0] = true;\n } else {\n //stationStatusLD = \"ds\"; // == duplicate station (lat/lon/date/time)\n outputDebug(\"checkStationExists: station Id not found: \" +\n station.getStationId(\"\"));\n } // if (tStation2.length > 0)\n\n // are there any other stations around the same day that fall within the\n // latitude range? (it could include the station found above)\n\n // get the previous and next day for the select, in case the\n // spldattim is just before or after midnight\n java.text.SimpleDateFormat formatter =\n new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n java.util.GregorianCalendar calDate = new java.util.GregorianCalendar();\n calDate.setTime(station.getDateStart());\n calDate.add(java.util.Calendar.DATE, -1);\n String dateStartMin = formatter.format(calDate.getTime());\n\n calDate.setTime(station.getDateEnd());\n calDate.add(java.util.Calendar.DATE, +1);\n String dateEndMax = formatter.format(calDate.getTime());\n\n where =\n MrnStation.DATE_START + \">=\" +\n Tables.getDateFormat(dateStartMin) + \" and \" +\n MrnStation.DATE_END + \"<=\" +\n Tables.getDateFormat(dateEndMax) + \" and \" +\n MrnStation.LATITUDE + \" between \" +\n (station.getLatitude()-areaRangeVal) + \" and \" +\n (station.getLatitude()+areaRangeVal) + \" and \" +\n MrnStation.LONGITUDE + \" between \" +\n (station.getLongitude()-areaRangeVal) + \" and \" +\n (station.getLongitude()+areaRangeVal);\n if (dbg) System.out.println(\"<br><br>checkStationExists: station: \" +\n \"where = \" + where);\n\n // get the records\n MrnStation[] tStation3 = new MrnStation().get(\n \"*\", where, MrnStation.STATION_ID);\n if (dbg) System.out.println(\"<br><br>checkStationExists: \" +\n \"tStation3.length = \" + tStation3.length);\n\n // put both sets of stations found in one array for processing\n tStation = new MrnStation[tStation2.length + tStation3.length];\n if (dbg) System.out.println(\"<br><br>checkStationExists: \" +\n \"tStation.length = \" + tStation.length);\n int ii = 0;\n for (int i = 0; i < tStation2.length; i++) { // same station_id\n tStation[ii] = tStation2[i];\n ii++;\n } // for (int i = 0; i < tStation2.length; i++)\n for (int i = 0; i < tStation3.length; i++) { // satem lat/lon/date/time\n tStation[ii] = tStation3[i];\n ii++;\n } // for (int i = 0; i < tStation3.length; i++)\n\n // process the records\n stationUpdated = false;\n for (int i = 0; i < tStation.length; i++) {\n\n // same station id already done\n if ((i == 0) ||\n !tStation[i].getStationId().equals(station.getStationId())) {\n\n if (tStation[i].getStationId().equals(station.getStationId())) {\n stationStatusTmp = \"di\"; // == duplicate station-id\n } else {\n stationStatusTmp = \"ds\"; // == duplicate station (lat/lon/date/time)\n } // if (tStation[i].getStationId().equals(station.getStationId()))\n\n String dbgMess = \"checkStationExists: station found in area: \" +\n i + \" \" + station.getStationId(\"\") + \" \" +\n tStation[i].getStationId(\"\");\n\n getExistingStationDetails(tStation[i], i);\n\n if (stationExistsArray[i]) {\n stationExistsCount++;\n\n outputDebug(dbgMess + \": within time range\");\n\n// if (loadFlag) {\n// updateStationDetails(i);\n// } else {\n // d == Duplicate stationId/station only\n // s == Subdes: duplicate Station (lat/lon/date/time) && subdes\n stationStatusDB[i] = stationStatusTmp;\n if (subdesCount[i] == 0) {\n // d == Duplicate stationId/station only (lat/lon/date/time)\n stationStatusDB[i] += \"d\";\n if (\"did\".equals(stationStatusDB[i])) {\n didCount++;\n } else {\n dsdCount++;\n } // if (\"did\".equals(stationStatusDB))\n } else { // if (subdesCount == 0)\n // s == Subdes: duplicate Station (lat/lon/date/time) && subdes\n stationStatusDB[i] += \"s\";\n if (\"dis\".equals(stationStatusDB[i])) {\n disCount++;\n } else {\n dssCount++;\n } // if (\"dia\".equals(stationStatusDB))\n\n thisSubdesCount += subdesCount[i];\n\n } // if (subdesCount == 0)\n// } // if (loadFlag)\n } else {\n outputDebug(dbgMess + \": NOT within time range\");\n } // if (stationExistsArray[i]) {\n\n } // if (!tStation.getStationId().equals(station.getStationId())\n\n } // for (int i = 0; i < tStation.length; i++)\n\n if (dbg) System.out.println(\"checkStationExists: stationStatusTmo = \" + stationStatusTmp);\n\n // either stations with same station Id or within same\n // area & date-time range found\n if (stationExists) {\n duplicateStations = true;\n if (dataExists) {\n stationStatusLD = \"dup\";\n } else {\n stationStatusLD = \"new\";\n newStationCount++;\n } // if (dataExists)\n } else {\n stationStatusLD = \"new\";\n newStationCount++;\n } // if (stationExists)\n\n if (dbg) System.out.println(\"checkStationExists: stationStatusLD = \" + stationStatusLD);\n if (dbg) System.out.println(\"checkStationExists: stationStatusTmo = \" + stationStatusTmp);\n for (int i = 0; i < tStation.length; i++) {\n if (dbg) System.out.println(\"checkStationExists: stationStatusDB[i] = \" +\n i + \" \" + stationStatusDB[i]);\n } // for (int i = 0; i < tStation.length; i++)\n\n }"
] | [
"0.7216955",
"0.6710798",
"0.61417335",
"0.5762146",
"0.57247645",
"0.569999",
"0.55913335",
"0.5562866",
"0.55411",
"0.55171657",
"0.55002457",
"0.54903334",
"0.54756963",
"0.5407743",
"0.54002166",
"0.5391081",
"0.5377217",
"0.5366836",
"0.5255042",
"0.5234335",
"0.5225838",
"0.5216372",
"0.51892424",
"0.5155686",
"0.51528317",
"0.5152687",
"0.51201284",
"0.5079389",
"0.5071504",
"0.5057673",
"0.5057662",
"0.5034761",
"0.50250185",
"0.49710795",
"0.49575147",
"0.49540055",
"0.49406713",
"0.49390444",
"0.4938058",
"0.49254584",
"0.49033174",
"0.49021983",
"0.48728102",
"0.48675185",
"0.48465914",
"0.4833527",
"0.48317465",
"0.48297453",
"0.48290065",
"0.48263907",
"0.4812737",
"0.48108438",
"0.47886536",
"0.47843298",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.47837657",
"0.4770377",
"0.47580236",
"0.4750899",
"0.4748294",
"0.47458783",
"0.47437385",
"0.47281203",
"0.47273144",
"0.47260398",
"0.47215572",
"0.4720455",
"0.4718993",
"0.47101265",
"0.47030044",
"0.46999735",
"0.46973893",
"0.46917152",
"0.4684041",
"0.46804342",
"0.46766734",
"0.46763307",
"0.46662393",
"0.46659696",
"0.46644047",
"0.46626326",
"0.46625704",
"0.4662043",
"0.46608484",
"0.46581697",
"0.46562496",
"0.46523076",
"0.4649017",
"0.46475866",
"0.4645442"
] | 0.0 | -1 |
If files have the same size and MD5 then they are potential duplicates. | private void checkDuplicateOfFile(Iterable<FileInfo> files, DuplicateDataDTO data) {
for(FileInfo nextFile: files) {
for(FileInfo nextFile2: files) {
if(nextFile.duplicate(nextFile2)) {
LOG.info("Duplicate - {}", nextFile);
processDuplicate(nextFile,data);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void calculateDuplicate(ArrayList<String> pathList) {\n\n HashMap<String, byte[]> pathMdHashMap = new HashMap<>();\n\n for (int i = 0; i < pathList.size(); i++) {\n\n LinkedHashMap<File, String> uniquePathAndFileHash = new LinkedHashMap<>();\n\n if (pathList.get(i) == null || !(new File(pathList.get(i)).isFile()) || !(new File(pathList.get(i)).exists()))\n continue;\n\n byte[] fileHash1 = Constant.fileHash(new File(pathList.get(i)));\n\n if (fileHash1 == null)\n continue;\n\n for (int j = i + 1; j < pathList.size(); j++) {\n\n String path = pathList.get(j);\n\n if (path == null || !(new File(path).isFile()) || !(new File(path).exists()))\n continue;\n\n byte[] fileHash2;\n\n if (pathMdHashMap.containsKey(path)) {\n fileHash2 = pathMdHashMap.get(path);\n } else {\n fileHash2 = Constant.fileHash(new File(pathList.get(j)));\n pathMdHashMap.put(path, fileHash2);\n }\n\n boolean flag = MessageDigest.isEqual(fileHash1, fileHash2);\n\n if (flag) {\n\n if (!uniquePathAndFileHashCopy.containsValue(pathList.get(i))) {\n uniquePathAndFileHash.put(new File(pathList.get(i)), pathList.get(i));\n }\n\n if (!uniquePathAndFileHashCopy.containsValue(path)) {\n uniquePathAndFileHash.put(new File(path), path);\n }\n }\n }\n\n if (uniquePathAndFileHash.size() > 1) {\n\n index++;\n\n\n LinkedHashMap<Integer, LinkedHashMap<File, String>> similarVideo = new LinkedHashMap<>();\n\n similarVideo.put(index, uniquePathAndFileHash);\n\n similarVideoCopy.put(index, uniquePathAndFileHash);\n\n uniquePathAndFileHashCopy.putAll(uniquePathAndFileHash);\n\n\n new Handler(Looper.getMainLooper()).post(() ->\n responseLiveData.setValue(FileRemoverResponse.success(similarVideo)));\n\n }\n }\n\n }",
"private String getFileMd5Checksum(String filename){\n\t\ttry {\n\t\t\tbyte[] fileBytes = Files.readAllBytes(Paths.get(FILES_ROOT + filename));\n\t\t\tbyte[] fileHash = MessageDigest.getInstance(\"MD5\").digest(fileBytes);\n\n\t\t\treturn DatatypeConverter.printHexBinary(fileHash);\n\t\t} catch (IOException e) {\n\t\t\t// TODO: Handle file doesn't exist\n\t\t\treturn \"\";\n\t\t} catch (Exception e) {\n\t\t\treturn \"\";\n\t\t}\n\t}",
"public static boolean compareFilesChecksum(String path1, String path2) {\n \t\tfinal String checksum1 = getMD5Checksum(path1);\n \t\tfinal String checksum2 = getMD5Checksum(path2);\n \t\t\n \t\tif (!TextUtils.isEmpty(checksum1) && !TextUtils.isEmpty(checksum2)) {\n \t\t\treturn checksum1.equals(checksum2);\n \t\t}\n \t\t\n \t\treturn false;\n \t}",
"private static String getMD5Checksum(String filename) throws Exception {\r\n\t\tbyte[] b = createChecksum(filename);\r\n\t\tStringBuilder result = new StringBuilder();\r\n\t\tfor (byte v : b) {\r\n\t\t\tresult.append(Integer.toString((v & 0xff) + 0x100, 16).substring(1));\r\n\t\t}\r\n\t\treturn result.toString();\r\n\t}",
"public void mo83570c() {\n File[] listFiles;\n File file = new File(this.f60297d);\n if (file.isDirectory() && (listFiles = file.listFiles()) != null && listFiles.length >= this.f60294a) {\n Arrays.sort(listFiles, this.f60295b);\n for (int i = 0; i < listFiles.length && listFiles.length >= this.f60294a; i++) {\n File file2 = listFiles[i];\n if (!this.f60299f.contains(file2)) {\n ArgusLogger.m85574b(String.format(C6969H.m41409d(\"G4D8AC619BE22AF20E809D047FEE1C6C47DC3D008AD3FB969E71DD05BE6EAD1D26DC3D008AD3FB969EA079D41E6A5D1D26880DD1FBB70E36CF547\"), file2.getPath()));\n mo83569b(Collections.singleton(file2));\n }\n }\n }\n }",
"protected void md5file(File file) throws IOException {\n if (file.isDirectory()) {\n throw new IllegalArgumentException(\"Only files can be check summed !\");\n }\n\n // calculating the output\n byte[] md5 = DigestUtils.md5(new FileInputStream(file));\n\n // getting the output file\n File outputFile = new File(file.getAbsolutePath() + \".md5\");\n Files.write(Paths.get(outputFile.getAbsolutePath()), md5);\n\n }",
"static String generateChecksum(String filename) {\n\n try {\n // Instantiating file and Hashing Algorithm.\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n FileInputStream file = new FileInputStream(filename);\n\n // Generation of checksum.\n byte[] dataBytes = new byte[1024];\n int nread;\n\n while ((nread = file.read(dataBytes)) != -1) {\n md.update(dataBytes, 0, nread);\n }\n\n byte[] mdbytes = md.digest();\n\n // Convert byte to hex.\n StringBuilder hexString = new StringBuilder();\n\n for (byte mdbyte : mdbytes) {\n String hex = Integer.toHexString(0xff & mdbyte);\n if (hex.length() == 1) hexString.append('0');\n hexString.append(hex);\n }\n\n // Return checksum as completed string.\n return hexString.toString();\n\n } catch (NoSuchAlgorithmException | IOException e) {\n e.printStackTrace();\n }\n return null;\n }",
"public boolean IsFileMd5Equeal(UploadReport report) {\r\n\t\tString filename = this.conf.getFtpMountDirectory() + \"/DATA/\" + report.getFilename();\r\n\t\tString md5value = MD5Util.getFileMD5(new File(filename));\r\n\t\tFile file = new File(filename);\r\n\t\tif (file.exists()) {\r\n\t\t\tif (md5value.compareTo(report.getMd5value()) == 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tLogUtils.logger.error(\"Error happened when Caculate MD5 value, Original value: \" + report.getMd5value()\r\n\t\t\t\t\t\t+ \", New value : \" + md5value);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tLogUtils.logger.error(\"Error happened when Caculate MD5 value, File: \" + filename + \" does not exist! \");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public final void mo14831s() {\n Iterator it = ((ArrayList) mo14817d()).iterator();\n while (it.hasNext()) {\n File file = (File) it.next();\n if (file.listFiles() != null) {\n m6739b(file);\n long c = m6740c(file, false);\n if (((long) this.f6567b.mo14797a()) != c) {\n try {\n new File(new File(file, String.valueOf(c)), \"stale.tmp\").createNewFile();\n } catch (IOException unused) {\n f6563c.mo14884b(6, \"Could not write staleness marker.\", new Object[0]);\n }\n }\n for (File b : file.listFiles()) {\n m6739b(b);\n }\n }\n }\n }",
"public String checkDuplicates(String path)\n\t{\n\t\tFile file = new File(path);\n\n\t\t//If this file has already been created\n\t\tif(duplicates.containsKey(file))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint append = duplicates.get(file).size();\n\t\n\t\t\t\tLinkedList<File> newVal = duplicates.get(file);\n\n\t\t\t\t//create new filename\n\t\t\t\tFile newFile = File.createTempFile(file.getName().substring(0, file.getName().length()-4), \".csv\", new File(aida.getConfigValue(\"aida_dir\")));\n\t\t\t\tnewFile.deleteOnExit();\n\t\n\t\t\t\tnewVal.add(newFile);\n\t\n\t\t\t\t//store record of this file in the duplicates hashmap\n\t\t\t\tduplicates.put(file, newVal);\n\t\t\t\t\n\t\t\t\tfile = newFile;\n\t\t\t}\n\t\t\tcatch(IOException e)\n\t\t\t{\n\t\t\t\taida.logAdd(\"!Duplicate file could not be created\");\n\t\t\t\taida.logAdd(\"!\"+e.getMessage());\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tduplicates.put(file, new LinkedList<File>());\n\t\t}\n\n\t\t//return the (possibly renamed) filename\n\t\treturn file.getAbsolutePath();\n\t}",
"private boolean compressOldFiles() {\n long now = System.currentTimeMillis();\n int count = 0;\n for (LogFile lf : knownFiles) {\n // avoid compressing entire archive at once\n if (lf.canCompress(now) && (count++ < 5)) {\n compress(lf.path);\n }\n }\n return count > 0;\n }",
"private static boolean needsUpdate(File file, File oldFile, JsonObject old_manifest, JsonObject obj, long size, String hash) {\n try {\n boolean check1 = !oldFile.exists();\n if (check1) return true;\n boolean check2 = !file.exists();\n if (check2) return true;\n boolean check3 = file.length() != size;\n if (check3) return true;\n boolean check4 = old_manifest == null;\n if (check4) return true;\n boolean check5 = old_manifest.get(\"files\") == null;\n if (check5) return true;\n boolean check6 = getHashFromPath(old_manifest.get(\"files\").getAsJsonArray(), obj.get(\"path\").getAsString()) == null;\n if (check6) return true;\n boolean check7 = !getHashFromPath(old_manifest.get(\"files\").getAsJsonArray(), obj.get(\"path\").getAsString()).equals(hash);\n if (check7) return true;\n\n return false;\n } catch (Exception ex) {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n ex.printStackTrace(pw);\n log(sw.toString());\n return true;\n }\n }",
"public boolean allDuplicatesEqual() {\n int[] input = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5};\n int dupA = findDuplicatesA(input);\n int dupB = findDuplicatesB(input);\n int dupC = findDuplicatesC(input);\n int dupD = findDuplicatesD(input);\n int dupE = findDuplicatesE(input);\n return dupA == dupB && dupA == dupC && dupA == dupD && dupA == dupE;\n }",
"public static String computeMD5(String filename) throws Exception {\r\n byte[] b = createGenericChecksum(filename, 0);\r\n String result = \"\";\r\n for (int i = 0; i < b.length; i++) {\r\n result += Integer.toString((b[i] & 0xff) + 0x100, 16).substring(1);\r\n }\r\n return result;\r\n }",
"@Override\n public int hashCode() {\n return Objects.hash(filePath);\n }",
"public static byte[] createCheckSum(String filename) throws Exception {\n InputStream fis = new FileInputStream(filename);\n\n byte[] buffer = new byte[1024];\n MessageDigest complete = MessageDigest.getInstance(\"MD5\");\n int numRead;\n\n do {\n numRead = fis.read(buffer);\n if (numRead > 0) {\n complete.update(buffer, 0, numRead);\n }\n } while (numRead != -1);\n\n fis.close();\n // Return MD5 Hash\n return complete.digest();\n }",
"@Test\n public void fileMd5Test() {\n // TODO: test fileMd5\n }",
"public static String computeMD5FileHash (File file) throws Exception {\n byte[] b = createFileChecksum(file);\n String result = \"\";\n\n for (int i=0; i < b.length; i++) {\n result += Integer.toString( ( b[i] & 0xff ) + 0x100, 16).substring( 1 );\n }\n return result;\n }",
"public boolean equals(java.lang.Object r5) {\n /*\n r4 = this;\n r0 = 1\n if (r5 != r4) goto L_0x0004\n return r0\n L_0x0004:\n r1 = 0\n if (r5 != 0) goto L_0x0008\n return r1\n L_0x0008:\n java.lang.Class r2 = r5.getClass()\n java.lang.Class r3 = r4.getClass()\n boolean r2 = r2.equals(r3)\n if (r2 == 0) goto L_0x004b\n com.dropbox.core.v2.files.ThumbnailArg r5 = (com.dropbox.core.p005v2.files.ThumbnailArg) r5\n java.lang.String r2 = r4.path\n java.lang.String r3 = r5.path\n if (r2 == r3) goto L_0x0024\n boolean r2 = r2.equals(r3)\n if (r2 == 0) goto L_0x0049\n L_0x0024:\n com.dropbox.core.v2.files.ThumbnailFormat r2 = r4.format\n com.dropbox.core.v2.files.ThumbnailFormat r3 = r5.format\n if (r2 == r3) goto L_0x0030\n boolean r2 = r2.equals(r3)\n if (r2 == 0) goto L_0x0049\n L_0x0030:\n com.dropbox.core.v2.files.ThumbnailSize r2 = r4.size\n com.dropbox.core.v2.files.ThumbnailSize r3 = r5.size\n if (r2 == r3) goto L_0x003c\n boolean r2 = r2.equals(r3)\n if (r2 == 0) goto L_0x0049\n L_0x003c:\n com.dropbox.core.v2.files.ThumbnailMode r2 = r4.mode\n com.dropbox.core.v2.files.ThumbnailMode r5 = r5.mode\n if (r2 == r5) goto L_0x004a\n boolean r5 = r2.equals(r5)\n if (r5 == 0) goto L_0x0049\n goto L_0x004a\n L_0x0049:\n r0 = 0\n L_0x004a:\n return r0\n L_0x004b:\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.dropbox.core.p005v2.files.ThumbnailArg.equals(java.lang.Object):boolean\");\n }",
"public Boolean isAlreadyExist(String fileName, String md5){\n String sql =\n \"SELECT distinct fileName, firstWord FROM decodedFile \" +\n \"WHERE fileName = ? AND md5 = ?\";\n Connection conn = null;\n\n try {\n // create the connection\n conn = dataSource.getConnection();\n\n // prepare the query & execute\n PreparedStatement ps = conn.prepareStatement(sql);\n ps.setString(1, fileName);\n ps.setString(2, md5);\n ResultSet rs = ps.executeQuery();\n Boolean exist = rs.next();\n\n // close\n rs.close();\n ps.close();\n return exist;\n } catch (SQLException e) {\n LOG.error(\"Error when try to say if file \" + fileName + \" and md5 \" + md5 + \" exist in the database\");\n } finally {\n closeConnection(conn);\n }\n\n return false;\n }",
"@Test\n public void md5Checksum() throws NoSuchAlgorithmException {\n String string = Utils.md5Checksum(\"abcde fghijk lmn op\");\n Assert.assertEquals(\"1580420c86bbc3b356f6c40d46b53fc8\", string);\n }",
"public boolean findDuplicates(String file) {\n for (VideoFile movie : originalList) {\n // System.out.println(\"comparing to path: \"+movie.getPath());\n if (file.toLowerCase().contains(movie.getPath().toLowerCase())) {\n // System.out.println(\"duplicate FOUND\");\n return true;\n }\n }\n // System.out.println(\"new File FOUND\");\n return false;\n }",
"public boolean checkSumsChanged(String path) {\n Set<String> newCheckSums = new HashSet<>();\n AmazonS3Client s3Client = new AmazonS3Client(new ProfileCredentialsProvider());\n /* Get the last output folder */\n ListObjectsRequest listObjectsRequest = new ListObjectsRequest()\n .withBucketName(BUCKET_NAME)\n .withPrefix(path);\n ObjectListing objectListing;\n\n /* Go through the files and check if they are already present in the Set\n * If not, it means that the output has changed\n * The set holds a list of the checksums of the previous\n * iteration to test against the present iteration\n */\n boolean changed = false;\n do {\n objectListing = s3Client.listObjects(listObjectsRequest);\n for (S3ObjectSummary objectSummary :\n objectListing.getObjectSummaries()) {\n if (objectSummary.getKey().contains(\"part\")) {\n String checkSum = objectSummary.getETag().toString();\n if (!checkSums.contains(checkSum)) {\n changed = true;\n }\n newCheckSums.add(checkSum);\n }\n }\n listObjectsRequest.setMarker(objectListing.getNextMarker());\n } while (objectListing.isTruncated());\n\n /* If at least one file has changed, then it means we need to still keep going */\n if (changed) {\n checkSums = newCheckSums;\n return true;\n }\n return false;\n }",
"public static String md5(String inputFile) {\r\n String md5 = null;\r\n logger.debug(\"Start to calculate hashcode (SHA1) for {}\", inputFile);\r\n try (DigestInputStream digestIn = new DigestInputStream(new FileInputStream(inputFile),\r\n MessageDigest.getInstance(\"SHA1\"))) {\r\n byte[] buffer = new byte[1024 * 1024];\r\n while (digestIn.read(buffer) > 0) {\r\n // do nothing\r\n }\r\n md5 = toHexString(digestIn.getMessageDigest().digest());\r\n } catch (NoSuchAlgorithmException | IOException e) {\r\n logger.warn(\"Fail to md5 for {} ({})\", inputFile, e.getMessage());\r\n }\r\n logger.debug(\"End to calculate hashcode (SHA1) for {}, {}\", inputFile, md5);\r\n return md5;\r\n }",
"public boolean hasDuplicates(boolean ignoreWhenIdentical) {\n boolean compareJustClassNames = !ignoreWhenIdentical;\n if (compareJustClassNames) {\n return list.size() > 1;\n }\n\n if (list.size() <= 1) {\n return false;\n }\n\n String previousHash = list.get(0).getHash();\n for (int i = 1; i < list.size(); i++) {\n String currentHash = list.get(i).getHash();\n if (!previousHash.equals(currentHash)) {\n return true;\n }\n }\n\n log.debug(\"ignoring duplicates of class \" + classFilePath + \" since the bytecode matches exactly\");\n\n return false;\n }",
"private static String getFileChecksum(File file) throws IOException, NoSuchAlgorithmException {\n FileInputStream fis = new FileInputStream(file);\n\n // Use MD5 algorithm\n MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n\n // Create byte array to read data in chunks\n byte[] byteArray = new byte[1024];\n int bytesCount = 0;\n\n // Read file data and update in message digest\n while ((bytesCount = fis.read(byteArray)) != -1) {\n digest.update(byteArray, 0, bytesCount);\n }\n ;\n\n // close the stream; We don't need it now.\n fis.close();\n\n // Get the hash's bytes\n byte[] bytes = digest.digest();\n\n // This bytes[] has bytes in decimal format;\n // Convert it to hexadecimal format\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\n }\n\n // return complete hash\n return sb.toString();\n }",
"public void dxSingleSpeedsDuplicates(String fileName) throws IOException {\n // This method prints all the duplicated DXSingleSpeeds in the output\n // file.\n\n // concatenate the recorded DXSingleSpeeds in a string\n ArrayList<String> recordedDXSingleSpeedsStrings = new ArrayList<String>();\n\n for (Iterator<DXSingleSpeed> dxSingleSpeedIterator = dxSingleSpeeds.iterator(); dxSingleSpeedIterator\n .hasNext();) {\n recordedDXSingleSpeedsStrings.add(dxSingleSpeedIterator.next()\n .toMoRecordString());\n }\n\n ArrayList<String> duplicates = new ArrayList<String>();\n duplicates = saveDuplicates(recordedDXSingleSpeedsStrings);\n\n // define the header of the output file\n String fileHeader = \"There are \"\n + String.format(\"%s\", duplicates.size()) + \" duplicate(s) \"\n + \"in the input file. The duplicate(s) is(are) :\" + \"\\n\" + \"\\n\";\n\n String recordedDuplicatesStrings = \"\";\n\n // concatenate the recorded DXSingleSpeed in a string\n for (Iterator<String> it = duplicates.iterator(); it.hasNext();) {\n recordedDuplicatesStrings += it.next() + \"\\n\";\n }\n\n // print the header + DXSingleSpeed + footer in the output file\n OutputStreamWriter fw = new FileWriter(fileName);\n fw.write(fileHeader + recordedDuplicatesStrings);\n fw.close();\n }",
"private boolean isCheckSumEquals(MessageDigest md, String checkSumValue) {\n byte[] digest = md.digest();\r\n String checksum = Utility.byteArraytoHexString(digest);\r\n LOG.debug(\"Checksums: send[\" + checkSumValue + \"] file[\" + checksum + \"]\");\r\n \r\n return checksum.equals(checkSumValue);\r\n }",
"static void findDuplicate()\n\t{\n\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\toList = new ArrayList<String>();\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Dog\");\n\t\t\toList.add(\"Eagle\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\tSystem.out.println(oList);\n\t\t\t\n\t\t\toSet = new TreeSet<>();\n\t\t\t\n\t\t\tString s = \"\";\n\t\t\tfor(int i=0;i<oList.size();i++)\n\t\t\t{\n\t\t\t\tif((oSet.add(oList.get(i))==false) && (!s.contains(oList.get(i))))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Duplicate: \"+oList.get(i));\n\t\t\t\t\ts+=oList.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toList = null;\n\t\t\toSet = null;\n\t\t}\n\t}",
"public static String getFileMD5(File file) {\n\t\tMessageDigest messageDigest = null;\n\t\tFileInputStream fileInStream = null;\n\t\tbyte buffer[] = new byte[1024];\n\t\tint length = -1;\n\t\ttry {\n\t\t\tmessageDigest = MessageDigest.getInstance(\"MD5\");\n\t\t\tfileInStream = new FileInputStream(file);\n\t\t\twhile ((length = fileInStream.read(buffer, 0, 1024)) != -1) {\n\t\t\t\tmessageDigest.update(buffer, 0, length);\n\t\t\t}\n\t\t\tfileInStream.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\tBigInteger bigInt = new BigInteger(1, messageDigest.digest());\n\t\treturn bigInt.toString(16);\n\t}",
"private void compareFirstPass() {\n this.oldFileNoMatch = new HashMap<String, SubsetElement>();\r\n Iterator<String> iter = this.oldFile.keySet().iterator();\r\n while (iter.hasNext()) {\r\n final String key = iter.next();\r\n if (!this.newFile.containsKey(key)) {\r\n final String newKey = this.oldFile.get(key).getSubsetCode()\r\n + this.oldFile.get(key).getConceptCode();\r\n this.oldFileNoMatch.put(newKey, this.oldFile.get(key));\r\n }\r\n }\r\n\r\n // Now repeat going the other way, pulling all new file no matches into\r\n // newFileNoMatch\r\n this.newFileNoMatch = new HashMap<String, SubsetElement>();\r\n iter = this.newFile.keySet().iterator();\r\n while (iter.hasNext()) {\r\n final String key = iter.next();\r\n if (!this.oldFile.containsKey(key)) {\r\n final String newKey = this.newFile.get(key).getSubsetCode()\r\n + this.newFile.get(key).getConceptCode();\r\n this.newFileNoMatch.put(newKey, this.newFile.get(key));\r\n }\r\n }\r\n\r\n // dump the initial large HashMaps to reclaim some memory\r\n this.oldFile = null;\r\n this.newFile = null;\r\n }",
"@Override\n\tpublic int hashCode() {\n\t\treturn this.filePath.hashCode();\n\t}",
"public boolean copy(File fileToLoadOrig, boolean withDuplicate, List<String> passedFiles) {\n //Let us get the current Date\n Date date = new Date();\n LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();\n int year = localDate.getYear();\n int month = localDate.getMonthValue();\n int day = localDate.getDayOfMonth();\n\n String destDirectoryPath = year + \"-\" + month + \"-\" + day;\n\n //check if directory is created\n\n File destDirecoty = new File(\"./testing/dest/\" + destDirectoryPath);\n System.out.println(\"the file path:\" + destDirecoty.getAbsolutePath());\n\n if (!destDirecoty.exists()) {\n System.out.println(\"creating a new directory with path:\" + destDirecoty.getAbsolutePath());\n boolean created = destDirecoty.mkdirs();\n System.out.println(\"is file created:\" + created);\n }\n System.out.println(\"Directory is created\");\n //Great, now let us check if the file already in the dirctory\n\n\n boolean duplicateFound = false;\n\n\n File[] sourceFiles = fileToLoadOrig.listFiles();\n\n for (File sourceFile : sourceFiles) {\n //let us get the file extension\n String sourceFileType = \"\";\n int location = sourceFile.getName().lastIndexOf('.');\n if (location > 0) {\n sourceFileType = sourceFile.getName().substring(location + 1);\n }\n //cool, let us go on\n String nestedDirectory;\n switch (sourceFileType) {\n case \"txt\":\n nestedDirectory = \"txt\";\n break;\n case \"pdf\":\n nestedDirectory = \"pdf\";\n break;\n case \"xls\":\n nestedDirectory = \"xls\";\n default:\n nestedDirectory = \"others\";\n }\n\n //check if the type directory is created or not\n File nestedDirecotyFile = new File(destDirecoty.getAbsolutePath()+\"/\" + nestedDirectory);\n System.out.println(\"the file path:\" + nestedDirecotyFile.getAbsolutePath());\n\n if (!nestedDirecotyFile.exists()) {\n System.out.println(\"creating a new directory with path:\" + nestedDirecotyFile.getAbsolutePath());\n boolean created = nestedDirecotyFile.mkdirs();\n System.out.println(\"is file created:\" + created);\n }\n\n\n\n File[] destinationFiles = nestedDirecotyFile.listFiles();\n\n for (File destinationFile : destinationFiles) {\n if (destinationFile.getName().equals(sourceFile.getName())) {\n if (withDuplicate) {\n int maxSeqNum = 0;\n //Let us find the last sequence of the destinationFile\n for (File fileForDuplicate : destinationFiles) {\n String[] fileParts = fileForDuplicate.getName().split(\"_\");\n if (fileParts.length == 2) {\n //got a split\n if (fileParts[0].equals(destinationFile.getName())) {\n maxSeqNum = Math.max(maxSeqNum, Integer.parseInt(fileParts[1]));\n }\n }else{\n new RuntimeException(\"Files were found with multiple _\");\n }\n }\n String newFilePath = sourceFile.getName() + \"_\" + (maxSeqNum + 1);\n try {\n FileUtils.copyFile(sourceFile, new File(nestedDirecotyFile.getAbsoluteFile() + \"/\" + newFilePath));\n passedFiles.add(sourceFile.getAbsolutePath());\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n } else {\n // let us delete the destinationFile and replace it\n destinationFile.delete();\n try {\n FileUtils.copyFile(sourceFile, new File(nestedDirecotyFile.getAbsoluteFile() + \"/\" + sourceFile.getName()));\n passedFiles.add(sourceFile.getAbsolutePath());\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n }\n break;\n } else {\n try {\n FileUtils.copyFile(sourceFile, new File(nestedDirecotyFile.getAbsoluteFile() + \"/\" + sourceFile.getName()));\n passedFiles.add(sourceFile.getAbsolutePath());\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n }\n }\n\n try {\n FileUtils.copyFile(sourceFile, new File(nestedDirecotyFile.getAbsoluteFile() + \"/\" + sourceFile.getName()));\n passedFiles.add(sourceFile.getAbsolutePath());\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n\n }\n return true;\n }",
"private static void calculateSizes() {\n for(EmailTypes type : EmailTypes.values()){\n File f = unpackedFiles.get(type);\n setSizes.put(type, Objects.requireNonNull(f.listFiles()).length);\n }\n }",
"public static String fileMD5(File file) {\n\t\tFileInputStream fis = null;\n\t\tString md5 = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(file);\n\t\t\tmd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(fis);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"!!!\", e);\n\t\t} finally {\n\t\t\tCloseUtils.close(fis);\n\t\t}\n\t\treturn md5;\n\t}",
"public void dxDoubleSpeedsDuplicates(String fileName) throws IOException {\n // This method prints all the duplicated DXDoubleSpeeds in the output\n // file.\n\n // concatenate the recorded DXDoubleSpeeds in a string\n ArrayList<String> recordedDXDoubleSpeedsStrings = new ArrayList<String>();\n\n for (Iterator<DXDoubleSpeed> dxDoubleSpeedIterator = dxDoubleSpeeds.iterator(); dxDoubleSpeedIterator\n .hasNext();) {\n recordedDXDoubleSpeedsStrings.add(dxDoubleSpeedIterator.next()\n .toMoRecordString());\n }\n\n ArrayList<String> duplicates = new ArrayList<String>();\n duplicates = saveDuplicates(recordedDXDoubleSpeedsStrings);\n\n // define the header of the output file\n String fileHeader = \"There are \"\n + String.format(\"%s\", duplicates.size()) + \" duplicate(s) \"\n + \"in the input file. The duplicate(s) is(are) :\" + \"\\n\" + \"\\n\";\n\n String recordedDuplicatesStrings = \"\";\n\n // concatenate the recorded DXDoubleSpeed in a string\n for (Iterator<String> it = duplicates.iterator(); it.hasNext();) {\n recordedDuplicatesStrings += it.next() + \"\\n\";\n }\n\n // print the header + DXDoubleSpeed + footer in the output file\n OutputStreamWriter fw = new FileWriter(fileName);\n fw.write(fileHeader + recordedDuplicatesStrings);\n fw.close();\n }",
"public static boolean compareImages(String image1, String image2) {\n \t\tboolean equals = false;\n \t\ttry {\n \t\t\tExifInterface exif1 = new ExifInterface(image1);\n \t\t\tExifInterface exif2 = new ExifInterface(image2);\n \t\t\t\n \t\t\tfinal String datetime1 = exif1.getAttribute(ExifInterface.TAG_DATETIME);\n \t\t\tfinal String datetime2 = exif2.getAttribute(ExifInterface.TAG_DATETIME);\n \t\t\t\n \t\t\tif (!TextUtils.isEmpty(datetime1) && !TextUtils.isEmpty(datetime1)) {\n \t\t\t\tequals = datetime1.equals(datetime2);\n \t\t\t} else {\n \t\t\t\tLog.d(TAG, \"Datetime is null or empty. The MD5 checksum will be compared\");\n \t\t\t\tequals = compareFilesChecksum(image1, image2);\n \t\t\t}\n \t\t} catch (IOException e) {\n \t\t\tLog.e(TAG, e.getMessage());\n \t\t}\n \t\t\n \t\treturn equals;\n \t}",
"public static String getFileMD5(File file) {\n if (!file.isFile()) {\n return null;\n }\n MessageDigest digest = null;\n FileInputStream in = null;\n byte buffer[] = new byte[1024];\n int len;\n try {\n digest = MessageDigest.getInstance(\"MD5\");\n in = new FileInputStream(file);\n while ((len = in.read(buffer, 0, 1024)) != -1) {\n digest.update(buffer, 0, len);\n }\n in.close();\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n BigInteger bigInt = new BigInteger(1, digest.digest());\n String md5 = bigInt.toString(16);\n while (md5.length() < 32)\n md5 = \"0\" + md5;\n return md5;\n }",
"private static boolean equalityTest5(String a, String b)\n {\n return a.hashCode() == b.hashCode();\n }",
"public static String writeFileToCacheSecure(String fileName,Context context) {\n md5CheckResult = false;\n String path=null;\n for(int i=0;i<5;i++){\n Log.d(TAG,\"invoke writeFileToCache times:\"+i);\n path = writeFileToCache(fileName,context);\n if(md5CheckResult){\n Log.d(TAG,\"md5 check pass ,stop invoke writeFileToCache\");\n break;\n }\n }\n return path;\n }",
"public static String getMD5(File file) throws IOException, NoSuchAlgorithmException {\n return getChecksum(file, MessageDigest.getInstance(\"MD5\"));\n }",
"@Override\n public int hashCode() {\n return rank + file;\n }",
"private boolean isSizeConsistent() { return isSizeConsistent(root); }",
"@Override\r\n\tpublic int hashCode() {\r\n\t\tfinal int prime = 31;\r\n\t\tint result = 1;\r\n\t\tresult = prime * result + chunkNumber;\r\n\t\tresult = prime * result + ((fileID == null) ? 0 : fileID.hashCode());\r\n\t\treturn result;\r\n\t}",
"private static void compareSha(String filename) {\n\n\t\tMessageDigest md = null;\n\n\t\ttry (InputStream is = new BufferedInputStream(new FileInputStream(filename))) {\n\n\t\t\tbyte[] data = new byte[4096];\n\t\t\tint nRead;\n\t\t\tmd = MessageDigest.getInstance(\"SHA-256\");\n\n\t\t\twhile ((nRead = is.read(data)) != -1) {\n\t\t\t\tmd.update(data, 0, nRead);\n\t\t\t}\n\n\t\t} catch (FileNotFoundException exc) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"File does not exist, is a directory rather than a regular file, or cannot be opened for reading because of some other reason\");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IOException exc) {\n\t\t\tSystem.out.println(\"Input stream couldn't be initialized.\");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tSystem.out.println(\"No provider supports a MessageDigestSpi implementation for the specified algorithm.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tString sha256Digest = Util.bytetohex(md.digest());\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Please provide expected sha-256 digest for hw06part2.pdf: \");\n\t\tSystem.out.print(\">\");\n\t\tString expectedDigest = sc.nextLine();\n\t\tsc.close();\n\n\t\tif (sha256Digest.equals(expectedDigest)) {\n\t\t\tSystem.out.printf(\"Digesting completed. Digest of %s matches expected digest.\\n\", filename);\n\n\t\t} else {\n\t\t\tSystem.out.printf(\"Digesting completed. Digest of %s does not match the expected digest. Digest was: %s\\n\",\n\t\t\t\t\tfilename, sha256Digest);\n\t\t}\n\n\t}",
"protected abstract boolean copyCheckedFiles();",
"private boolean identicalAtoms(IAtomContainer molecule1, List<IAtomContainer> fragsToCompare) {\n\t\n \tfor (int i = 0; i < fragsToCompare.size(); i++) {\n \t\t//no match\n \t\tif (molecule1.getBondCount() != fragsToCompare.get(i).getBondCount() && molecule1.getAtomCount() != fragsToCompare.get(i).getAtomCount()) \n \t\t{\n \t\t\tcontinue;\n \t\t}\n \t\t\n\n \t\tint n = 0;\n \t\t//array storing all already tried atoms\n \t\tboolean[] doneAtoms = new boolean[atomsContained + 1];\n \t\tfor (int j = 0; j < molecule1.getAtomCount(); j++) {\n \t\t\tfor (int k = 0; k < fragsToCompare.get(i).getAtomCount(); k++) \n \t\t\t{\n \t\t\t\t//compare atoms by symbol, thus only check for the same sum formula --> EXPERIMENTAL\n \t\t\t\tif(molecularFormulaRedundancyCheck)\n \t\t\t\t{\n \t\t\t\t\tif (molecule1.getAtom(j).getSymbol().equals(fragsToCompare.get(i).getAtom(k).getSymbol()) &&\n \t\t\t\t\t\t\t!doneAtoms[Integer.parseInt(fragsToCompare.get(i).getAtom(k).getID())]) {\n \t\t\t\t\tn++;\n \t\t\t\t\tdoneAtoms[Integer.parseInt(fragsToCompare.get(i).getAtom(k).getID())] = true;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t} \t\t\t\t\n \t\t\t\t//normal test creates way more fragments!\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tif (molecule1.getAtom(j).equals(fragsToCompare.get(i).getAtom(k))) {\n \t\t\t\t\tn++;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif(n == molecule1.getAtomCount())\n \t\t\treturn true;\n\t\t}\n\t //no match found\n\t\treturn false;\n\t}",
"public void assimilateChecksum(Container container) {\n if (container.hasCheckSum()) {\n // PM-1617 add all metadata from the entry into FileTransfer\n Metadata m = (Metadata) container.getAllProfiles().get(Profiles.NAMESPACES.metadata);\n this.getAllMetadata().merge(m);\n }\n }",
"public boolean equals(java.lang.Object r5) {\n /*\n r4 = this;\n r0 = 1\n if (r5 != r4) goto L_0x0004\n return r0\n L_0x0004:\n r1 = 0\n if (r5 != 0) goto L_0x0008\n return r1\n L_0x0008:\n java.lang.Class r2 = r5.getClass()\n java.lang.Class r3 = r4.getClass()\n boolean r2 = r2.equals(r3)\n if (r2 == 0) goto L_0x003f\n com.dropbox.core.v2.sharing.ChangeFileMemberAccessArgs r5 = (com.dropbox.core.p005v2.sharing.ChangeFileMemberAccessArgs) r5\n java.lang.String r2 = r4.file\n java.lang.String r3 = r5.file\n if (r2 == r3) goto L_0x0024\n boolean r2 = r2.equals(r3)\n if (r2 == 0) goto L_0x003d\n L_0x0024:\n com.dropbox.core.v2.sharing.MemberSelector r2 = r4.member\n com.dropbox.core.v2.sharing.MemberSelector r3 = r5.member\n if (r2 == r3) goto L_0x0030\n boolean r2 = r2.equals(r3)\n if (r2 == 0) goto L_0x003d\n L_0x0030:\n com.dropbox.core.v2.sharing.AccessLevel r2 = r4.accessLevel\n com.dropbox.core.v2.sharing.AccessLevel r5 = r5.accessLevel\n if (r2 == r5) goto L_0x003e\n boolean r5 = r2.equals(r5)\n if (r5 == 0) goto L_0x003d\n goto L_0x003e\n L_0x003d:\n r0 = 0\n L_0x003e:\n return r0\n L_0x003f:\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.dropbox.core.p005v2.sharing.ChangeFileMemberAccessArgs.equals(java.lang.Object):boolean\");\n }",
"public static void main(String[] args) throws NoSuchAlgorithmException, FileNotFoundException, IOException {\n \r\n String hash = \"F5D080D4F4E185DECA8A8B24F72408D9\";\r\n String [] keys = {\"9A1BA7F38A3E8D8F9DDD55972868CB3F\",\"17185CEF199E1C89804EDEE9DCDD1B90\",\"F5D080D4F4E185DECA8A8B24F72408D9\"};\r\n String password = \"NoSuchPassword\";\r\n File file = null;\r\n JFileChooser ff = new JFileChooser();\r\n int a = ff.showOpenDialog(null);\r\n if(a == JFileChooser.APPROVE_OPTION){\r\n try {\r\n file = ff.getSelectedFile();\r\n JOptionPane.showMessageDialog(ff, a);\r\n \r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n } finally {\r\n System.out.println(file.getPath());\r\n }\r\n } \r\n BufferedReader fr = null;\r\n fr = new BufferedReader(new FileReader(file.getPath()));\r\n String line = null;\r\n int i = 0; \r\n //This is the funtion that Java implement in java.security.MessageDigest\r\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\r\n while((line = fr.readLine()) != null){\r\n System.out.println(line);\r\n md5.update(line.getBytes());\r\n byte [] digests = md5.digest();\r\n String hashs = DatatypeConverter.printHexBinary(digests).toUpperCase();\r\n if(keys[i].equals(hashs)){\r\n System.out.println(\"CORRECT!\\nThe hash created is the same as the hash saved \");\r\n }\r\n else{\r\n System.out.println(\"ERROR!\\nThere was a mistake, the hash create doesn't mach the hash saved\");\r\n }\r\n i++;\r\n } \r\n fr.close();\r\n /**In conclusion we can use the MD5 for digest a words and then same them\r\n * is a DataBase, this with the function that if the DB is committed the\r\n * passwords will not be there\r\n */\r\n }",
"private void verifyDigestFile( File artifactSource, File artifactTarget, RewriteTransaction transaction,\n Reporter reporter, boolean reportOnly, String digestExt, String digestAlgorithm )\n throws DigestException, ReportWriteException, IOException\n {\n File digestSourceFile = null;\n\n if ( artifactSource != null )\n {\n digestSourceFile = new File( artifactSource + digestExt );\n }\n\n // create the digest target file from which to copy/create.\n File digestTargetFile = null;\n\n if ( artifactTarget != null )\n {\n digestTargetFile = new File( artifactTarget + digestExt );\n\n transaction.addFile( digestTargetFile );\n }\n\n boolean verified = false;\n\n // if the digest source file exists, then verify it.\n if ( digestSourceFile != null && digestSourceFile.exists() )\n {\n verified = artifactDigestor.verifyArtifactDigest( artifactTarget, digestTargetFile, digestAlgorithm );\n\n if ( verified )\n {\n if ( !reportOnly )\n {\n try\n {\n if ( digestTargetFile == null )\n {\n reporter.error( \"No target digest file for path [\" + artifactSource +\n \"] from source to target for digest algorithm: \\'\" + digestAlgorithm + \"\\'.\" );\n }\n else if ( !digestSourceFile.getCanonicalFile().equals( digestTargetFile.getCanonicalFile() ) )\n {\n FileUtils.copyFile( digestSourceFile, digestTargetFile );\n }\n }\n catch ( IOException e )\n {\n reporter.error( \"Cannot copy digest file for path [\" + artifactSource +\n \"] from source to target for digest algorithm: \\'\" + digestAlgorithm + \"\\'.\", e );\n\n throw e;\n }\n }\n }\n else\n {\n reporter.warn( digestExt + \" for path [\" + artifactSource + \"] in target repository is wrong.\" );\n }\n }\n else\n {\n reporter.warn( digestExt + \" for path [\" + artifactSource + \"] is missing in source repository.\" );\n }\n\n // if the .md5 was missing or did not verify correctly, create a new one\n // in the target repo.\n if ( !verified )\n {\n if ( !reportOnly )\n {\n artifactDigestor.createArtifactDigest( artifactTarget, digestTargetFile, digestAlgorithm );\n }\n }\n }",
"@Override\n public int hashCode() {\n int hash = 5;\n hash = 41 * hash + this.emailID;\n hash = 41 * hash + this.folderKey;\n hash = 41 * hash + Objects.hashCode(this.receivedDate);\n hash = 41 * hash + Objects.hashCode(this.email.from());\n hash = 41 * hash + Objects.hashCode(this.email.to());\n hash = 41 * hash + Objects.hashCode(this.email.cc());\n hash = 41 * hash + Objects.hashCode(this.email.bcc());\n hash = 41 * hash + Objects.hashCode(this.email.subject());\n hash = 41 * hash + Objects.hashCode(this.email.messages());\n hash = 41 * hash + Objects.hashCode(this.email.attachments());\n return hash;\n }",
"public static void m6739b(File file) {\n if (file.listFiles() != null && file.listFiles().length > 1) {\n long c = m6740c(file, false);\n for (File file2 : file.listFiles()) {\n if (!file2.getName().equals(String.valueOf(c)) && !file2.getName().equals(\"stale.tmp\")) {\n m6741h(file2);\n }\n }\n }\n }",
"public static byte[] computeMD5Hash(InputStream is) throws NoSuchAlgorithmException, IOException {\n BufferedInputStream bis = new BufferedInputStream(is);\n try {\n MessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\n byte[] buffer = new byte[16384];\n int bytesRead = -1;\n while ((bytesRead = bis.read(buffer, 0, buffer.length)) != -1) {\n messageDigest.update(buffer, 0, bytesRead);\n }\n return messageDigest.digest();\n } finally {\n try {\n bis.close();\n } catch (Exception e) {\n System.err.println(\"Unable to close input stream of hash candidate: \" + e);\n }\n }\n }",
"public static String fileMD5(String filePath) {\n\t\tFileInputStream fis = null;\n\t\tString md5 = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(new File(filePath));\n\t\t\tmd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(fis);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"!!!\", e);\n\t\t} finally {\n\t\t\tCloseUtils.close(fis);\n\t\t}\n\t\treturn md5;\n\t}",
"@Override\n\tpublic boolean compareFiles(int f1, int f2) {\n\t\treturn false;\n\t}",
"public static void md5(File outputFile) throws ConverterException {\r\n\t\ttry {\r\n\t\t\tFileInputStream fileInputStream = new FileInputStream(outputFile);\r\n\t\t\tBufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\r\n\t\t\t\r\n\t\t\tbyte[] datei = bufferedInputStream.readAllBytes();\r\n\t\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\r\n\t\t\tbyte[] md5 = md.digest(datei);\r\n\t\t\tfor (int i = 0; i < md5.length; i++) {\r\n\t\t\t\tSystem.out.print(String.format(\"%02X\", md5[i]));\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\" File Length: \" + outputFile.length());\r\n\t\t\tSystem.out.println();\r\n\t\t\t\r\n\t\t\tbufferedInputStream.close();\r\n\t\t\tfileInputStream.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tthrow new ConverterException(\"Datei kann nicht gefunden werden\");\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new ConverterException(\"Beim Lesen der Datei ist ein Fehler aufgetreten\");\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public static byte[] computeMD5Hash(byte[] data) throws NoSuchAlgorithmException, IOException {\n return computeMD5Hash(new ByteArrayInputStream(data));\n }",
"public boolean equals(java.lang.Object r5) {\n /*\n r4 = this;\n r0 = 1\n if (r5 != r4) goto L_0x0004\n return r0\n L_0x0004:\n r1 = 0\n if (r5 != 0) goto L_0x0008\n return r1\n L_0x0008:\n java.lang.Class r2 = r5.getClass()\n java.lang.Class r3 = r4.getClass()\n boolean r2 = r2.equals(r3)\n if (r2 == 0) goto L_0x003b\n com.dropbox.core.v2.sharing.FilePermission r5 = (com.dropbox.core.p005v2.sharing.FilePermission) r5\n com.dropbox.core.v2.sharing.FileAction r2 = r4.action\n com.dropbox.core.v2.sharing.FileAction r3 = r5.action\n if (r2 == r3) goto L_0x0024\n boolean r2 = r2.equals(r3)\n if (r2 == 0) goto L_0x0039\n L_0x0024:\n boolean r2 = r4.allow\n boolean r3 = r5.allow\n if (r2 != r3) goto L_0x0039\n com.dropbox.core.v2.sharing.PermissionDeniedReason r2 = r4.reason\n com.dropbox.core.v2.sharing.PermissionDeniedReason r5 = r5.reason\n if (r2 == r5) goto L_0x003a\n if (r2 == 0) goto L_0x0039\n boolean r5 = r2.equals(r5)\n if (r5 == 0) goto L_0x0039\n goto L_0x003a\n L_0x0039:\n r0 = 0\n L_0x003a:\n return r0\n L_0x003b:\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.dropbox.core.p005v2.sharing.FilePermission.equals(java.lang.Object):boolean\");\n }",
"public List<FileDuplicate> getDuplicates() {\n List<FileDuplicate> result = new ArrayList<FileDuplicate>();\n int i = 0;\n FileDuplicate duplicates = new FileDuplicate();\n while (i < files.length) {\n if (duplicates.isEmpty() || duplicates.get(0).equals(files[i])) {\n duplicates.add(files[i]);\n i++;\n } else {\n if (duplicates.size() > 1) {\n result.add(duplicates);\n }\n duplicates = new FileDuplicate();\n }\n }\n return result;\n }",
"private boolean isSizeConsistent() {\n return isSizeConsistent(root);\n }",
"private void clearDuplicates(){\n\t\tLinkedHashSet<String> duplicateFree;\n\t\tList<String> RawStrings=new ArrayList<String>();\n\t\tfor (String[] rCode:mutatedCodes){\n\t\t\tRawStrings.add(rCode[0]+\"~\"+rCode[1]+\"~\"+rCode[2]+\"~\"+rCode[3]+\"~\"+rCode[4]+\"~\"+rCode[5]+\"~\"+rCode[6]+\"~\"+rCode[7]+\"~\"+rCode[8]+\"~\"+rCode[9]+\"~\"+rCode[10]+\"~\"+rCode[11]+\"~\"+rCode[12]+\"~\"+rCode[13]+\"~\"+rCode[14]+\"~\"+rCode[15]+\"~\"+rCode[16]+\"~\"+rCode[17]+\"~\"+rCode[18]+\"~\"+rCode[19]);\n\t\t}\n\t\tduplicateFree=new LinkedHashSet<String>(RawStrings);\n\t\tSystem.out.println(\"Number of Duplicates cleared:\"+(RawStrings.size()-duplicateFree.size()));\n\t\tSystem.out.println(\"Remaining Codes for next Run:\"+duplicateFree.size());\n\t\tCodeCount=0;\n\t\ttry {\n\t\t\tcodes=new FileWriter(\"data/codes.txt\");\n\t\t\tfor (String S:duplicateFree){\n\t\t\t\twriteCodeLine(S);\n\t\t\t}\n\t\t\tcodes.close();\n\t\t\tThread.sleep(1000L);\n\t\t} catch (IOException | InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"List<MD5ExistenceCheckDTO> checkForExistence(String[] md5Codes) ;",
"protected boolean sameFile(URL paramURL1, URL paramURL2) {\n/* 400 */ if (paramURL1.getProtocol() != paramURL2.getProtocol() && (paramURL1\n/* 401 */ .getProtocol() == null || \n/* 402 */ !paramURL1.getProtocol().equalsIgnoreCase(paramURL2.getProtocol()))) {\n/* 403 */ return false;\n/* */ }\n/* */ \n/* 406 */ if (paramURL1.getFile() != paramURL2.getFile() && (paramURL1\n/* 407 */ .getFile() == null || !paramURL1.getFile().equals(paramURL2.getFile()))) {\n/* 408 */ return false;\n/* */ }\n/* */ \n/* */ \n/* 412 */ int i = (paramURL1.getPort() != -1) ? paramURL1.getPort() : paramURL1.handler.getDefaultPort();\n/* 413 */ int j = (paramURL2.getPort() != -1) ? paramURL2.getPort() : paramURL2.handler.getDefaultPort();\n/* 414 */ if (i != j) {\n/* 415 */ return false;\n/* */ }\n/* */ \n/* 418 */ if (!hostsEqual(paramURL1, paramURL2)) {\n/* 419 */ return false;\n/* */ }\n/* 421 */ return true;\n/* */ }",
"public boolean equals(Object obj) {\n\t\tif(!(obj instanceof MD5Hash)) return false;\n\t\treturn obj.hashCode() == hashCode();\n\t}",
"private String calculateCheckSum(File file2) {\n\t\tStringBuffer sb = new StringBuffer(\"\");\n\t\ttry {\n\t\t\tMessageDigest messageDigest = MessageDigest.getInstance(\"SHA1\");\n\n\t\t\tFileInputStream finput = new FileInputStream(file2);\n\t\t\tbyte[] dataBytes = new byte[1024];\n\n\t\t\tint bytesRead = 0;\n\n\t\t\twhile ((bytesRead = finput.read(dataBytes)) != -1) {\n\t\t\t\tmessageDigest.update(dataBytes, 0, bytesRead);\n\t\t\t}\n\n\t\t\tbyte[] digestBytes = messageDigest.digest();\n\n\t\t\tfor (int i = 0; i < digestBytes.length; i++) {\n\t\t\t\tsb.append(Integer.toString((digestBytes[i] & 0xff) + 0x100, 16).substring(1));\n\t\t\t}\n\t\t\tSystem.out.println(\"file check sum value is \" + sb.toString());\n\t\t\tfinput.close();\n\t\t} catch (Exception ex) {\n\t\t\t// TODO: handle exception\n\t\t\tLogger.getLogger(FileTransferClient.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\n\t\treturn sb.toString();\n\t}",
"private static String md5(byte[] b) {\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.reset();\n md.update(b);\n byte[] digest = md.digest();\n StringBuffer sb = new StringBuffer();\n for (int i=0; i<digest.length; i++) {\n String a = Integer.toHexString(0xff & digest[i]);\n if (a.length() == 1) a = \"0\" + a;\n sb.append(a);\n }\n return sb.toString();\n }\n catch (NoSuchAlgorithmException e) { writeLog(e); }\n return null;\n }",
"public static String getFileMD5(String path) {\n\t\treturn getFileMD5(new File(path));\n\t}",
"protected void removeDuplicates() {\n log.trace(\"Removing duplicated\");\n long startTime = System.currentTimeMillis();\n int initial = size();\n E last = null;\n int index = 0;\n while (index < size()) {\n E current = get(index);\n if (last != null && last.equals(current)) {\n if (log.isTraceEnabled()) {\n log.trace(\"Removing duplicate '\" + current + \"'\");\n }\n remove(index);\n } else {\n index++;\n }\n last = current;\n }\n log.debug(String.format(\"Removed %d duplicates from a total of %d values in %dms\",\n initial - size(), initial, System.currentTimeMillis() - startTime));\n }",
"protected boolean isDuplicate(ELesxUseCase useCase) {\n return false;\n }",
"private void checkForOrphanFiles() {\n List<String> dbFileNames = getPhotoFilesInDatabase();\n List<String> dirFileNames = getPhotoFilesInDirectory();\n\n // Find files that are not in the db.\n dirFileNames.removeAll(dbFileNames);\n\n // Create a new photo shoot for the orphaned photos.\n if (dirFileNames.size() > 0) {\n long shootId = createOrphanShoot(dirFileNames);\n\n GhostPhotoPreferences.setHasOrphanPhotoShootBeenCreated(getApplicationContext(), true);\n Log.d(LOG_TAG, \"checkForOrphanFiles: Created orphan photo shoot: \" + shootId);\n }\n }",
"private int m5345e() {\n if (Process.myUid() == 1000) {\n return 0;\n }\n boolean equals;\n try {\n equals = \"mounted\".equals(Environment.getExternalStorageState());\n } catch (Exception e) {\n equals = false;\n }\n if (C1222aj.m5343c() && !equals) {\n return 0;\n }\n File file = new File(C1222aj.m5334a(this.f4232a).getPath() + File.separator + \"carrierdata\");\n if (!file.exists() || !file.isDirectory()) {\n return 0;\n }\n File[] listFiles = file.listFiles();\n if (listFiles == null || listFiles.length <= 0) {\n return 0;\n }\n ArrayList a = C1222aj.m5336a(listFiles);\n return a.size() == 1 ? ((File) a.get(0)).length() <= 0 ? 10 : 1 : a.size() >= 2 ? 2 : 0;\n }",
"void scanunique() {\n\t\tint oldline, newline;\n\t\tnode psymbol;\n\n\t\tfor (newline = 1; newline <= newinfo.maxLine; newline++) {\n\t\t\tpsymbol = newinfo.symbol[newline];\n\t\t\tif (psymbol.symbolIsUnique()) { // 1 use in each file\n\t\t\t\toldline = psymbol.linenum;\n\t\t\t\tnewinfo.other[newline] = oldline; // record 1-1 map\n\t\t\t\toldinfo.other[oldline] = newline;\n\t\t\t}\n\t\t}\n\t\tnewinfo.other[0] = 0;\n\t\toldinfo.other[0] = 0;\n\t\tnewinfo.other[newinfo.maxLine + 1] = oldinfo.maxLine + 1;\n\t\toldinfo.other[oldinfo.maxLine + 1] = newinfo.maxLine + 1;\n\t}",
"public static void compareSizeBetween2Files(File f1, File f2)\n {\n\t if(f1.canRead() && f2.canRead())\n\t {\n\t\t if(f1.length() < f2.length())\n\t\t {\n\t\t\t System.out.println(f2.getName()+\" is bigger than \" +f1.getName());\n\t\t }\n\t\t else if(f1.length() > f2.length())\n\t\t {\n\t\t\t System.out.println(f1.getName()+\" is bigger than \" +f2.getName());\n\t\t }\n\t\t else\n\t\t {\n\t\t\t System.out.println(f1.getName()+\" and \" +f2.getName()+\" have the same size\");\n\t\t }\n\t }\n\t else\n\t {\n\t\t System.out.println(\"At least one of the file has not read permissions\");\n\t }\n }",
"private void rehash() {\n\t\tint oldSize = this.size;\n\t\tint newSize = size * 2;\n\t\twhile (!isPrime(newSize))\n\t\t\tnewSize++;\n\t\tthis.size = newSize;\n\t\tDataItem[] newHashArray = new DataItem[newSize];\n\t\tString temp;\n\t\tthis.collision = 0;\n\t\tBoolean repeatValue;\n\t\tfor (int i = 0; i < oldSize; i++) {\n\t\t\tif (hashArray[i] != null && hashArray[i] != deleted)\n\t\t\t\ttemp = hashArray[i].value;\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t\trepeatValue = false;\n\t\t\tint hashVal = hashFunc(temp);\n\t\t\tboolean collisionFlag = false;\n\t\t\twhile (newHashArray[hashVal] != null\n\t\t\t\t\t&& !newHashArray[hashVal].value.equals(deleted.value)) {\n\n\t\t\t\tif (!collisionFlag) {\n\n\t\t\t\t\tthis.collision++;\n\t\t\t\t\tcollisionFlag = true;\n\n\t\t\t\t}\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\n\t\t\t}\n\t\t\tif (repeatValue)\n\t\t\t\tcontinue;\n\t\t\telse {\n\t\t\t\tnewHashArray[hashVal] = hashArray[i];\n\t\t\t}\n\t\t}\n\n\t\tthis.hashArray = newHashArray;\n\t}",
"private void CompareTwoFiles() {\n GetCharactersFromProject prog1Char;\r\n KGram prog1KGram;\r\n HashKGram prog1HashKGram;\r\n FingerPrint prog1FingerPrint;\r\n ArrayList<Integer> fingerprintProg1 = null;\r\n\r\n GetCharactersFromProject prog2Char;\r\n KGram prog2KGram;\r\n HashKGram prog2HashKGram;\r\n FingerPrint prog2FingerPrint;\r\n ArrayList<Integer> fingerprintProg2 = null;\r\n\r\n //for the first file\r\n try {\r\n prog1Char = new GetCharactersFromProject(filepath1);\r\n prog1KGram = new KGram(prog1Char.getCharacters());\r\n prog1HashKGram = new HashKGram(prog1KGram.ReturnProcessedKGram());\r\n prog1FingerPrint = new FingerPrint(prog1HashKGram.ReturnProcessedHashes());\r\n fingerprintProg1 = prog1FingerPrint.ReturnFingerPrint();\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n //this is for the second file\r\n try {\r\n prog2Char = new GetCharactersFromProject(filepath2);\r\n prog2KGram = new KGram(prog2Char.getCharacters());\r\n prog2HashKGram = new HashKGram(prog2KGram.ReturnProcessedKGram());\r\n prog2FingerPrint = new FingerPrint(prog2HashKGram.ReturnProcessedHashes());\r\n fingerprintProg2 = prog2FingerPrint.ReturnFingerPrint();\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n //this is for jaccard index. Jaccard index will be the basis of similarity\r\n float numSimilarity = 0;\r\n boolean isSimilarEncounter = false;\r\n int sizeFingerprint1 = fingerprintProg1.size();\r\n int sizeFingerprint2 = fingerprintProg2.size();\r\n\r\n for (Integer integer : fingerprintProg1) {\r\n\r\n for (Integer value : fingerprintProg2) {\r\n\r\n\r\n if ((integer.intValue() == value.intValue()) && !isSimilarEncounter) {\r\n numSimilarity++;\r\n isSimilarEncounter = true;\r\n }\r\n\r\n }\r\n\r\n\r\n isSimilarEncounter = false;\r\n }\r\n\r\n SimilarityScore = (numSimilarity / (sizeFingerprint1 + sizeFingerprint2 - numSimilarity));\r\n }",
"@Test\n public void testDuplicate() throws Exception {\n\n UploadRequest uploadRequest = createRequest();\n\n // create upload - We still care about study ID and requestedOn for reporting, as well as dupe attributes.\n DynamoUpload2 upload = (DynamoUpload2) dao.createUpload(uploadRequest, TEST_STUDY, TEST_HEALTH_CODE,\n ORIGINAL_UPLOAD_ID);\n uploadIds.add(upload.getUploadId());\n assertEquals(ORIGINAL_UPLOAD_ID, upload.getDuplicateUploadId());\n assertEquals(UploadStatus.DUPLICATE, upload.getStatus());\n assertEquals(TEST_STUDY_IDENTIFIER, upload.getStudyId());\n assertEquals(MOCK_NOW.getMillis(), upload.getRequestedOn());\n\n // We don't call Upload Complete in this scenario.\n }",
"@Override\n public int hashCode() {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"6ebbad60-c086-483f-99f5-ae1b69cbca99\");\n return getName().hashCode();\n }",
"private void checkFileNames(DSpaceRunnable dSpaceRunnable, List<MultipartFile> files) {\n List<String> fileNames = new LinkedList<>();\n for (MultipartFile file : files) {\n String fileName = file.getOriginalFilename();\n if (fileNames.contains(fileName)) {\n throw new UnprocessableEntityException(\"There are two files with the same name: \" + fileName);\n } else {\n fileNames.add(fileName);\n }\n }\n\n List<String> fileNamesFromOptions = dSpaceRunnable.getFileNamesFromInputStreamOptions();\n if (!fileNames.containsAll(fileNamesFromOptions)) {\n throw new UnprocessableEntityException(\"Files given in properties aren't all present in the request\");\n }\n }",
"private void validateDuplicateDocuments(Noc noc) {\n\t\tif (!ObjectUtils.isEmpty(noc.getDocuments())) {\n\t\t\tList<String> documentFileStoreIds = new LinkedList<String>();\n\t\t\tnoc.getDocuments().forEach(document -> {\n\t\t\t\tif (documentFileStoreIds.contains(document.getFileStoreId()))\n\t\t\t\t\tthrow new CustomException(\"NOC_DUPLICATE_DOCUMENT\", \"Same document cannot be used multiple times\");\n\t\t\t\telse\n\t\t\t\t\tdocumentFileStoreIds.add(document.getFileStoreId());\n\t\t\t});\n\t\t}\n\t}",
"public static String createMd5(String value)\r\n\t{ \r\n\t\ttry \r\n\t\t{\r\n\t\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\t\t\t\r\n\t\t\tbyte[] hashInBytes = md.digest(value.getBytes(StandardCharsets.UTF_8));\r\n\t\t\tStringBuilder sb = new StringBuilder();\r\n\t for (byte b : hashInBytes) \r\n\t {\r\n\t sb.append(String.format(\"%02x\", b));\r\n\t }\r\n\t return sb.toString();\r\n\t\t}\r\n\t\tcatch(Exception ex)\r\n\t\t{\r\n\t\t\t\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}",
"@Override\n\tpublic ResultTO getFileInfoFromMd5(String md5String) {\n\t\tResultTO result = this.getAllFiles();\n\t\tif (result.isError()) {\n\t\t\tresult.setMessage(\"Some error occurred in getting the file for the given MD5\");\n\t\t\tresult.setFiles(new ArrayList<InfoFileTO>());\n\t\t\treturn result;\n\t\t}\n\t\tList<InfoFileTO> infoFileList = result.getFiles();\n\t\t// If it is void (when some error occurred) it is not executed\n\t\tfor (InfoFileTO infoFileTO : infoFileList) {\n\t\t\tif (infoFileTO.getHashMd5().equals(md5String)) {\n\t\t\t\tresult.setMessage(\"Monitor Operation successfully completed\");\n\t\t\t\tresult.setFiles(Arrays.asList(infoFileTO));\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tresult.setMessage(\"No file has been found with the given Hash MD5!\");\n\t\t\t\tresult.setFiles(new ArrayList<InfoFileTO>());\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"private static INodeFile[] verifySrcFiles(FSDirectory fsd, String[] srcs,\n INodesInPath targetIIP, FSPermissionChecker pc) throws IOException {\n Set<INodeFile> si = new LinkedHashSet<>();\n final INodeFile targetINode = targetIIP.getLastINode().asFile();\n final INodeDirectory targetParent = targetINode.getParent();\n // now check the srcs\n for (String src : srcs) {\n final INodesInPath iip = fsd.getINodesInPath4Write(src);\n // permission check for srcs\n if (pc != null) {\n fsd.checkPathAccess(pc, iip, FsAction.READ); // read the file\n fsd.checkParentAccess(pc, iip, FsAction.WRITE); // for delete\n }\n\n final INode srcINode = iip.getLastINode();\n final INodeFile srcINodeFile = INodeFile.valueOf(srcINode, src);\n // make sure the src file and the target file are in the same dir\n if (srcINodeFile.getParent() != targetParent) {\n throw new HadoopIllegalArgumentException(\"Source file \" + src\n + \" is not in the same directory with the target \"\n + targetIIP.getPath());\n }\n // source file cannot be the same with the target file\n if (srcINode == targetINode) {\n throw new HadoopIllegalArgumentException(\"concat: the src file \" + src\n + \" is the same with the target file \" + targetIIP.getPath());\n }\n\n if(srcINodeFile.getStoragePolicyID() == HdfsConstants.DB_STORAGE_POLICY_ID) {\n throw new HadoopIllegalArgumentException(\"concat: source file \" + src\n + \" is stored in DB.\");\n }\n\n // source file cannot be under construction or empty\n if(srcINodeFile.isUnderConstruction() || srcINodeFile.numBlocks() == 0) {\n throw new HadoopIllegalArgumentException(\"concat: source file \" + src\n + \" is invalid or empty or underConstruction\");\n }\n // source file's preferred block size cannot be greater than the target\n // file\n if (srcINodeFile.getPreferredBlockSize() >\n targetINode.getPreferredBlockSize()) {\n throw new HadoopIllegalArgumentException(\"concat: source file \" + src\n + \" has preferred block size \" + srcINodeFile.getPreferredBlockSize()\n + \" which is greater than the target file's preferred block size \"\n + targetINode.getPreferredBlockSize());\n }\n si.add(srcINodeFile);\n }\n \n // make sure no two files are the same\n if (si.size() < srcs.length) {\n // it means at least two files are the same\n throw new HadoopIllegalArgumentException(\n \"concat: at least two of the source files are the same\");\n }\n return si.toArray(new INodeFile[si.size()]);\n }",
"@Test //same file\n\t\t\tpublic void SameFileDifferentInstances() throws PizzaException, LogHandlerException{\n\t\t\t\tArrayList<Pizza> pizzaArr1;\n\t\t\t\tArrayList<Pizza> pizzaArr2;\n\n\t\t\t\tPath currentRelativePath = Paths.get(\"\");\n\t\t\t\tString s = currentRelativePath.toAbsolutePath().toString();\n\t\t\t\tString path = s + \"\\\\logs\\\\20170101.txt\";\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tpizzaArr2 = LogHandler.populatePizzaDataset(path);\n\t\t\t\tpizzaArr1 = LogHandler.populatePizzaDataset(path);\n\t\t\t\tassertNotEquals(pizzaArr2.hashCode(), pizzaArr1.hashCode());\n\t\t\t}",
"public void assimilateChecksum(TransformationCatalogEntry entry) {\n if (entry.hasCheckSum()) {\n // PM-1617 add all metadata from the entry into FileTransfer\n Metadata m = (Metadata) entry.getAllProfiles().get(Profiles.NAMESPACES.metadata);\n this.getAllMetadata().merge(m);\n }\n }",
"public static ArrayList<String> Externalexp1Sort(ArrayList<String> source)\n throws Exception {\n // file\n // ArrayList<Long> k = new ArrayList<Long>();\n // k.add(0L);\n // k.add(0L);\n // k.add(0L);\n // Long repeat = 0L;\n\n PriorityQueue<KVPair> heap = new PriorityQueue<KVPair>(20,\n new UserPrio());\n ArrayList<CsvReader> readers = new ArrayList<CsvReader>();\n // user_tweets output\n PrintWriter writer = new PrintWriter(new FileWriter(user_tweets));\n\n writer2 = new CsvWriter(new OutputStreamWriter(new FileOutputStream(\n SORT_USER_FN + fileNum + \".csv\"), \"UTF-8\"), ',');\n\n // open files\n for (String fileName : source) {\n // get read csv files\n CsvReader reader = new CsvReader(new InputStreamReader(\n new FileInputStream(fileName), \"UTF-8\"));\n reader.setHeaders(Merge.fields);\n // read a line and put into heap\n if (reader.readRecord()) {\n heap.offer(new KVPair(Merge.readRecord(reader), readers.size()));\n }\n readers.add(reader);\n }\n\n // get same key\n KVPair last = null;\n HashMap<Long, Record> sameRecord = new HashMap<Long, Record>();\n\n while (heap.size() > 0) {\n KVPair tmp = heap.poll();\n\n if (last != null && last.record.userid != tmp.record.userid) {\n writer.println(last.record.userid + \",\" + sameRecord.size());\n\n // print records to file\n writeRecords(sameRecord.values());\n\n sameRecord = new HashMap<Long, Record>();\n\n }\n\n // if (sameRecord.containsKey(tmp.record.tweetid)) {\n // repeat ++;\n // System.out.println(tmp.record.tweetid +\" : \" + repeat);\n // }\n\n sameRecord.put(tmp.record.tweetid, tmp.record);\n\n // read next record in the same file\n if (readers.get(tmp.file).readRecord()) {\n\n // k.set(tmp.file, k.get(tmp.file)+1);\n // System.out.println(k);\n\n heap.offer(new KVPair(Merge.readRecord(readers.get(tmp.file)),\n tmp.file));\n } else {\n readers.get(tmp.file).close();\n }\n last = tmp;\n }\n\n // last part of external sort\n if (sameRecord.size() != 0) {\n writer.println(last.record.userid + \",\" + sameRecord.size());\n\n // print records to file\n writeRecords(sameRecord.values());\n }\n\n writer.close();\n\n writer2.flush();\n writer2.close();\n\n return source;\n }",
"private void checkDuplicates(String[] array) {\n\t\tfor (int j =0;j<array.length;j++)\n\t\t for (int k=j+1;k<array.length;k++)\n\t\t if (array[j].endsWith(array[k])){\n\t\t \tSystem.out.println(array[j] + array[k]);\n\t\t }\n\t}",
"public void findDupe(int choice) {\n\n\t\tString fullName = null;\n\t\tboolean flag = true;\n\n\t\tfor (Path file : filesArray) {\n\t\t\ttry {\n\t\t\t\tfullName = getFullName(file, choice);\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"problem read file: \" + file);\n\t\t\t\tflag = false;\n\t\t\t}\n\n\t\t\tif (flag) {\n\t\t\t\tmultiMap.put(fullName, file);\n\t\t\t\tCollection<Path> vals = (Collection<Path>) multiMap.get(fullName);\n\n\t\t\t\tif (vals.size() > 1) {\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tflag = true;\n\t\t}\n\n\t\tSet<String> keys = multiMap.keySet();\n\t\tIterator<String> items = keys.iterator();\n\n\t\twhile (items.hasNext()) {\n\t\t\tString str = (String) items.next();\n\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tCollection<Path> val = (Collection<Path>) multiMap.get(str);\n\t\t\tArrayList<Path> arr = new ArrayList<>(val);\n\n\t\t\tif (arr.size() <= 1)\n\t\t\t\titems.remove();\n\n\t\t}\n\n\t}",
"@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Namefile)) {\r\n return false;\r\n }\r\n Namefile other = (Namefile) object;\r\n if ((this.namefilePK == null && other.namefilePK != null) || (this.namefilePK != null && !this.namefilePK.equals(other.namefilePK))) {\r\n return false;\r\n }\r\n return true;\r\n }",
"public static void detectDuplicateNumbersM1(int[] numbersToDetect){\n map = new HashMap<Integer,Integer>();\n logger.info(\"hashmap is created\");\n for (int j : numbersToDetect) {\n if (map.get(j) == null) {\n logger.info(j + \" is added map\");\n map.put(j, 1);\n } else {\n logger.info(j + \" detected second time\");\n System.out.println(\"duplicated number: \" + j);\n break;\n }\n }\n }",
"private static String getKeyByMd5(String url) {\n String key;\n try {\n MessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\n messageDigest.update(url.getBytes());\n key = md5Encryption(messageDigest.digest());\n return key;\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n key = String.valueOf(url.hashCode());\n }\n return key;\n }",
"@Test\n public void testRemoveDuplicates() {\n System.out.println(\"removeDuplicates\");\n ArrayList<String> array = new ArrayList<>(Arrays.asList(\n \"A.example.COM,1.1.1.1,NO,11,Faulty fans\",\n \"b.example.com,1.1.1.2,no,13,Behind the other routers so no one sees it\",\n \"C.EXAMPLE.COM,1.1.1.3,no,12.1,\",\n \"d.example.com,1.1.1.4,yes,14,\",\n \"c.example.com,1.1.1.5,no,12,Case a bit loose\",\n \"e.example.com,1.1.1.6,no,12.3,\",\n \"f.example.com,1.1.1.7,No,12.200,\",\n \"g.example.com,1.1.1.6,no,15.0,Guarded by sharks with lasers on their heads\"\n ));\n ArrayList<String> expResult = new ArrayList<>(Arrays.asList(\n \"A.example.COM,1.1.1.1,NO,11,Faulty fans\",\n \"b.example.com,1.1.1.2,no,13,Behind the other routers so no one sees it\",\n \"d.example.com,1.1.1.4,yes,14,\",\n \"f.example.com,1.1.1.7,No,12.200,\"\n ));\n ArrayList<String> result = BTRouterPatch.removeDuplicates(array);\n assertEquals(expResult, result);\n }",
"private static long signatureHash(String tsPath, List<String> inputAllFiles) throws IOException {\n long crc32 = 0;\n for (String iFile : inputAllFiles) {\n long c = getCrc32(iFile) & 0xffffffffL;\n SystemOut.println(\"CRC32 from \" + iFile + \" = \" + c);\n crc32 ^= c;\n }\n SystemOut.println(\"CRC32 from all input files = \" + crc32);\n // store the CRC32 as a built-in variable\n if (tsPath != null) // nasty trick - do not insert signature into live data files\n VariableRegistry.INSTANCE.register(SIGNATURE_HASH, \"\" + crc32);\n return crc32;\n }",
"public String getMD5() {\n return hash;\n }",
"@Override\n\tpublic void deleteDuplicate(byte[] hash, long start, int len)\n\t\t\tthrows IOException {\n\n\t}",
"protected void checkSize(){\n if (size == data.length){\n resize( 2 * data.length);\n }\n }",
"private String fileChecksum(File tmpFile, ITaskMonitor monitor) {\n InputStream is = null;\n try {\n is = new FileInputStream(tmpFile);\n MessageDigest digester = getChecksumType().getMessageDigest();\n byte[] buf = new byte[65536];\n int n;\n while ((n = is.read(buf)) >= 0) {\n if (n > 0) {\n digester.update(buf, 0, n);\n }\n }\n return getDigestChecksum(digester);\n } catch (FileNotFoundException e) {\n monitor.setResult(\"File not found: %1$s\", e.getMessage());\n } catch (Exception e) {\n monitor.setResult(e.getMessage());\n } finally {\n if (is != null) {\n try {\n is.close();\n } catch (IOException e) {\n }\n }\n }\n return \"\";\n }",
"private static void task45() {\n String path1, path2;\n path1 = \"d:\\\\common\\\\java\\\\w3resource\\\\src\\\\basicPart1\\\\test.txt\";\n path2 = \"d:\\\\common\\\\java\\\\w3resource\\\\src\\\\basicPart1\\\\test-text.txt\";\n File file = new File(\"test.txt\");\n\n File file2 = new File(\"d:\\\\common\\\\java\\\\w3resource\\\\src\\\\basicPart1\\\\test-text.txt\");\n long size1 = file.length();\n long size2 = file2.length();\n\n System.out.println(\"d:\\\\common\\\\java\\\\w3resource\\\\src\\\\basicPart1\\\\test.txt \" + size1 + \" bites\");\n System.out.println(\"d:\\\\common\\\\java\\\\w3resource\\\\src\\\\basicPart1\\\\test-text.txt \" + size2 + \" bites\");\n }",
"public void testFindDuplicates() {\r\n System.out.println(\"findDuplicates\");\r\n \r\n List<String> elements = new ArrayList<>();\r\n elements.add(\"foo\");\r\n elements.add(\"bar\");\r\n elements.add(\"abc\");\r\n elements.add(\"foo\");\r\n elements.add(\"cde\");\r\n elements.add(\"cde\");\r\n elements.add(\"efg\");\r\n elements.add(\"cde\");\r\n \r\n Set<String> expResult = new LinkedHashSet<>();\r\n expResult.add(\"foo\");\r\n \r\n LexicalChecker instance = new LexicalChecker();\r\n Set<String> result = instance.findDuplicates(elements);\r\n \r\n assertNotSame(expResult, result);\r\n \r\n expResult.add(\"cde\");\r\n assertEquals(expResult, result);\r\n }",
"public static boolean m6741h(File file) {\n boolean z;\n File[] listFiles = file.listFiles();\n if (listFiles != null) {\n z = true;\n for (File h : listFiles) {\n z &= m6741h(h);\n }\n } else {\n z = true;\n }\n return file.delete() && true == z;\n }"
] | [
"0.6979287",
"0.6548208",
"0.6409197",
"0.6270499",
"0.60013545",
"0.595703",
"0.5946602",
"0.58419347",
"0.5806559",
"0.57982504",
"0.5751399",
"0.56605977",
"0.5645597",
"0.55901885",
"0.5587938",
"0.5572423",
"0.5564082",
"0.556193",
"0.55439216",
"0.5532996",
"0.5527574",
"0.55233705",
"0.55007124",
"0.5493412",
"0.5491679",
"0.5453406",
"0.5432698",
"0.5420257",
"0.536362",
"0.53307164",
"0.53285205",
"0.53273004",
"0.52998835",
"0.52996147",
"0.5276037",
"0.525945",
"0.52497196",
"0.5237336",
"0.52022815",
"0.51854765",
"0.51800746",
"0.516637",
"0.51649463",
"0.5161376",
"0.51594424",
"0.5155818",
"0.51487947",
"0.5142823",
"0.51421875",
"0.51418465",
"0.5137054",
"0.5135338",
"0.5119776",
"0.5078425",
"0.5060541",
"0.5059861",
"0.50551766",
"0.5048934",
"0.50481594",
"0.504355",
"0.5042365",
"0.50318587",
"0.50309277",
"0.50039005",
"0.49953607",
"0.49939117",
"0.49927306",
"0.4990739",
"0.49669313",
"0.49628597",
"0.49505258",
"0.49461836",
"0.49438816",
"0.49430293",
"0.49413225",
"0.49341887",
"0.49341765",
"0.49316743",
"0.4923557",
"0.49226874",
"0.491347",
"0.49071738",
"0.49054256",
"0.49013907",
"0.48998463",
"0.48975116",
"0.48861316",
"0.4874903",
"0.48737505",
"0.48640284",
"0.4860675",
"0.48535",
"0.4842817",
"0.4841007",
"0.48392597",
"0.48375928",
"0.48241943",
"0.4815324",
"0.4809107",
"0.48059532"
] | 0.63040334 | 3 |
private empty constructor don't need to create an entity | private NewsWriter() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public AbstractEntity() {\r\n\t}",
"public ExcursionEntity() {\n\t}",
"private EntityFactory() {}",
"public ExpertiseEntity() {\n }",
"public ClientDetailsEntity() {\n\t\t\n\t}",
"private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}",
"public MapEntity() {\n\t}",
"public NamedEntity() {}",
"protected Entity() {\n UID = GEN_COUNT;\n GEN_COUNT++;\n }",
"public UserEntity() {\n\t\tsuper();\n\t}",
"public MessageEntity() {\n }",
"public Entity() throws Throwable {\r\n\t\tThingsException.softwareProblem(\"Entry() instantiated with default constructor.\");\r\n\t}",
"private ObjectRepository() {\n\t}",
"public AlarmEntity(){}",
"public EntityID() {\n }",
"public Article() {\n\t}",
"public AccountTypeEntity() { }",
"public Entity(String name)\n {\n super(name);\n isAs = Lists.newArrayList();\n }",
"public QuestEntity() {\r\n\r\n }",
"protected CompanyJPA() {\n\t}",
"public PedometerEntity() {\n }",
"protected abstract ENTITY createEntity();",
"public EntityFactoryImpl() {\n\t\tsuper();\n\t}",
"public Article() {\n }",
"public SourceDataFileJpa() {\n // n/a\n }",
"private Model(){}",
"protected Product() {\n\t\t\n\t}",
"private User() {}",
"private AccessorModels() {\n // Private constructor to prevent instantiation\n }",
"protected Product()\n\t{\n\t}",
"public Model() {\n\t}",
"public Model() {\n\t}",
"public ModelResource() {\n }",
"public Product() {\n\t}",
"private SingleObject(){}",
"public Product() { }",
"public Product() { }",
"Entity createEntity();",
"public NamedEntity() { this(\"\", \"\"); }",
"private DatabaseOperations() {\n }",
"public Product() {}",
"public RoleEntity(){}",
"public Clade() {}",
"private User() {\n }",
"public EntityBundleCreate() {}",
"private Item(){}",
"@SuppressWarnings(\"unused\")\r\n private Rental() {\r\n }",
"private SingleObject()\r\n {\r\n }",
"public Product() {\n }",
"public Product() {\n }",
"public User() {\r\n\r\n\t}",
"protected Item() {\n }",
"public Relationship() {\r\n\t}",
"protected Settlement() {\n // empty constructor\n }",
"public Data() {\n \n }",
"public User() {\r\n\t}",
"private AttendantDatabase() {}",
"public EntityPropertyBean() {}",
"public TreePositionListJpa() {\n // do nothing\n }",
"private DataModelBuilder() {\n }",
"private DatabaseContract() {}",
"public Poem(){}",
"public Order() {\n\t}",
"private AdminEntity() {\n \tsuper();\n\n this.emf = Persistence.createEntityManagerFactory(\"entityManager\");\n\tthis.em = this.emf.createEntityManager();\n\tthis.tx = this.em.getTransaction();\n }",
"public Model() {\n }",
"public Model() {\n }",
"public Model() {\n }",
"private User(){\n\n }",
"private Instantiation(){}",
"public User() {\r\n \r\n }",
"public Order() {\n }",
"public Item(){}",
"private FixtureContract() {}",
"public User() {\n super();\n }",
"public User() {\n super();\n }",
"public CompanyData() {\r\n }",
"protected Approche() {\n }",
"public User() {\r\n }",
"protected abstract EntityBase createEntity() throws Exception;",
"public EntityHierarchyItem() {\n }",
"public NamedEntity(String name) { this(name, \"\"); }",
"public User() {\n\t}",
"public Company() {\r\n\t\tsuper();\r\n\t}",
"private CompanyManager() {}",
"private BaseDatos() {\n }",
"private DBContract() {}",
"private DBContract() {}",
"public Item() {}",
"private ArticleMgr() {\r\n\r\n\t}",
"protected void entityInit() {}",
"@Test\n public void eventEntityConstructionTest() {\n\n Event event = new EventEntity();\n\n assertThat(event).isNotNull();\n\n }",
"public Person() {\n\t\t\n\t}",
"public User() {\n\n\t}",
"public ModelBolting(){}",
"public Identity() {\n\n\t}",
"public User(){}",
"public User(){}",
"public User(){}",
"public ProductoRepository() {}",
"private BookContract() {}",
"public User()\n\t{\n\t}"
] | [
"0.78003544",
"0.7621449",
"0.76183844",
"0.7501441",
"0.74695367",
"0.739469",
"0.7389066",
"0.7326614",
"0.7305402",
"0.71646345",
"0.7140958",
"0.71384853",
"0.7107672",
"0.7098079",
"0.7067233",
"0.70334226",
"0.70205057",
"0.6995782",
"0.6987141",
"0.698437",
"0.6966521",
"0.6957559",
"0.69540447",
"0.6890041",
"0.6884673",
"0.6859142",
"0.68566924",
"0.68204343",
"0.68097043",
"0.6803121",
"0.68004495",
"0.68004495",
"0.678555",
"0.67382467",
"0.6727173",
"0.67014444",
"0.67014444",
"0.6699994",
"0.6699383",
"0.669636",
"0.66921383",
"0.6690857",
"0.6680184",
"0.66800594",
"0.6665296",
"0.6660975",
"0.66576076",
"0.6648776",
"0.6647404",
"0.6647404",
"0.66467595",
"0.6641303",
"0.6640615",
"0.6639252",
"0.6627218",
"0.6624591",
"0.6624037",
"0.66223484",
"0.6616678",
"0.6609885",
"0.66078407",
"0.6599534",
"0.6596988",
"0.6591095",
"0.65896076",
"0.65896076",
"0.65896076",
"0.65875524",
"0.65813255",
"0.6577415",
"0.6574275",
"0.65742123",
"0.65734214",
"0.6572769",
"0.6572769",
"0.6572243",
"0.65716934",
"0.6566126",
"0.65660673",
"0.656578",
"0.6555856",
"0.655226",
"0.65401745",
"0.6537433",
"0.6536276",
"0.6535667",
"0.6535667",
"0.65310186",
"0.6529418",
"0.6526099",
"0.6523869",
"0.6522769",
"0.6518752",
"0.6514716",
"0.6510624",
"0.6507744",
"0.6507744",
"0.6507744",
"0.65070164",
"0.6502643",
"0.6500499"
] | 0.0 | -1 |
Method create new file and write data into it | public static void write(String content, String fileName) throws IOException {
FileWriter fileWriter = new FileWriter(FileCreator.create(fileName));
fileWriter.write(content);
fileWriter.flush();
fileWriter.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private FSDataOutputStream createNewFile() throws Exception {\n\t\tlogger.traceEntry();\n\t\tPath newFile = new Path(rootDirectory, \"dim_\" + System.currentTimeMillis() + \".json\");\n\t\tlogger.debug(\"Creating file \" + newFile.getName());\n\t\tFSDataOutputStream dataOutputStream = null;\n\n\t\tif (!hadoopFileSystem.exists(newFile)) {\n\t\t\tdataOutputStream = hadoopFileSystem.create(newFile);\n\t\t} else {\n\t\t\tdataOutputStream = hadoopFileSystem.append(newFile);\n\t\t}\n\n\t\tdataOutputStreams.clear();\n\t\tdataOutputStreams.add(dataOutputStream);\n\t\tlogger.traceExit();\n\t\treturn dataOutputStream;\n\t}",
"private void createFile(String outputData, File file) {\n try {\n FileWriter writer = new FileWriter(file);\n writer.write(outputData);\n writer.close();\n } catch (IOException e) {\n e.getSuppressed();\n }\n }",
"protected abstract void writeFile();",
"public void createFiles() {\r\n try {\r\n FileWriter file = new FileWriter(registerNumber + \".txt\");\r\n file.write(\"Name : \" + name + \"\\n\");\r\n file.write(\"Surname : \" + surname + \"\\n\");\r\n file.write(\"Registration Number : \" + registerNumber + \"\\n\");\r\n file.write(\"Position : \" + position + \"\\n\");\r\n file.write(\"Year of Start : \" + yearOfStart + \"\\n\");\r\n file.write(\"Total Salary : \" + Math.round(totalSalary) + \".00 TL\" +\"\\n\");\r\n file.close();\r\n }\r\n catch(IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"@Override\n public File createFile(String path) throws IOException {\n String pathStr=path+fileSeparator+\"Mail.json\";\n File file = new File(pathStr);\n file.createNewFile();\n return file;\n }",
"static void createNewFile(String path) \n\t\t{\n\t\tLinkedList<String> defaultData = new LinkedList<String>();\n\t\tdefaultData.add(\"1,Frank,West,98,95,87,78,77,80\");\n\t\tdefaultData.add(\"2,Dianne,Greene,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"3,Doug,Lei,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"4,James,Hewlett,69,92,74,77,89,91\");\n\t\tdefaultData.add(\"5,Aroha,Wright,97,92,87,83,82,92\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tPrintWriter newFile = new PrintWriter(path, \"UTF-8\"); // Create .txt file in given path\n\t\t\t\n\t\t\tfor (String s : defaultData) \n\t\t\t{\n\t\t\t\tnewFile.println(s); // Write To file\n\t\t\t}\n\t\t\t\n\t\t\tnewFile.close(); // Close File\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"studentData.txt Created Successfully!\");\n\t\t\n\t}",
"public void save() {\r\n File distDataFile = new File(path);\r\n\r\n //String basePath = path;\r\n String endOfPath = path.substring(path.lastIndexOf(\"/\"));\r\n\r\n File rootDataFile;\r\n if (!path.contains(\"artists\")) {\r\n rootDataFile = new File(BASEDIR + \"/resources/data\" + endOfPath);\r\n } else {\r\n rootDataFile = new File(BASEDIR + \"/resources/data/artists\" + endOfPath);\r\n }\r\n\r\n File distTempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n File rootTempFile;\r\n if (!path.contains(\"artists\")) {\r\n rootTempFile = new File(BASEDIR + \"/resources/data/myTempFile.txt\");\r\n } else {\r\n rootTempFile = new File(BASEDIR + \"/resources/data/artists/myTempFile.txt\");\r\n }\r\n \r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(distTempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n distDataFile.delete();\r\n distTempFile.renameTo(distDataFile);\r\n\r\n BufferedWriter bw2 = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(rootTempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw2.write(line);\r\n bw2.newLine();\r\n }\r\n\r\n bw2.close();\r\n rootDataFile.delete();\r\n rootTempFile.renameTo(rootDataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOExceptoin in save1 : FileData\");\r\n }\r\n }",
"public abstract void writeToFile( );",
"private void CreateNewFile() {\n\tcheckState();\n\t\n\tif (CanR=CanW=true)\n\t{\n\t\t\n\t\ttry {\n\t\t root = Environment.getExternalStorageDirectory();\n\t\t \n\t\t if (root.canWrite()){\n\t\t gpxfile = new File(root, \"Speed_SD.csv\");\n\t\t gpxwriter = new FileWriter(gpxfile,true);\n\t\t out = new BufferedWriter(gpxwriter);\nout.append(\"\"+\",\"+\"\"+\",\"+\"\");\n\t\t out.newLine();\n\t\t }\n\t\t} catch (IOException e) {\n\t\t //Log.e(, \"Could not write file \" + e.getMessage());\ne.printStackTrace();\n\t\t\n\t}\n\t\t\n}\n\t\t}",
"@Override\n public FSDataOutputStream create(Path f) throws IOException {\n return super.create(f);\n }",
"FileContent createFileContent();",
"public void dataFileCreate() {\r\n\t\tString COMMA_DELIMITER = \",\";\r\n\t\tString NEW_LINE_SEPERATOR = \"\\n\";\r\n\t\tString FILE_HEADER = \"Title,First Name,Last Name,Email,Phone Number\";\r\n\t\ttry {\r\n\t\t\tList<Customer> dataList = new ArrayList<Customer>();\r\n\t\t\tdataList.add(\r\n\t\t\t\t\tnew Customer(title, customerFirstName, customerLastName, custromerEmailId, customerPhoneNumber));\r\n\r\n\t\t\tFileWriter fileWriter = new FileWriter(\"CustomerDetails.csv\");\r\n\t\t\tBufferedWriter bufferWriter = new BufferedWriter(fileWriter);\r\n\t\t\tbufferWriter.append(FILE_HEADER);\r\n\r\n\t\t\tfor (Customer c : dataList) {\r\n\t\t\t\tbufferWriter.write(NEW_LINE_SEPERATOR);\r\n\t\t\t\tbufferWriter.write(c.getTitle());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getFirstName());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getLastName());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getEmailAddress());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(String.valueOf(c.getPhone()));\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t}\r\n\r\n\t\t\tbufferWriter.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}",
"public abstract boolean writeDataToFile(String fileName, boolean overwrite);",
"@Test\n public void createFile(){\n try\n {\n URI uri = new URI(\"http://www.yu.edu/documents/doc390\");//given the complete uri\n String path = uri.getAuthority() + this.disectURI(uri);//get the Path which is www.yu.edu\\documents\n File file = new File(baseDir.getAbsolutePath() + File.separator + path);//make a File with the full class path and with the \"URI Path\"\n Files.createDirectories(file.toPath());//create the directories we didn't have before, ie not apart of the baseDir\n\n File theFile = new File(file.getAbsolutePath() + File.separator + \"doc390.txt\");//create a new File with the document as the last piece\n //wrap in a try because if the file is already there than we don't need to create a file\n if(!theFile.exists())Files.createFile(theFile.toPath());//create this file in the computer\n\n //write to the file -- in the real application this is the writing of the json\n FileWriter fileWriter = new FileWriter(theFile);\n fileWriter.write(\"HaYom sishi BShabbos\");\n fileWriter.flush();\n fileWriter.close();\n\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }",
"public void makeProgressFile() {\n progressData = new File(wnwData, \"progress.dat\");\n try {\n progressData.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n progressData.setWritable(true);\n }",
"private void createFile(PonsFileFactory ponsFileFactory, Profile profile){\n moveX(profile);\n ponsFileFactory.setProfile(profile);\n String text = ponsFileFactory.createPonsFile();\n String profileName = profile.getName();\n WriteFile.write(text,pathTextField.getText() + \"/\" + profileName.substring(0,profileName.indexOf(\".\")));\n }",
"public void save(String newFilePath) {\r\n File deletedFile = new File(path);\r\n deletedFile.delete();\r\n path = newFilePath;\r\n File dataFile = new File(path);\r\n File tempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(tempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n dataFile.delete();\r\n tempFile.renameTo(dataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOException in save2 : FileData\");\r\n }\r\n }",
"private void createFile(String fileName, String content) throws IOException {\n File file = new File(fileName);\n if (!file.exists()) {\n file.createNewFile();\n }\n FileWriter fileWriter = new FileWriter(fileName, false);\n fileWriter.append(content);\n fileWriter.close();\n }",
"private void createSaveData(){\n try {\n File f = new File(filePath, highScores);\n FileWriter output = new FileWriter(f);\n BufferedWriter writer = new BufferedWriter(output);\n\n writer.write(\"0-0-0-0-0\");\n writer.newLine();\n writer.write(\".....-.....-.....-.....-.....\");\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"void createFile()\n {\n //Check if file already exists\n try {\n File myObj = new File(\"src/main/java/ex45/exercise45_output.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());// created\n } else {\n System.out.println(\"File already exists.\"); //exists\n }\n //Error check\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }",
"protected void fileSet() throws IOException {\n//\t\tfos = new FileOutputStream(outFile, false);\n//\t\tdos = new DataOutputStream(fos);\n\t\trealWriter = new BufferedWriter(new FileWriter(outFile.getAbsolutePath()));\n\t}",
"Write createWrite();",
"public void writeFile(String data){\n\t\t\n\t\tcurrentLine = data;\n\t\t\n\t\t\ttry{ \n\t\t\t\tFile file = new File(\"/Users/bpfruin/Documents/CSPP51036/hw3-bpfruin/src/phfmm/output.txt\");\n \n\t\t\t\t//if file doesnt exists, then create it\n\t\t\t\tif(!file.exists()){\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t}\n \n\t\t\t\t//true = append file\n\t\t\t\tFileWriter fileWriter = new FileWriter(file,true);\n \t \tBufferedWriter bufferWriter = new BufferedWriter(fileWriter);\n \t \tbufferWriter.write(data);\n \t \tbufferWriter.close();\n \n \n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic void createFile(FacebookClient fbClient, ITable table,\r\n\t\t\tString outputFile) {\n\t}",
"public void crearPrimerFichero(){\n File f=new File(getApplicationContext().getFilesDir(),\"datos.json\");\n // si no existe lo creo\n if(!f.exists()) {\n String filename = \"datos.json\";\n String fileContents = \"[]\";\n FileOutputStream outputStream;\n\n try {\n outputStream = openFileOutput(filename, Context.MODE_PRIVATE);\n outputStream.write(fileContents.getBytes());\n outputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n }",
"public void writeFile() {\n try {\n FileWriter writer = new FileWriter(writeFile, true);\n writer.write(user + \" \" + password);\n writer.write(\"\\r\\n\"); // write new line\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n }",
"private void writeToFile() {\n try {\n FileOutputStream fos = new FileOutputStream(f);\n String toWrite = myJSON.toString(4);\n byte[] b = toWrite.getBytes();\n fos.write(b);\n fos.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void writeDataToTxtFile() {\n\n }",
"public static void createSaveFile( )\n {\n try\n {\n new File( \"data\" ).mkdirs( );\n PrintWriter writer = new PrintWriter( \"data/\" + Game.instance.getCurrentSaveFile( ).SAVEFILENAME + \".txt\", \"UTF-8\" );\n writer.println( \"dkeys: \" + Game.START_DIAMOND_KEY_COUNT );\n writer.close( );\n }\n catch ( IOException e )\n {\n e.printStackTrace( );\n System.exit( 1 );\n }\n }",
"public void newDemo() {\r\n \t\t\r\n \t\tString date = new SimpleDateFormat(\"yyyy-MM-dd_HH-mm-ss\").format(new Date());\r\n \t\tthis.fileName = this.demoFolder + this.map.replace(\".xml\", \"\") + \"_\" + date + \".r2d\";\r\n \t\ttry {\r\n \t\t\tthis.fos = (FileOutputStream)this.fileIO.writeFile(this.fileName);\r\n \t\t} catch (IOException e) {\r\n \t\t}\r\n \t\t\r\n \t\ttry {\r\n \t\t\tthis.demoParts.put(this.map + \"/\");\r\n \t\t} catch (InterruptedException e) {\r\n \t\t}\r\n \t}",
"private static void createFile(String fileType) throws Exception {\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"yyyy-MM-dd-HH-mm-ss\");\n LocalDateTime now = LocalDateTime.now();\n File xmlFile = new File(System.getProperty(\"user.dir\")+\"/data/saved/\"+dtf.format(now) + fileType + \".xml\");\n OutputFormat out = new OutputFormat();\n out.setIndent(5);\n FileOutputStream fos = new FileOutputStream(xmlFile);\n XML11Serializer serializer = new XML11Serializer(fos, out);\n serializer.serialize(xmlDoc);\n\n }",
"public void filecreate(String Response_details) throws IOException\n\t{\n\t\tFileWriter myWriter = new FileWriter(\"D://Loadtime.txt\",true);\n\t\tmyWriter.write(Response_details+System.lineSeparator());\n\t\tmyWriter.close();\n\t\tSystem.out.println(\"Successfully wrote to the file.\");\n\t\t\n\t\t\n\t}",
"private static void createFile() throws Exception {\n\t\t // retrieve an instance of H4File\n\t\t FileFormat fileFormat = FileFormat.getFileFormat(FileFormat.FILE_TYPE_HDF4);\n\n\t\t if (fileFormat == null) {\n\t\t System.err.println(\"Cannot find HDF4 FileFormat.\");\n\t\t return;\n\t\t }\n\n\t\t // create a new file with a given file name.\n\t\t @SuppressWarnings(\"deprecation\")\n\t\t\t\tH4File testFile = (H4File) fileFormat.create(fname);\n\n\t\t if (testFile == null) {\n\t\t System.err.println(\"Failed to create file:\" + fname);\n\t\t return;\n\t\t }\n\n\t\t // open the file and retrieve the root group\n\t\t testFile.open();\n\t\t Group root = (Group) ((javax.swing.tree.DefaultMutableTreeNode) testFile.getRootNode()).getUserObject();\n\n\t\t // set the data values\n\t\t int[] dataIn = new int[20 * 10];\n\t\t for (int i = 0; i < 20; i++) {\n\t\t for (int j = 0; j < 10; j++) {\n\t\t dataIn[i * 10 + j] = 1000 + i * 100 + j;\n\t\t }\n\t\t }\n\n\t\t // create 2D 32-bit (4 bytes) integer dataset of 20 by 10\n\t\t Datatype dtype = testFile.createDatatype(Datatype.CLASS_INTEGER, 4, Datatype.NATIVE, Datatype.NATIVE);\n\t\t @SuppressWarnings(\"unused\")\n\t\t\t\tDataset dataset = testFile\n\t\t .createScalarDS(\"2D 32-bit integer 20x10\", root, dtype, dims2D, null, null, 0, dataIn);\n\n\t\t // close file resource\n\t\t //testFile.close();\n\t\t }",
"public static void createFile(String name)\n {\n file = new File(name);\n try\n {\n if(file.exists())\n {\n file.delete();\n file.createNewFile();\n }else file.createNewFile();\n \n fileWriter = new FileWriter(file);\n fileWriter.append(\"Generation, \");\n fileWriter.append(\"Fitness, \");\n fileWriter.append(\"Average\\n\");\n \n }catch (IOException e) \n {\n System.out.println(e);\n }\n \n }",
"public boolean writeDataFile();",
"private static BufferedWriter createFileWriter(String filePath) {\n String[] pathComponents = filePath.split(\"/data/\");\n //to avoid heavy nesting in output, replace nested directory with filenames\n\n String output = pathComponents[0] + \"/out/rule_comparisons/\" + pathComponents[1].replace(\"/\",\"-\");\n\n File file = new File(output);\n try {\n //create file in this location if one does not exist\n if (!file.exists()) {\n file.createNewFile();\n }\n return new BufferedWriter(new FileWriter(file));\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }",
"@Override\n public StorageOutputStream create(File file) throws IOException {\n\treturn null;\n }",
"public void makeSessionFile() {\n sessionData = new File(wnwData, \"session.dat\");\n try {\n sessionData.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n sessionData.setWritable(true);\n }",
"public abstract T create(T file, boolean doPersist) throws IOException;",
"int createFile(String pFileNamePath, String pContent, String pPath, String pRoot, boolean pOverride) throws RemoteException;",
"public void writeToFile(File file) {\n\n\t}",
"public void createFile() throws IOException {\n String newName = input.getText();\n File user = new File(\"SaveData\\\\UserData\\\\\" + newName + \".txt\");\n\n if (user.exists() && !user.isDirectory()) {\n input.setStyle(\"-fx-border-color: red\");\n }\n if (user.exists() && !user.isDirectory() || newName.isEmpty()) {\n input.setStyle(\"-fx-border-color: red\");\n ERROR_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n\n }\n else {\n input.setStyle(\"-fx-border-color: default\");\n playerList.getItems().addAll(newName);\n PrintWriter newUser = new PrintWriter(new FileWriter(\"SaveData\\\\UserData\\\\\" + newName + \".txt\"));\n newUser.write(\"0 0 0 0 icon0 car\");\n newUser.close();\n MAIN_MENU_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n }\n }",
"private void saveResourceFile()\r\n\t{\t\r\n\t\tFile file = null;\r\n\t\tFileWriter fw = null;\r\n\t\t//File complete = null;//New file for the completed list\r\n\t\t//FileWriter fw2 = null;//Can't use the same filewriter to do both the end task and the complted products.\r\n\t\ttry{\r\n\t\t\tfile = new File(outFileName);\r\n\t\t\tfile.createNewFile();\r\n\t\t\tfw = new FileWriter(outFileName,true);\r\n\t\t\tfor(FactoryObject object : mFObjects)\r\n\t\t\t{\r\n\t\t\t\tif(object instanceof FactoryReporter) {\r\n\t\t\t\t\t((FactoryReporter)object).report(fw);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tSystem.out.println(ioe.getMessage());\r\n\t\t\tif(file != null) {\r\n\t\t\t\tfile.delete();\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tif(fw != null) {\r\n\t\t\t\ttry{\r\n\t\t\t\t\tfw.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tSystem.out.println(\"Failed to close the filewriter!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static boolean createFile() throws IOException {\n String bytes = \"\";\n byte[] write = bytes.getBytes(); //Salva i bytes della stringa nel byte array\n if(!fileName.exists()){\n Path filePath = Paths.get(fileName.toString()); //Converte il percorso in stringa\n Files.write(filePath, write); // Creare il File\n Main.log(\"File \\\"parametri\\\" creato con successo in \" + fileName.toString());\n return true;\n }\n return false;\n }",
"private static void createTestFile(String path) throws IOException {\n\t\tFile file = new File(path);\n\t\tFileWriter writer = new FileWriter(file);\n\t\twriter.write(\"Jenkins Test : \"+new Date() + \" ==> Writing : \" + Math.random());\n\t\twriter.flush();\n\t\twriter.close();\n\t}",
"public void writeFile(Context context){\n Writer writer = null;\n\n try {\n OutputStream out = context.openFileOutput(filename, Context.MODE_PRIVATE);\n writer = new OutputStreamWriter(out);\n writer.write(userName + \"~\" + color + \"~\" + level);\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n } finally {\n if (writer != null) {\n try {\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n }",
"public void create_loginFile(String account){\n try {\n outputStreamWriter = new OutputStreamWriter(context.openFileOutput(Constant.LOGIN_FILE, Context.MODE_PRIVATE));\n outputStreamWriter.write(account+\" logged in,\");\n outputStreamWriter.close();\n }\n catch (Exception e){\n Message.logMessages(\"ERROR: \",e.toString());\n }\n }",
"public void writeFile() {\n\t\ttry {\n\t\t\tFile dir = Environment.getExternalStorageDirectory();\n\t\t\tFile myFile = new File(dir.toString() + File.separator + FILENAME);\n\t\t\tLog.i(\"MyMovies\", \"SeSus write : \" + myFile.toString());\n\t\t\tmyFile.createNewFile();\n\t\t\tFileOutputStream fOut = new FileOutputStream(myFile);\n\t\t\tOutputStreamWriter myOutWriter = \n\t\t\t\t\tnew OutputStreamWriter(fOut);\n\t\t\tfor (Map.Entry<String, ValueElement> me : hm.entrySet()) {\n\t\t\t\tString refs = (me.getValue().cRefMovies>0? \"MOVIE\" : \"\");\n\t\t\t\trefs += (me.getValue().cRefBooks>0? \"BOOK\" : \"\");\n\t\t\t\tString line = me.getKey() + DELIMITER + me.getValue().zweiteZeile \n\t\t\t\t\t\t //+ DELIMITER\n\t\t\t\t\t\t //+ me.getValue().count\n\t\t\t\t\t \t+ DELIMITER\n\t\t\t\t\t \t+ refs\n\t\t\t\t\t \t + System.getProperty(\"line.separator\");\n\t\t\t\t//Log.i(\"MyMovies\", \"SeSus extracted : \" + line);\n\t\t\t\tmyOutWriter.write(line);\n\t\t\t}\n\t\t\tmyOutWriter.close();\n\t\t\tfOut.close();\n\t\t} catch (IOException e) {\n\t\t\t//\n\t\t\tLog.i(\"MyMovies\", \"SeSus write Exception : \");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"void Writer(String data, String FileName, Context context) {\n FileOutputStream outputStream = null;\n try {\n outputStream = context.openFileOutput(FileName,Context.MODE_PRIVATE);\n outputStream.write(data.getBytes());\n\n } catch (Exception e) {\n e.printStackTrace();\n }finally{\n if (outputStream != null){\n try {\n outputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }",
"public void createFile(){\r\n JFileChooser chooser = new JFileChooser();\r\n chooser.setAcceptAllFileFilterUsed(false);\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Only XML Files\", \"xml\");\r\n chooser.addChoosableFileFilter(filter);\r\n chooser.showSaveDialog(null);\r\n File f = chooser.getSelectedFile();\r\n if (!f.getName().endsWith(\".xml\")){\r\n f = new File(f.getAbsolutePath().concat(\".xml\"));\r\n }\r\n try {\r\n BufferedWriter bw = new BufferedWriter(new FileWriter(f));\r\n try (PrintWriter pw = new PrintWriter(bw)) {\r\n pw.println(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\r\n pw.println(\"<osm>\");\r\n for (Node node : this.getListNodes()) {\r\n if(node.getType() == TypeNode.INCENDIE){\r\n pw.println(\" <node id=\\\"\"+node.getId()+\"\\\" x=\\\"\"+node.getX()+\"\\\" y=\\\"\"+node.getY()+\"\\\" type=\\\"\"+node.getType()+\"\\\" intensity=\\\"\"+node.getFire()+\"\\\" />\");\r\n } else {\r\n pw.println(\" <node id=\\\"\"+node.getId()+\"\\\" x=\\\"\"+node.getX()+\"\\\" y=\\\"\"+node.getY()+\"\\\" type=\\\"\"+node.getType()+\"\\\" />\");\r\n }\r\n }\r\n for (Edge edge : this.getListEdges()) {\r\n pw.println(\" <edge nd1=\\\"\"+edge.getNode1().getId()+\"\\\" nd2=\\\"\"+edge.getNode2().getId()+\"\\\" type=\\\"\"+edge.getType()+\"\\\" />\");\r\n }\r\n pw.println(\"</osm>\");\r\n }\r\n } catch (IOException e) {\r\n System.out.println(\"Writing Error : \" + e.getMessage());\r\n }\r\n }",
"private void createScheduleFile() {\n try {\n File scheduleFile = new File(filePath, \"schedule.txt\");\n// FileWriter fw = new FileWriter(scheduleFile);\n\n OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(scheduleFile), StandardCharsets.UTF_8);\n osw.write(\"SCHEDULE:\\n\" + schedule);\n osw.close();\n\n System.out.println(\"schedule.txt successfully created.\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"File createFile(String name) throws IOException {\n File storageFile = File.createTempFile(FILE_PREFIX + name + \"_\", null, this.subDirectories[fileCounter.getAndIncrement()&(this.subDirectories.length-1)]); //$NON-NLS-1$\n if (LogManager.isMessageToBeRecorded(org.teiid.logging.LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) {\n LogManager.logDetail(org.teiid.logging.LogConstants.CTX_BUFFER_MGR, \"Created temporary storage area file \" + storageFile.getAbsoluteFile()); //$NON-NLS-1$\n }\n return storageFile;\n }",
"void create() {\n\t\ttry {\n\t\t\tFile file = new File(\"Student.txt\");\n\t\t\t//File named Student.txt is created\n\t\t\tboolean x = file.createNewFile();\n\t\t\tif (x) {\n\t\t\t\tSystem.out.println(\"File has been created successfully! \");\n\t\t\t//Message of successful creation after new file is created\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"File already present\");\n\t\t\t\t//message if file already exists\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception Occurred:\");\n\n\t\t}\t\t\t\t\n\t\t\n\t\t\t\t\n\t\ttry {\n\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"Student.txt\", true)));\n\t\tint x = 1;\n\t\t\n\t\tdo {\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint y;\n\t\t\t//take input from user for name,roll no and mobile no.\n\t\t\t\n\t\t\tSystem.out.print(\"\\nEnter Student Name: \");\n\t\t\tstudentname = br.readLine();\n\t\t\t\n\t\t\tSystem.out.print(\"Student Roll no: \");\n\t\t\trollno = Integer.parseInt(br.readLine());\t\t\n\t\t\t\n\t\t\tSystem.out.print(\"Mobile Number: \");\n\t\t\tmob_no = Integer.parseInt(br.readLine());\n\t\t\t\n\t\t\tSystem.out.print(\"Marks : \");\n\t\t\tmarks = Float.parseFloat(br.readLine());\n\t\t\t\n\t\t\t//display student data\n\n\t\t\tpw.println(studentname + \"\\t\" + rollno + \"\\t\" + marks + \"\\t\" + mob_no);\n\t\t\t\n\t\t\tSystem.out.println(\"Do you want to enter more records? \\n1) Yes\\n2) No\");\n\t\t\t\n\t\t\ty = sc.nextInt();\n\t\t\t\n\t\t\tif(y == 2) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t}while(x==1); //loop to add more records\n\t\tpw.close();\n\t\t}catch(IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t}",
"public void createFile(File file) throws IOException {\n if (!file.exists()) {\n file.createNewFile();\n }\n }",
"private PrintWriter getStorageFile() throws IOException {\n Path path = Paths.get(filePath);\n\n // Create directories if necessary\n if (path.getParent() != null) {\n Files.createDirectories(path.getParent().getFileName());\n }\n\n return new PrintWriter(new BufferedWriter(new FileWriter(filePath)));\n }",
"private void createStudentNotaFile(Nota n, String feedback) throws IOException {\n String numeStud = \"src/main/java/DataAll/DateStudenti/\"+ n.getStudent().getNumele()+\".txt\";\n File file = new File(numeStud);\n if(!file.exists()) {\n file.createNewFile();\n }\n BufferedWriter br = new BufferedWriter(new FileWriter(file,true));\n br.write(\"Tema: \" + n.getTema().getID().toString());\n br.newLine();\n br.write(\"Nota: \"+ n.getNota().toString());\n br.newLine();\n br.write(\"Predata_in_saptamana: \"+ n.getDataPredareTema().toString());\n br.newLine();\n br.write(\"Deadline: \" + n.getTema().getDeadline().toString());\n br.newLine();\n br.write(\"Feedback: \"+ feedback);\n br.newLine();\n br.newLine();\n try{\n br.close();\n }catch(Exception ex){\n throw new ValidationException(\"Error in closing the BufferedWriter\"+ex);\n }\n\n }",
"public EnigmaFile() throws Exception\n {\n\n String path = Main.class.getClassLoader().getResource(\"filein.txt\").getPath();\n File currentDirectory=new File(path);\n finstream = new FileInputStream(currentDirectory);\n\n\n String pathToWrite = path.replaceFirst(\"filein.txt\",\"fileout.txt\");\n File outputFile = new File(pathToWrite);\n br = new BufferedReader(new InputStreamReader(finstream));\n outputFile.createNewFile();\n FileWriter fileWrite = new FileWriter(outputFile.getAbsoluteFile());\n writer = new BufferedWriter(fileWrite);\n\n\n }",
"public File newLogFile() {\n File flog = null;\n try {\n this.logFileName = getTimestamp() + \".xml\";\n this.pathToLogFile = logFileFolder + logFileName;\n URL logURL = new URL(this.pathToLogFile);\n flog = new File(logURL.toURI());\n if (!flog.exists()) {\n flog.createNewFile();\n }\n } catch (Exception ex) {\n log.error(\"newLogFile :\"+ ex.getMessage());\n } finally{\n this.fLogFile = flog;\n return flog;\n }\n }",
"public void createFile(File file) {\n\t\tif (file.exists())\n\t\t\treturn;\n\t\ttry {\n\t\t\tfile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"static void writeToFiles() throws IOException {\n\n writeToFilePriceHistory();\n writeToFileEmployees();\n writeToFileInventory();\n writeToSaleItems();\n writeToOrder();\n writeToFileInventory();\n writeToRevenueLog();\n }",
"public void createStorageFile() throws IoDukeException {\n PrintWriter writer = null;\n try {\n writer = getStorageFile();\n } catch (IOException e) {\n throw new IoDukeException(\"Error opening task file for reading\");\n } finally {\n if (writer != null) {\n writer.close();\n }\n }\n }",
"static void writeFile(String path , String data) throws IOException{\n\t\tFileOutputStream fo = new FileOutputStream(path,true);\n\t\tfo.write(data.getBytes());\n\t\tfo.close();\n\t\tSystem.out.println(\"Done...\");\n\t}",
"public abstract void addFileToWrite(AsynchronousFileWriter.FileData fileData, CompilerMessageLogger logger);",
"void writeToFile() throws IOException{\n\t\tString fileName = f.getTitle() + \".txt\";\n\t\tfileWrite = new BufferedWriter( new FileWriter(fileName));\n\t\tfileWrite.write(history);\n\t\tSystem.out.println(fileName + \" File Writing Successful!!\");\n\t\tSystem.out.println(\"Data in file :\\n\" + history);\n\t\tfileWrite.flush();\n\t\tFile file = new File(fileName);\n\t\tjava.awt.Desktop.getDesktop().open(file);\n\n\t}",
"private void writeToFile(){\n try(BufferedWriter br = new BufferedWriter(new FileWriter(filename))){\n for(Teme x:getAll())\n br.write(x.toString()+\"\\n\");\n br.close();\n }catch (IOException e){\n e.printStackTrace();\n }\n }",
"public void createPatient() throws IOException\n {\n addPatientToList();\n \n //creates the patient's empty folders and files\n File userFolder = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB); \n File patientEvaluation = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm\");\n File patientProgressReports = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/ProgressNotes\"); \n \n try\n \t{\n \tuserFolder.mkdir();\n patientEvaluation.mkdir();\n patientProgressReports.mkdir();\n \t//result = true;\n \t} \n \tcatch(SecurityException se)\n \t{\n \t//handle it\n \t} \n \t\n File listOfProgressReports = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/ProgressReports.txt\");\n FileWriter writer = new FileWriter(listOfProgressReports, true);\t \n BufferedWriter bufferedreader = new BufferedWriter(writer);\n writer.append(\"\");\n bufferedreader.close();\n writer.close();\n \n \n /*if(result) \n \t{ \n \t\tSystem.out.println(\"DIR created\"); \n \t}*/\n \n //creates the patient's empty evaluation form files\n File signedStatus = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/signed.txt\");\n FileWriter w = new FileWriter(signedStatus, true);\t \n BufferedWriter b = new BufferedWriter(w);\n w.append(\"false\");\n b.close();\n w.close();\n \n File firstName = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/first.txt\");\n FileWriter writ = new FileWriter(firstName, true);\t \n BufferedWriter bw = new BufferedWriter(writ);\n writ.append(currentPatientFirstName);\n bw.close();\n writ.close();\n \n File lastName = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/last.txt\");\n FileWriter writ1 = new FileWriter(lastName, true);\t \n BufferedWriter bw1 = new BufferedWriter(writ1);\n writ1.append(currentPatientLastName);\n bw1.close();\n writ1.close();\n \n File age = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/age.txt\");\n FileWriter writ2 = new FileWriter(age, true);\t \n BufferedWriter bw2 = new BufferedWriter(writ2);\n writ2.append(\"\");\n bw2.close();\n writ2.close();\n \n File dob = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/dateofbirth.txt\");\n FileWriter writ3 = new FileWriter(dob, true);\t \n BufferedWriter bw3 = new BufferedWriter(writ3);\n writ3.append(\"\");\n bw3.close();\n writ3.close();\n \n File maritalstatus = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/maritalstatus.txt\");\n FileWriter writ4 = new FileWriter(maritalstatus, true);\t \n BufferedWriter bw4 = new BufferedWriter(writ4);\n writ4.append(\"\");\n bw4.close();\n writ4.close();\n \n File ethnicity = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/ethnicity.txt\");\n FileWriter writ5 = new FileWriter(ethnicity, true);\t \n BufferedWriter bw5 = new BufferedWriter(writ5);\n writ5.append(\"\");\n bw5.close();\n writ5.close();\n\n File ethnicityother = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/ethnicity-other.txt\");\n FileWriter writt = new FileWriter(ethnicityother, true);\t \n BufferedWriter bww = new BufferedWriter(writt);\n writt.append(\"\");\n bww.close();\n writt.close();\n \n File sex = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/sex.txt\");\n FileWriter writ6 = new FileWriter(sex, true);\t \n BufferedWriter bw6 = new BufferedWriter(writ6);\n writ6.append(\"\");\n bw6.close();\n writ6.close();\n \n File referredBy = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/referredby.txt\");\n FileWriter writ7 = new FileWriter(referredBy, true);\t \n BufferedWriter bw7 = new BufferedWriter(writ7);\n writ7.append(\"\");\n bw7.close();\n writ7.close();\n \n File referredByTherapist = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/referredby-therapist.txt\");\n FileWriter writ8 = new FileWriter(referredByTherapist, true);\t \n BufferedWriter bw8 = new BufferedWriter(writ8);\n writ8.append(\"\");\n bw8.close();\n writ8.close();\n \n File referredByOther = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/referredby-other.txt\");\n FileWriter writ9 = new FileWriter(referredByOther, true);\t \n BufferedWriter bw9 = new BufferedWriter(writ9);\n writ9.append(\"\");\n bw9.close();\n writ9.close();\n \n //dr. prince\n File reasonForReferral = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/reasonforreferral.txt\");\n FileWriter writ10 = new FileWriter(reasonForReferral, true);\t \n BufferedWriter bw10 = new BufferedWriter(writ10);\n writ10.append(\"\");\n bw10.close();\n writ10.close();\n \n File sourceOfInformation = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/sourceofinformation.txt\");\n FileWriter writ11 = new FileWriter(sourceOfInformation, true);\t \n BufferedWriter bw11 = new BufferedWriter(writ11);\n writ11.append(\"\");\n bw11.close();\n writ11.close();\n \n File sourceOfInformationOther = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/sourceofinformation-other.txt\");\n FileWriter writ12 = new FileWriter(sourceOfInformationOther, true);\t \n BufferedWriter bw12 = new BufferedWriter(writ12);\n writ12.append(\"\");\n bw12.close();\n writ12.close();\n \n File reliabilityOfInformation = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/reliabilityofinformation.txt\");\n FileWriter writ13 = new FileWriter(reliabilityOfInformation, true);\t \n BufferedWriter bw13 = new BufferedWriter(writ13);\n writ13.append(\"\");\n bw13.close();\n writ13.close();\n \n File reliabilityOfInformationOther = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/reliabilityofinformation-other.txt\");\n FileWriter writ14 = new FileWriter(reliabilityOfInformationOther, true);\t \n BufferedWriter bw14 = new BufferedWriter(writ14);\n writ14.append(\"\");\n bw14.close();\n writ14.close();\n \n File historyOfPresentIllness = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/historyofpresentillness.txt\");\n FileWriter writ15 = new FileWriter(historyOfPresentIllness, true);\t \n BufferedWriter bw15 = new BufferedWriter(writ15);\n writ15.append(\"\");\n bw15.close();\n writ15.close();\n \n File signsSymptoms = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/signsandsymptoms.txt\");\n FileWriter writ16 = new FileWriter(signsSymptoms, true);\t \n BufferedWriter bw16 = new BufferedWriter(writ16);\n writ16.append(\"\");\n bw16.close();\n writ16.close();\n \n File currentMedications = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/currentmedications.txt\");\n FileWriter writ17 = new FileWriter(currentMedications, true);\t \n BufferedWriter bw17 = new BufferedWriter(writ17);\n writ17.append(\"\");\n bw17.close();\n writ17.close();\n \n File pastHistoryOf = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/pasthistoryof.txt\");\n FileWriter writ18 = new FileWriter(pastHistoryOf, true);\t \n BufferedWriter bw18 = new BufferedWriter(writ18);\n writ18.append(\"\");\n bw18.close();\n writ18.close();\n \n File pastHistoryOfText = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/pasthistoryoftext.txt\");\n FileWriter writ19 = new FileWriter(pastHistoryOfText, true);\t \n BufferedWriter bw19 = new BufferedWriter(writ19);\n writ19.append(\"\");\n bw19.close();\n writ19.close();\n \n File medicationTrialsTable = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/medicationtrialstable.txt\");\n FileWriter writ20 = new FileWriter(medicationTrialsTable, true);\t \n BufferedWriter bw20 = new BufferedWriter(writ20);\n writ20.append(\"\");\n bw20.close();\n writ20.close();\n \n File medicationTrialsComments = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/medicationtrialscomments.txt\");\n FileWriter writ21 = new FileWriter(medicationTrialsComments, true);\t \n BufferedWriter bw21 = new BufferedWriter(writ21);\n writ21.append(\"\");\n bw21.close();\n writ21.close();\n \n File substanceUseHistory = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/substanceusehistory.txt\");\n FileWriter writ22 = new FileWriter(substanceUseHistory, true);\t \n BufferedWriter bw22 = new BufferedWriter(writ22);\n writ22.append(\"\");\n bw22.close();\n writ22.close();\n \n File deniesHistoryOf = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/denieshistoryof.txt\");\n FileWriter writ23 = new FileWriter(deniesHistoryOf, true);\t \n BufferedWriter bw23 = new BufferedWriter(writ23);\n writ23.append(\"\");\n bw23.close();\n writ23.close();\n \n File deniesHistoryOfText = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/denieshistoryoftext.txt\");\n FileWriter writ24 = new FileWriter(deniesHistoryOfText, true);\t \n BufferedWriter bw24 = new BufferedWriter(writ24);\n writ24.append(\"\");\n bw24.close();\n writ24.close();\n \n File socialHistoryText = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/socialhistorytext.txt\");\n FileWriter writ25 = new FileWriter(socialHistoryText, true);\t \n BufferedWriter bw25 = new BufferedWriter(writ25);\n writ25.append(\"\");\n bw25.close();\n writ25.close();\n \n File socialHistoryParents = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/socialhistoryparents.txt\");\n FileWriter writ26 = new FileWriter(socialHistoryParents, true);\t \n BufferedWriter bw26 = new BufferedWriter(writ26);\n writ26.append(\"\");\n bw26.close();\n writ26.close();\n \n File socialHistorySiblings = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/socialhistorysiblings.txt\");\n FileWriter writ27 = new FileWriter(socialHistorySiblings, true);\t \n BufferedWriter bw27 = new BufferedWriter(writ27);\n writ27.append(\"\");\n bw27.close();\n writ27.close();\n \n File socialHistoryChildren = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/socialhistorychildren.txt\");\n FileWriter writ28 = new FileWriter(socialHistoryChildren, true);\t \n BufferedWriter bw28 = new BufferedWriter(writ28);\n writ28.append(\"\");\n bw28.close();\n writ28.close();\n \n File familyHistoryOfMentalIllness = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/familyhistoryofmentalillness.txt\");\n FileWriter writ29 = new FileWriter(familyHistoryOfMentalIllness, true);\t \n BufferedWriter bw29 = new BufferedWriter(writ29);\n writ29.append(\"\");\n bw29.close();\n writ29.close();\n \n }",
"public void writeFile(String filename,String data) {\n\n BufferedWriter out = null;\n if (filename.trim().length() > 0) {\n try {\n out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename,true)));\n out.write(data);\n out.close();\n } catch (IOException e) {\n System.out.println(\"I/O Error\");\n }\n } else {\n System.out.println(\"Enter a filename:\");\n }\n }",
"public File exportData() {\n File zephyrlogFolder = new File(Environment.getExternalStorageDirectory(), \"QuestionnaireActs\");\n\n boolean dirExists = zephyrlogFolder.exists();\n //if the directory doesn't exist, create it\n if (!dirExists) {\n dirExists = zephyrlogFolder.mkdirs();\n //if it still doesn't exist, give up and exit\n if (!dirExists) {\n Toast.makeText(this, \"Could not create ZephyrLogs directory!\", Toast.LENGTH_LONG).show();\n }\n }\n\n\n //create a data file and write into it\n File file = new File(zephyrlogFolder, \"Questionnaire_\"+promptName+\".txt\");\n try {\n FileWriter writer;\n if(!file.exists()){\n boolean created = file.createNewFile();\n if (!created) throw new IOException(\"Could not create data file\");\n writer = new FileWriter(file, true);\n //if this is a new file, write the CSV format at the top\n writer.write(\"Ονοματεπώνυμο: \"+promptName+\"\\n\"+\"Score: \"+myscore+\"\\n\\n\");\n } else {\n writer = new FileWriter(file, true);\n }\n writer.write(\"Ονοματεπώνυμο: \"+promptName+\"\\n\"+\"Score: \"+myscore+\"\\n\\n\");\n writer.close();\n } catch (FileNotFoundException e) {\n Toast.makeText(this, \"Could not create logging file!\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n Toast.makeText(this, \"Unsupported encoding exception thrown trying to write file!\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n } catch (IOException e) {\n Toast.makeText(this, \"IO Exception trying to write to data file!\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n return file;\n }",
"public void FilesBufferWrite2Append() throws IOException {\n \ttry { \t\n \t\t\n \t \t/* This logic will check whether the file\n \t \t \t * exists or not. If the file is not found\n \t \t \t * at the specified location it would create\n \t \t \t * a new file*/\n \t \t \tif (!file.exists()) {\n \t \t\t file.createNewFile();\n \t \t \t}\n \t\t\n \t \t \t//KP : java.nio.file.Files.write - NIO is buffer oriented & IO is stream oriented!]\n \t\tString str2Write = \"\\n\" + LocalDateTime.now().toString() + \"\\t\" + outPrintLn + \"\\n\";\n \t\tFiles.write(Paths.get(outFilePath), str2Write.getBytes(), StandardOpenOption.APPEND);\n \t\t\n \t}catch (IOException e) {\n\t \t// TODO Auto-generated catch block\n\t \te.printStackTrace();\t\t\n\t\t\tSystem.out.print(outPrintLn);\n\t\t\tSystem.out.println(outPrintLn);\t\n \t}\n }",
"void setNewFile(File file);",
"public void Write_data() {\n // add-write text into file\n try {\n FileOutputStream fileout=openFileOutput(\"savedata11.txt\", MODE_PRIVATE);\n OutputStreamWriter outputWriter=new OutputStreamWriter(fileout);\n outputWriter.write(Integer.toString(_cnt));\n outputWriter.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public void writeFile(Context inContext, String Name, String Category, String ObjectType, String Latitude, String Longitude){\n\r\n\t\tFileWriter fWriter;\r\n\r\n\t\t\r\n\t\t\r\n\t\ttry{\r\n\t\t\tfWriter = new FileWriter(\"/sdcard/data/filename.txt\");\r\n\r\n\t\t\tString newLine = System.getProperty(\"line.separator\");\r\n\t\t\t\r\n\t\t\t//Read all lines in txt file until strikes empty line and writes on that line\r\n\r\n\t\t\tFileInputStream fstream = new FileInputStream(\"filename.txt\");\r\n\t\t\t// Get the object of DataInputStream\r\n\t\t\tDataInputStream in = new DataInputStream(fstream);\r\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(in));\r\n\t\t\tString strLine;\r\n\t\t\t\r\n\t\t\t//Read File Line By Line\r\n\t\t\twhile ((strLine = br.readLine()) == null) {\r\n\t\t\t\t// Print the content on the console\r\n\t\t\t\tSystem.out.println (strLine);\r\n\t\t\t\tfWriter.write(\"penis\" + newLine);\r\n\t\t\t}\r\n\r\n\t\t\t//System.out.println(\"if\"+i);\r\n\t\t\tfWriter.write(Name + \":\" + Category + \":\" + ObjectType + \":\" + Latitude + \":\" + Longitude + \";\");\r\n\t\t\tfWriter.flush();\r\n\t\t\tfWriter.close();\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}",
"private void writeToFile(){\n Calendar c = Calendar.getInstance();\n String dateMedTaken = DateFormat.getDateInstance(DateFormat.FULL).format(c);\n FileOutputStream fos = null;\n\n try {\n fos = openFileOutput(FILE_NAME, MODE_APPEND);\n fos.write(dateMedTaken.getBytes());\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if(fos != null){\n try {\n fos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n }",
"private void createHTMLFile(Webpage webpage) {\n String filepath = \"resources/tempHTML\" +Thread.currentThread().getName() +\".html\";\n\n try {\n //Create HTML file\n File file = new File(filepath);\n OutputStreamWriter fW = new OutputStreamWriter(new FileOutputStream(file), Charset.forName(\"UTF-8\").newEncoder());\n fW.write(webpage.getHTML());\n fW.flush();\n fW.close();\n\n //Set HTML file size\n webpage.setFileSize(Utils.getFileSize(filepath));\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private void createFile() {\n if (mDriveServiceHelper != null) {\n Log.d(\"error\", \"Creating a file.\");\n\n mDriveServiceHelper.createFile()\n .addOnSuccessListener(fileId -> readFile(fileId))\n .addOnFailureListener(exception ->\n Log.e(\"error\", \"Couldn't create file.\", exception));\n }\n }",
"public void createNewImageFile(){\n fillNewImage();\n\n try {\n ImageIO.write(newImage, imageFileType, new File(k + \"_Colored_\" + fileName.substring(0,fileName.length() - 4) + \".\" + imageFileType));\n } catch (IOException e){\n e.printStackTrace();\n }\n \n }",
"private void writeToFile(E entity){\n try (BufferedWriter bw = new BufferedWriter(new FileWriter(this.fileName,true))) {\n bw.write(entity.toFile());\n bw.newLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static void CreateFile(){\n try{\n new File(\"wipimages\").mkdir();\n logscommissions.createNewFile();\n }catch(Exception e){\n e.printStackTrace();\n System.out.println(\"CreateFile Failed\\n\");\n }\n }",
"public void create_registerFile(String name,String roll){\n try{\n outputStreamWriter=new OutputStreamWriter(context.openFileOutput(Constant.REGISTER_FILE,Context.MODE_PRIVATE));\n outputStreamWriter.write(name+\",\");\n outputStreamWriter.write(roll+\",\");\n outputStreamWriter.close();\n }\n catch (Exception e){\n Message.logMessages(\"ERROR: \",e.toString());\n }\n }",
"private void insertIntoFile(String data){\n\t\tOutputStream os = null;\n try {\n os = new FileOutputStream(file);\n os.write(data.getBytes(), 0, data.length());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\t}",
"private void writeToFile(Contacts _data, String _filename) throws IOException {\n\n File mydir = this.getDir(\"mydir\", Context.MODE_PRIVATE); //Creating an internal dir;\n File fileWithinMyDir = new File(mydir, _filename); //Getting a file within the dir.\n FileOutputStream out = new FileOutputStream(fileWithinMyDir); //Use the stream as usual to write into the file.\n ObjectOutputStream oos = new ObjectOutputStream(out);\n\n if (mContacts == null){\n mContacts = new Contacts();\n }\n mContacts.setData(_data);\n oos.writeObject(mContacts);\n oos.close();\n\n }",
"private void saveInFile() {\n try {\n FileOutputStream fos = openFileOutput(FILENAME,\n Context.MODE_PRIVATE);//goes stream based on filename\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos)); //create buffer writer\n Gson gson = new Gson();\n gson.toJson(countbookList, out);//convert java object to json string & save in output\n out.flush();\n fos.close();\n } catch (FileNotFoundException e) {\n throw new RuntimeException();\n } catch (IOException e) {\n throw new RuntimeException();\n }\n }",
"static void writeFile(){\n try{\n Path contactsListPath = Paths.get(\"contacts\",\"contacts.txt\");\n Files.write(contactsListPath, contactList);\n } catch(IOException ioe){\n ioe.printStackTrace();\n }\n //refreshes list of Contact objs\n fileToContactObjs();\n }",
"private static void writeFile(String name, Trajectory t) {\n\t\ttry {\n\t\t\tFile directory = new File(cacheDirectory);\n\t\t\tif (!directory.exists()) {\n\t\t\t\tconsole.log(\"missing dir, making\");\n\t\t\t\tdirectory.mkdir();\n\t\t\t}\n\t\t\t\n\t\t\tFileOutputStream fos = new FileOutputStream(cacheDirectory + name);\n\t\t ObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t oos.writeObject(t);\n\t\t oos.close();\n\t\t fos.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t}",
"private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}",
"private void writeToFile() throws IOException {\n\t\tFileWriter write = new FileWriter(path);\n\t\tPrintWriter print_line = new PrintWriter(write);\n\t\t\n\t\tEnumeration<String> fd_key_Enum = fileData.keys();\n\t\tEnumeration<String> fd_value_Enum = fileData.elements();\n\t\twhile (fd_key_Enum.hasMoreElements() && fd_value_Enum.hasMoreElements()) {\n\t\t\tprint_line.printf(\"%s\" + \"%n\", fd_key_Enum.nextElement() + \":\" + fd_value_Enum.nextElement());\n\t\t}\n\t\t\n\t\tprint_line.close();\n\t\twrite.close();\n\t}",
"public static File saveFile(String name, String data) {\n if (name == null) {\n name = \"\";\n }\n String fullyQualifiedName = name;\n\n // if filename is not absolute use current path as base dir\n if (!new File(fullyQualifiedName).isAbsolute()) {\n fullyQualifiedName = Paths.get(\"\").toAbsolutePath() + \"/\" + name;\n }\n try {\n // create subdirs (if there any)\n if (fullyQualifiedName.contains(\"/\")) {\n File f = new File(fullyQualifiedName.substring(0, fullyQualifiedName.lastIndexOf(\"/\")));\n f.mkdirs();\n }\n File file = new File(fullyQualifiedName);\n file.createNewFile();\n FileUtils.write(file, data, \"UTF-8\");\n log.info(\"Wrote: {}\", file.getAbsolutePath());\n return file;\n } catch (IOException e) {\n log.error(\"Could not create file {}\", name, e);\n return null;\n }\n }",
"public static File createNewFile(String filename){\n try {\n File outputFile = new File(filename + \".csv\");\n\n //Creates File\n outputFile.createNewFile();\n\n return outputFile;\n\n } catch (IOException ex) {\n Logger.getLogger(CSVWriter.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }",
"@Override\n public void run(){\n int status = 0;\n try{\n FileWriter writer = new FileWriter(file);\n writer.append(data);\n writer.flush();\n writer.close();\n Log.d(\"MainActivity\",\"File saved to \"+file.getAbsolutePath());\n //Log.v(\"DataActivity\", data);\n status = 1;\n }catch (IOException e){\n Log.e(\"Exception\", \"File write failed: \" + e.toString());\n }\n Message msg = new Message();\n msg.what = status;\n msg.obj = file.getAbsolutePath();\n msg.arg1 = type;\n Log.d(\"File\", file.getAbsolutePath());\n if (writeToFileHandler != null){\n writeToFileHandler.sendMessage(msg);\n }\n }",
"private void writeToFile(String data, Context context) throws FileNotFoundException\r\n{\n if (fileExists(this, \"todolist.txt\"))\r\n {\r\n\r\n FileOutputStream fOut = openFileOutput(\"todolist.txt\", MODE_APPEND);\r\n OutputStreamWriter osw = new OutputStreamWriter(fOut);\r\n try {\r\n osw.write(\"\\n\");\r\n osw.write(data);\r\n osw.flush();\r\n osw.close();\r\n } catch (IOException e) {\r\n Log.e(\"Exception\", \"File write failed: \" + e.toString());\r\n }\r\n }\r\n // otherwise make the file\r\n else\r\n {\r\n FileOutputStream fos = null;\r\n\r\n fos = openFileOutput(\"todolist.txt\", MODE_PRIVATE);\r\n try {\r\n fos.write(data.getBytes());\r\n // Toast.makeText(this, getFilesDir() + \"/\" + \"todolist.txt\", Toast.LENGTH_LONG).show();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } finally {\r\n if (fos != null) {\r\n try {\r\n fos.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n}\r\n}",
"public boolean create()\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn file.createNewFile() ;\n\t\t}\n\t\tcatch( IOException ex )\n\t\t{\n\t\t\tex.printStackTrace() ;\n\t\t\treturn false ;\n\t\t}\n\t}",
"public void addToBuffer(String filename, SensorData sensorData){\n ObjectOutputStream outstream;\n try {\n File bufferFile = new File(filename);\n //Checks to see if the buffer file already exists. \n if(bufferFile.exists())\n {\n //Create an AppendableObjectOutputStream to add the the end of the buffer file as opposed to over writeing it. \n outstream = new AppendableObjectOutputStream(new FileOutputStream (filename, true));\n } else {\n //Create an ObjectOutputStream to create a new Buffer file. \n outstream = new ObjectOutputStream(new FileOutputStream (filename)); \n }\n //Adds the SensorData to the end of the buffer file.\n outstream.writeObject(sensorData);\n outstream.close();\n } catch(IOException io) {\n System.out.println(io);\n }\n }",
"public void save() {\n UTILS.write(FILE.getAbsolutePath(), data);\n }",
"private static void writeToFile(final String message, final File toFile) {\n toFile.getParentFile().mkdirs();\n BufferedWriter writer = null;\n try {\n writer = new BufferedWriter(new FileWriter(toFile));\n writer.write(message);\n } \n catch (IOException e) {\n log.error(\"Error writing file=\"+toFile, e);\n } \n finally {\n if (writer != null) {\n try {\n writer.close();\n } \n catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }",
"private void writeFile(TimerEntity entity) {\n final File file = fileName(entity.getTimedObjectId(), entity.getId());\n\n FileOutputStream fileOutputStream = null;\n try {\n fileOutputStream = new FileOutputStream(file, false);\n final Marshaller marshaller = factory.createMarshaller(configuration);\n marshaller.start(new OutputStreamByteOutput(fileOutputStream));\n marshaller.writeObject(entity);\n marshaller.finish();\n fileOutputStream.flush();\n fileOutputStream.getFD().sync();\n } catch (FileNotFoundException e) {\n throw new RuntimeException(e);\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n if (fileOutputStream != null) {\n try {\n fileOutputStream.close();\n } catch (IOException e) {\n logger.error(\"IOException closing file \", e);\n }\n }\n }\n }",
"public void reWriteFile(String filename,String data) {\n\n if (filename.trim().length() > 0) {\n try {\n PrintWriter output = new PrintWriter(filename);\n\n output.write(data);\n\n output.close();\n } catch (IOException e) {\n System.out.println(\"I/O Error\");\n }\n } else {\n System.out.println(\"Enter a filename:\");\n }\n }",
"public void CreateTestResultFile()\n\t{ \n\t\tDate dNow = new Date( );\n\t\tSimpleDateFormat ft =new SimpleDateFormat (\"MMddYYYY\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tFileOutputStream fos = new FileOutputStream(System.getProperty(\"user.dir\")+\"//PG HealthCheck List_\"+ft.format(dNow)+\".xls\");\n\t HSSFWorkbook workbook = new HSSFWorkbook();\n\t HSSFSheet worksheet = workbook.createSheet(\"PG Functionality - Country\");\n\t HSSFRow row1 = worksheet.createRow(0);\n\t row1.createCell(0).setCellValue(\"Availability of Data\");\n\t HSSFRow row = worksheet.createRow(1);\n\t row.createCell(0).setCellValue(\"Testcase\");\n\t row.createCell(1).setCellValue(\"TestRunStatus\");\n\t row.createCell(2).setCellValue(\"Remarks\");\n\t workbook.write(fos);\n\t fos.close();\n\t \t \n\t } \n\t\tcatch (Exception e)\n\t {\n\t \te.printStackTrace();\n\t }\n\t\t\t\n\t\t\n\t}",
"private File writeToFile(Context context, final byte[] data, final String fileName,\n String fileExtension)\n throws IOException {\n final File file = File.createTempFile(fileName, fileExtension, context.getCacheDir());\n try {\n if (!file.exists()) {\n file.createNewFile();\n }\n final FileOutputStream fos = new FileOutputStream(file);\n fos.write(data);\n fos.close();\n } catch (final Exception throwable) {\n Timber.e(throwable, \"Failed to create file\");\n }\n return file;\n }",
"void createNewScriptFile(String scriptContent) {\n String fileName = prop.getProperty(\"FileName\");\n try {\n // Assume default encoding.\n FileWriter fileWriter = new FileWriter(fileName);\n // Always wrap FileWriter in BufferedWriter.\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n // Note that write() does not automatically append a newline character.\n bufferedWriter.write(scriptContent);\n // Always close files.\n bufferedWriter.close();\n } catch (IOException ex) {\n System.out.println(\"Error writing to file '\" + fileName + \"'\");\n }\n }",
"public void SerialWriteFile() {\r\n\r\n PrintWriter pwrite = null;\r\n File fileObject = new File(getName());\r\n QuizPlayer q = new QuizPlayer(getName(), getNickname(), getTotalScore());\r\n\r\n try {\r\n ObjectOutputStream outputStream =\r\n new ObjectOutputStream(new FileOutputStream(fileObject));\r\n\r\n outputStream.writeObject(q); //Writes the object to the serialized file.\r\n outputStream.close();\r\n\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Problem with file output.\");\r\n }\r\n\r\n }",
"@Override\n protected void createFile(String directoryName, String fileNamePrefix) {\n }"
] | [
"0.75484675",
"0.7213188",
"0.695648",
"0.6805288",
"0.6785",
"0.6772648",
"0.66626996",
"0.6599623",
"0.6582015",
"0.6512492",
"0.6498195",
"0.6489285",
"0.64661914",
"0.6465182",
"0.6451841",
"0.64377",
"0.64301825",
"0.6412958",
"0.64099056",
"0.63896024",
"0.6383755",
"0.6343674",
"0.6342823",
"0.63265574",
"0.63254327",
"0.6320515",
"0.6310831",
"0.6295921",
"0.62851036",
"0.62484735",
"0.6238366",
"0.62344635",
"0.620488",
"0.62011355",
"0.61706",
"0.6160567",
"0.6156206",
"0.6154768",
"0.61508965",
"0.6135833",
"0.61183774",
"0.6117073",
"0.6112557",
"0.6103659",
"0.60829526",
"0.6072305",
"0.6054686",
"0.6052214",
"0.60487807",
"0.6043212",
"0.60399175",
"0.603807",
"0.6021611",
"0.60210896",
"0.5997635",
"0.5996617",
"0.5996194",
"0.5992372",
"0.5990194",
"0.59861535",
"0.5983975",
"0.59777766",
"0.59712595",
"0.596565",
"0.59614694",
"0.5960552",
"0.5952027",
"0.5950153",
"0.59460896",
"0.5931043",
"0.59232837",
"0.5921088",
"0.59183",
"0.59159946",
"0.5915635",
"0.59143686",
"0.5911784",
"0.5909565",
"0.590762",
"0.5906257",
"0.58982795",
"0.589372",
"0.58934534",
"0.58929366",
"0.5891901",
"0.5884354",
"0.58837545",
"0.5874528",
"0.58690876",
"0.58650416",
"0.5858661",
"0.58546424",
"0.5854325",
"0.584807",
"0.58477116",
"0.5843795",
"0.5829499",
"0.58282435",
"0.58217347",
"0.5817044",
"0.5816886"
] | 0.0 | -1 |
if equal we have found one digit phase | public void letterCombinations(String digits,String current,String[] mappings,int index,List<String> result){
if(digits.length()==current.length()){
result.add(current);
return;
}
// if digit is "2" , mappings['2' - '0' ] will give me mappings[2] .i.e abc
String letters = mappings[digits.charAt(index)-'0'];
//for all letters in mappings[i] call recursively
// i.e. mappings[2] => "abc",call for a, then b and then c
for (int i=0;i<letters.length();i++){
// add to current character at index i
// increment index to simulate selection condition
letterCombinations(digits,current+letters.charAt(i),mappings,index+1,result);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static void cmp_with_reg(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(registers.get(passed.charAt(4)));\n\t\tS = val1>=val2?false:true;\n\t\tval2 = 256-val2;\n\t\tval2%=256;\n\t\tval1+=val2;\n\t\tCS = val1>255?true:false;\n\t\tString b = Integer.toBinaryString(val1);\n\t\tint ones=0;\n\t\tfor(int i=0;i<b.length();i++)\n\t\t\tif(b.charAt(i)=='1')\n\t\t\t\tones++;\n\t\tZ = ones==0?true:false;\n\t\tP = ones%2==0?true:false;\n\t}",
"public boolean ifStringContainsOneNumberMod36Equals1(String s) {\n\t\tint sta = 0;\n\t\twhile (sta < s.length()) {\n\t\t\tchar curCha = s.charAt(sta);\n\t\t\tif (!Character.isDigit(curCha)) {\n\t\t\t\tsta++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tStringBuilder cur = new StringBuilder();\n\t\t\twhile (Character.isDigit(curCha)) {\n\t\t\t\tcur.append(curCha);\n\t\t\t\tsta++;\n\t\t\t\tif (sta >= s.length()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcurCha = s.charAt(sta);\n\t\t\t}\n\t\t\tString tmpString = cur.toString();\n\t\t\tint[] array = new int[tmpString.length() - 1];\n\t\t\tint len = 3;\n\t\t\tfor (int i = 1; i < tmpString.length(); i++) {\n\t\t\t\tarray[i - 1] = Integer.parseInt(tmpString.substring(i - 1, i + 1)) % 36;\n\t\t\t\tif (array[i - 1] == 1)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\twhile (len <= tmpString.length()) {\n\t\t\t\tfor (int i = 0; i <= tmpString.length() - len; i++) {\n\t\t\t\t\tarray[i] = array[i] * 10 + tmpString.charAt(i + len - 1) - '0';\n\t\t\t\t\tarray[i] %= 36;\n\t\t\t\t\tif (array[i] == 1) {\n\t\t\t\t\t\tSystem.out.println(tmpString.substring(i, i+len));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlen++;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public int eval_letter_parity(char s) {\n int r = 0;\n\n switch (s) {\n case '0':\n r = 0;\n break;\n case '1':\n r = 1;\n break;\n case '2':\n r = 1;\n break;\n case '3':\n r = 0;\n break;\n case '4':\n r = 1;\n break;\n case '5':\n r = 0;\n break;\n case '6':\n r = 0;\n break;\n case '7':\n r = 1;\n break;\n case '8':\n r = 1;\n break;\n case '9':\n r = 0;\n break;\n case 'A':\n r = 0;\n break;\n case 'B':\n r = 1;\n break;\n case 'C':\n r = 0;\n break;\n case 'D':\n r = 1;\n break;\n case 'E':\n r = 1;\n break;\n case 'F':\n r = 0;\n break;\n }\n return r;\n }",
"private boolean inSameSuit() {\n for (int i = 0; i < cards.length-2; i++) {\n if (cards[i].charAt(1) != cards[i + 1].charAt(1)) {\n return false;\n }\n }\n \n return true;\n }",
"static void jump_when_parity(String passed){\n\t\tif(P)\n\t\t\tcomplete_jump_req(passed.substring(4));\n\t}",
"public static void main(String[] args) {\n int a,b=0,c=0;\r\n Scanner scan = new Scanner (System.in);\r\n a = scan.nextInt();\r\n int d=a;\r\n\t while(a!=0){\r\n\t\t b = a%10;\r\n\t\t c=c*10+b;\r\n\t\t a=a/10;\r\n }\r\n\t if(c==d){\r\n\t\t System.out.println(\"palidrome\");\r\n\t }\r\n\t else{\r\n\t\tSystem.out.println(\"no palidrome\"); \r\n\t }\r\n\t}",
"public char FirstAppearingOnce_1(){\n char[] ch = sb.toString().toCharArray();\n for(char i : ch){\n if(chs[i] == 1){\n return i;\n }\n }\n return '#';\n }",
"static void cpi_with_acc(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(passed.substring(4));\n\t\tS = val1>=val2?false:true;\n\t\tval2 = 256-val2;\n\t\tval2%=256;\n\t\tval1+=val2;\n\t\tCS = val1>255?true:false;\n\t\tString b = Integer.toBinaryString(val1);\n\t\tint ones=0;\n\t\tfor(int i=0;i<b.length();i++)\n\t\t\tif(b.charAt(i)=='1')\n\t\t\t\tones++;\n\t\tZ = ones==0?true:false;\n\t\tP = ones%2==0?true:false;\n\t}",
"public int step() {\n int lastBit = bitAt(0) ^ bitAt(currentIndex);\n char[] ch = lfsr1.toCharArray();\n for (int i = 0; i < lfsr1.length() - 2; i++) {\n ch[i] = ch[i + 1];\n }\n\n ch[lfsr1.length() - 2] = (char) (lastBit + '0');\n int temporary = lfsr1.length();\n lfsr1 = \"\";\n for (int i = 0; i < temporary; i++) {\n lfsr1 = lfsr1 + ch[i];\n }\n\n return lastBit;\n }",
"static String isValid(String s) {\n if(s.isEmpty())return \"YES\";\n int[] alphabet = new int[26];\n // char - 97 = arr location;\n for(int i = 0;i<s.length();i++){\n int location = (int)s.charAt(i) - 'a';\n alphabet[location] += 1;\n }\n for(Integer x: alphabet){\n System.out.println(x);\n }\n int i = 0;\n while(alphabet[i]==0){\n i++;\n }\n int standard = alphabet[i];\n boolean used = false;\n for(;i<26;i++){\n if(alphabet[i]!=0){\n if(Math.abs(alphabet[i]-standard)==1){\n if(used){\n System.out.println(\"equal 1\");\n return \"NO\";\n }else{\n used = true;\n }\n }else if(Math.abs(alphabet[i]-standard)>1){\n\n System.out.println(\"gtr then 1\");\n return \"NO\";\n }\n }\n }\n return \"YES\";\n\n\n\n }",
"private int flushValue() {\n int flushValue = 0;\n if (inSameSuit()) {\n flushValue += 4;\n \n char firstCardSuit = cards[0].charAt(1);\n char StartCardSuit = cards[cards.length-1].charAt(1);\n \n if(firstCardSuit==StartCardSuit){\n flushValue +=1;\n }\n } \n return flushValue;\n }",
"private static int calculateParity(long hash) {\n int parity = 0;\n for (int i = 0; i < 64; i += 2) {\n parity += (hash & 0x3);\n hash >>= 2;\n }\n return (parity & 0x3);\n }",
"static void cmp_with_mem(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(memory.get(memory_address_hl()));\n\t\tS = val1>=val2?false:true;\n\t\tval2 = 256-val2;\n\t\tval2%=256;\n\t\tval1+=val2;\n\t\tCS = val1>255?true:false;\n\t\tString b = Integer.toBinaryString(val1);\n\t\tint ones=0;\n\t\tfor(int i=0;i<b.length();i++)\n\t\t\tif(b.charAt(i)=='1')\n\t\t\t\tones++;\n\t\tZ = ones==0?true:false;\n\t\tP = ones%2==0?true:false;\n\t}",
"boolean hasNum2();",
"static int check(int x, int a, int b) \n\t{ \n\t\t// sum of digits is 0 \n\t\tif (x == 0) \n\t\t{ \n\t\t\treturn 0; \n\t\t} \n\n\t\twhile (x > 0) \n\t\t{ \n\n\t\t\t// if any of digits in sum is \n\t\t\t// other than a and b \n\t\t\tif (x % 10 != a & x % 10 != b) \n\t\t\t{ \n\t\t\t\treturn 0; \n\t\t\t} \n\n\t\t\tx /= 10; \n\t\t} \n\n\t\treturn 1; \n\t}",
"public boolean check_key_for_parity(char[] key) {\n boolean parity_check = false;\n int i;\n int L = key.length / 2;\n for (i = 0; i < L; i++) {\n int j = eval_letter_parity(key[2 * i]);\n int k = eval_letter_parity(key[2 * i + 1]);\n // int m = 2*i+1;\n // JOptionPane.showMessageDialog(null, \"key[\" + 2*i + \"]=\" +j+ \" and \" + \"key[\" + m +\n // \"]=\" + k );\n if (j == k) {\n // i=i+1;\n // JOptionPane.showMessageDialog(null, \"INVALID DES-Key! Even parity in byte nr. \" +\n // i );\n // break;\n parity_check = false;\n break;\n }\n\n if (i == L - 1) {\n // JOptionPane.showMessageDialog(null, \"VALID DES-Key !\" );\n parity_check = true;\n }\n }// end of for-loop\n return parity_check;\n }",
"static void jump_when_parity_not(String passed){\n\t\tif(!P)\n\t\t\tcomplete_jump_req(passed.substring(4));\n\t}",
"private void check1(){\n \n\t\tif (firstDigit != 4){\n valid = false;\n errorCode = 1;\n }\n\t}",
"public static boolean isPalindrom(int a) {\n String bitStr = toBinary(a);\n //System.out.println(bitStr);\n System.out.println(Integer.toBinaryString(a));\n if(bitStr.length() < 2) {\n return true;\n }\n int i = 0;\n int j = bitStr.length() - 1;\n while(i < j) {\n if(bitStr.charAt(i) != bitStr.charAt(j)) {\n return false;\n }\n i++;\n j--;\n }\n return true;\n }",
"boolean hasNum1();",
"while (!found && index < valid.length)\n {\n if (valid[index] == number)\n found = true;\n else\n index++;\n }",
"private boolean isFirstMove(int numberGeneratedSoFarLength) {\n\t\treturn numberGeneratedSoFarLength == 1;\n\t}",
"public short computeParityOfWord(long word) {\n short first = (short)word;\n short second = (short)(word >>= 16);\n short third = (short)(word >>= 16);\n short fourth = (short)(word >> 16);\n\n return (short)((parityMap.get(first) +\n parityMap.get(second) +\n parityMap.get(third) +\n parityMap.get(fourth)) %\n 2);\n }",
"public static boolean checkdigitsequal() {\n int count2=0;\n for (a = 0; a < 10; a++) {\n if (digits[a] == 0)\n {\n count2++;\n if(count2==10)return true;\n }\n else return false;\n }\n return false;\n }",
"static void return_when_parity(String passed){\n\t\tif(P)\n\t\t\tcomplete_return_requirements();\n\t}",
"private static byte parityChar(byte abyte) {\n return pstep(pstep(pstep(abyte, 4), 2), 1);\n }",
"public boolean isSame(){\r\n\t\tHugeInt mod2 = new HugeInt(this.p);\r\n\t\tmod2.modByHugeInt(new HugeInt(\"2\"));\r\n\t\tmod2.printHugeInt();\r\n\t\t\r\n\t\tHugeInt mod3 = new HugeInt(this.p);\r\n\t\tmod3.modByHugeInt(new HugeInt(\"3\"));\r\n\t\t\r\n\t\tif(this.p.compareHugeInts(this.p, new HugeInt(\"1\")) != -1)\r\n\t\t\tSystem.out.println(\"less than or equal to 1\");\r\n\t\telse if(this.p.compareHugeInts(this.p, new HugeInt(\"3\")) != -1)\r\n\t\t\tSystem.out.println(\"greater than 1 but less than 3\");\r\n\t\telse if(mod2.areAllZeros() || mod3.areAllZeros())\r\n\t\t\tSystem.out.println(\"mod by 2 or 3\");\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"static void jump_when_carry_not(String passed){\n\t\tif(!CS)\n\t\t\tcomplete_jump_req(passed.substring(4));\n\t}",
"public boolean checkNumberContinuation(String password) {\n for (int i = 0; i < password.length(); i++) {\n if (String.valueOf(password.charAt(i)).matches(\"[0-9]\")) { //next time: Character.isDigit(passtword.charAt(i))\n if ((password.charAt(i) + 1 == password.charAt(i + 1))\n && (password.charAt(i) + 2 == password.charAt(i + 2))) {\n return false;\n }\n }\n }\n return true;\n }",
"public int pid_0101(String str) \n {\n \n int num_of_TC; \n char ON_OFF; \n String first_byte;\n first_byte=new String(str.substring(0,1));\n MathLib operations= new MathLib(); \n ON_OFF=operations.HexToBin(first_byte).charAt(0);//Bit 0\n if (ON_OFF=='1')//Then the lamp is ON\n {\n double d = Double.valueOf(operations.calculatorXF(str,\"AA\",\"A-128\"));\n num_of_TC= (int)d;\n if (num_of_TC<0) num_of_TC=0;\n }\n else \n num_of_TC=0; \n \n return num_of_TC;\n }",
"static void jump_when_carry(String passed){\n\t\tif(CS)\n\t\t\tcomplete_jump_req(passed.substring(3));\n\t}",
"static void call_when_parity(String passed){\n\t\tif(P)\n\t\t\tcomplete_call_req(passed.substring(4));\n\t}",
"public static void main(String[] args) {\n\t\t int num=101;\n\t\t int r=0;\n\t\t int rev=0;\n\t\t int temp=num;\n\t\t while(num>0){\n\t\t r=num%10;\n\t\t rev=(rev*10)+r;\n\t\t num=num/10;\n\t\t System.out.println(rev);\n\t\t //System.out.println(num);\n\t\t }\n\t\t if(temp==rev) System.out.println(\"Palindrome\");\n\t\t else System.out.println(\"Not a Palindrome\");\n\t\t }",
"static String isValid(String s) {\r\n\r\n\t\tHashMap<Character, Integer> map = new HashMap();\r\n\t\tHashMap<Integer, Integer> vMap = new HashMap();\r\n\t\tfor (int i = 0; i < s.length(); i++) {\r\n\r\n\t\t\tif (map.containsKey(s.charAt(i))) {\r\n\t\t\t\tmap.put(s.charAt(i), map.get(s.charAt(i)) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tmap.put(s.charAt(i), 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(map);\r\n\t\tfor (int v : map.values()) {\r\n\t\t\tif (vMap.containsKey(v)) {\r\n\t\t\t\tvMap.put(v, vMap.get(v) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tvMap.put(v, 1);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tSystem.out.println(vMap);\r\n\r\n\t\tif (vMap.size() == 1) {\r\n\t\t\treturn \"YES\";\r\n\t\t} else if (vMap.size() == 2) {\r\n\t\t\tint ar[] = new int[2];\r\n\t\t\tint ark[] = new int[2];\r\n\t\t\tint j = 0;\r\n\t\t\tfor (int a : vMap.keySet()) {\r\n\t\t\t\tar[j] = vMap.get(a);\r\n\t\t\t\tark[j] = a;\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\r\n\t\t\tif ((ar[1] == 1 || ar[0] == 1) && (Math.abs(ark[1] - ark[0]) == 1))\r\n\t\t\t\treturn \"YES\";\r\n\t\t\telse if ((!(Math.abs(ark[1] - ark[0]) == 1))\r\n\t\t\t\t\t&& ((ark[0] == 1 && ar[0] == 1) || (ark[1] == 1 && ar[1] == 1)))\r\n\t\t\t\treturn \"YES\";\r\n\t\t\telse\r\n\t\t\t\treturn \"NO\";\r\n\r\n\t\t} else {\r\n\t\t\treturn \"NO\";\r\n\t\t}\r\n\r\n\t}",
"@Test\n public void testComp1()\n {\n System.out.println(\"comp\");\n String compString = \"A+1\";\n assertEquals(\"0110111\", N2TCode.comp(compString));\n }",
"static boolean possibility(HashMap<Integer,\n Integer> m,\n int length, String s)\n{\n // counts the occurrence of number\n // which is odd\n int countodd = 0;\n \n for (int i = 0; i < length; i++)\n {\n // if occurrence is odd\n if (m.get(s.charAt(i) - '0') % 2 == 1)\n countodd++;\n \n // if number exceeds 1\n if (countodd > 1)\n return false;\n }\n \n return true;\n}",
"private static int zzaz(java.lang.String r5) {\n /*\n int r0 = r5.hashCode()\n r1 = 0\n r2 = 3\n r3 = 2\n r4 = 1\n switch(r0) {\n case -1095064472: goto L_0x002a;\n case 187078296: goto L_0x0020;\n case 1504578661: goto L_0x0016;\n case 1505942594: goto L_0x000c;\n default: goto L_0x000b;\n }\n L_0x000b:\n goto L_0x0034\n L_0x000c:\n java.lang.String r0 = \"audio/vnd.dts.hd\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 3\n goto L_0x0035\n L_0x0016:\n java.lang.String r0 = \"audio/eac3\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 1\n goto L_0x0035\n L_0x0020:\n java.lang.String r0 = \"audio/ac3\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 0\n goto L_0x0035\n L_0x002a:\n java.lang.String r0 = \"audio/vnd.dts\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 2\n goto L_0x0035\n L_0x0034:\n r5 = -1\n L_0x0035:\n if (r5 == 0) goto L_0x0045\n if (r5 == r4) goto L_0x0043\n if (r5 == r3) goto L_0x0041\n if (r5 == r2) goto L_0x003e\n return r1\n L_0x003e:\n r5 = 8\n return r5\n L_0x0041:\n r5 = 7\n return r5\n L_0x0043:\n r5 = 6\n return r5\n L_0x0045:\n r5 = 5\n return r5\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.zzio.zzaz(java.lang.String):int\");\n }",
"public char FirstAppearingOnce()\n {\n for(int i = 0;i < arr.length;i++) {\n if(arr[i] == 1) {\n return (char)i;\n }\n }\n return '#';\n }",
"static void return_not_parity(String passed){\n\t\tif(!P)\n\t\t\tcomplete_return_requirements();\n\t}",
"int main()\n\n{\n\n int n,t,e,o;\n\n cin>>n;\n\n while(n>0)\n\n {\n\n t=n%10;\n\n if(t%2==0)\n\n {\n\n e=e+t;\n\n }\n\n else\n\n {\n\n o=o+t;\n\n }\n\n n=n/10;\n\n }\n\n if(e==o)\n\n {\n\n cout<<\"Yes\";\n\n }\n\n else\n\n {\n\n cout<<\"No\";\n\n }\n\n \n\n}",
"public static String getCheckNumber(String paramString){\n int i =paramString.substring(0, 1).getBytes()[0];\n for(int j=1;;j++){\n if(j>=paramString.length())\n return intToHex(Integer.valueOf(i));\n i=(byte)(i^paramString.substring(j, j+1).getBytes()[0]);\n\n }\n }",
"public static boolean isArm(int n){\r\n int m=n;// new variable for n as we divide by 10 it reduce given number by 1 digit( last digit)\r\n double c=0;\r\n int temp=m ;\r\n \r\n int mDigitCounter=digitCounter(n); \r\n \r\n while(m>0){\r\n int a=m%10;\r\n m=m/10;\r\n double mCube=cube(a,mDigitCounter);\r\n\r\n \r\n c=c+(mCube);\r\n \r\n }\r\n \r\n if (temp==c){\r\n return true;\r\n\r\n }\r\n\r\n else\r\n return false;\r\n\r\n }",
"public static void main(String[] args) {\r\n\r\n\t\tint n=439;\r\n\r\n\t\tint count = 1;\r\n\t\tint binary[] = new int[32];\r\n\t\tint i = 0;\r\n\t\twhile (n > 0) {\r\n\t\t\tbinary[i] = n % 2;\r\n\t\t\tn = n / 2;\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\tfor (int j = i - 1; j >= 0; j--) {\r\n\r\n\t\t\tString str = String.valueOf(i);\r\n\t\t\t\r\n\t\tString ar[]=str.split(\"0\");\r\n\t\t\t\r\n\t\tif(ar.length>1)\r\n\t\t{\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t/*\t\r\n\t\t\tif (binary[j] == 1 && binary[j + 1] == 1) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.print(binary[j]);\r\n*/\r\n\t\t}\r\n\t\tSystem.out.print(count);\r\n\t\t/*scanner.close();*/\r\n\t}",
"static int checkdigit(String num1, String num2)\n {\n for (int i=0;i<num1.length();i++)\n {\n char c1=num1.charAt(i);\n if((num1.substring(0,i).indexOf(c1))!=-1)//To check if a digit repeats itself in the substring \n continue;\n if(num2.indexOf(c1)==-1)//To check the presence of the digit in the factors\n return 0;\n \n int f1=0;int f2 =0;\n \n for(int k=0;k<num1.length();k++)//To find how many times c1 occurs in num1\n {\n if(c1==num1.charAt(k))\n f1=f1+1;\n }\n for(int p=0;p<num2.length();p++)//To find how many times c1 occurs in num2\n {\n if(c1==num2.charAt(p))\n f2=f2+1;\n }\n if(f1!=f2)//If c1 occurs the same number of times in num1 and num2\n {\n return 0;\n }\n \n }\n return 1;\n \n }",
"public int step() {\n ArrayList<Integer> copy = new ArrayList<Integer>();\n for (int i = 1; i < register.size(); i++) { \n copy.add(register.get(i));\n }\n int tapNum = register.get(register.size()-tap-1);\n int begin = register.get(0);\n if (tapNum == 1 ^ begin == 1) {\n copy.add(1);\n }\n else {\n copy.add(0);\n }\n register.clear();\n register.addAll(copy);\n return register.get(register.size()-1);\n }",
"public int actualHashForEqual() {\n\treturn getCategory().hashForEqual() + 1;\n/*\nudanax-top.st:15776:SequenceSpace methodsFor: 'testing'!\n{UInt32} actualHashForEqual\n\t\"is equal to any basic space on the same category of positions\"\n\t^self getCategory hashForEqual + 1!\n*/\n}",
"public boolean checkIfPermutationPalindrome(String str) {\n\n Hashtable<Character, Integer> table = generateTable(str);\n\n int oneOdd = 0;\n boolean flag;\n for(char ch : table.keySet()) {\n if(table.get(ch)%2 == 1) {\n oneOdd++;\n }\n }\n if(oneOdd <= 1) {\n flag = true;\n }\n else {\n flag = false;\n }\n if(str.length() == 0) {\n flag = false;\n }\n System.out.println(flag);\n return flag;\n }",
"public boolean findPalin(int a) {\n\t\tif (a < 11)\n\t\t\treturn false;\n\n\t\tint divL = 10;\n\t\t// one pass to find max 10\n\t\twhile ((a / divL) > 0) {\n\t\t\tdivL = divL * 10;\n\t\t}\n\t\tdivL = divL / 10;\n\n\t\tint divR = 10;\n\n\t\tint l = 0;\n\t\tint r = 0;\n\n\t\t// 787\n\t\t// second pass to find palin\n\t\twhile (a > 0 && divL > 0) {\n\n\t\t\tl = a / divL;\n\t\t\tr = a % divR;\n\t\t\tSystem.out.println(l + \"::\" + r);\n\t\t\tif (l == r) {\n\t\t\t\ta = a - (l * divL);\n\t\t\t\ta = a - (r * divR);\n\t\t\t\t// a = a /divR;\n\t\t\t\tdivL = divL / 100;\n\n\t\t\t\tcontinue;\n\n\t\t\t} else {\n\t\t\t\treturn false;\n\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\n\t}",
"private boolean checkDigit(String code, int length) {\n int len = length - 1;\n int[] digits = new int[len];\n int digitSum = 0;\n int lastDigit;\n\n if (length == 13) {\n lastDigit = Integer.parseInt(String.valueOf(code.charAt(len)));\n for (int i = 0; i < len; i++) {\n int digit = Integer.parseInt(String.valueOf(code.charAt(i)));\n\n if (i % 2 == 0) {\n digits[i] = digit;\n } else {\n digits[i] = digit * 3;\n }\n }\n\n for (int i = 0; i < digits.length; i++) {\n digitSum = digitSum + digits[i];\n }\n\n if (10 - (digitSum % 10) == lastDigit) {\n return true;\n } else if ((digitSum % 10) == 0 && lastDigit == 0) {\n return true;\n } else {\n return false;\n }\n\n } else if (length == 10) {\n if (String.valueOf(code.charAt(len)).equals(\"X\") ||\n String.valueOf(code.charAt(len)).equals(\"x\")) {\n lastDigit = 10;\n } else {\n lastDigit = Integer.parseInt(String.valueOf(code.charAt(len)));\n }\n\n int weight = 11;\n for (int i = 0; i < len; i++) {\n int digit = Integer.parseInt(String.valueOf(code.charAt(i)));\n weight--;\n digits[i] = digit * weight;\n }\n\n for (int i = 0; i < digits.length; i++) {\n digitSum = digitSum + digits[i];\n }\n\n if (11 - (digitSum % 11) == lastDigit) {\n return true;\n } else {\n return false;\n }\n\n } else {\n return false;\n }\n }",
"public boolean mo879k() {\n return (this.f631z & 2) == 2;\n }",
"private int firstB(String fa)\n{\n Calendar cal=new GregorianCalendar();\n int y1=(cal.get(Calendar.YEAR)%2000)/10;\n int y2=(cal.get(Calendar.YEAR)%2000)%10;\n int flag1=0,flag2=0,flag3=0;\n String temp1=\"\"+fa.charAt(0);\n String temp2=\"\"+fa.charAt(1);\n String temp3=\"\"+fa.charAt(2);\n if(temp1.equalsIgnoreCase(String.valueOf(y1)))\n {\n flag1=1;\n }\n if(temp2.equalsIgnoreCase(\"F\") || temp2.equalsIgnoreCase(\"U\")|| temp2.equalsIgnoreCase(\"K\"))\n {\n flag2=1;\n }\n if(temp3.equalsIgnoreCase(\"\"+y2))\n {\n flag3=1;\n }\n if(flag1+flag2+flag3==3){\n return 1;\n }\n else{\n return 0;\n }\n \n}",
"@Test\n public void testComp2()\n {\n System.out.println(\"comp\");\n String compString = \"D+M\";\n assertEquals(\"1000010\", N2TCode.comp(compString));\n }",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n boolean isSymmetric = true;\n String s = input.nextLine();\n for (int i = 0; i < s.length() / 2; i++) {\n if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {\n isSymmetric = false;\n }\n }\n System.out.println(isSymmetric ? 1 : 37);\n }",
"boolean hasNum();",
"boolean hasNum();",
"boolean hasNum();",
"public static void main(String[] args) {\n\t\t\n\t\tString number=\"48982\";\n\t\t\n\t\tString number1=\"\";\n\t\t\n\t\tfor(int i=number.length()-1;i>=0;i--)\n\t\t{\n\t\t\tnumber1=number1+number.charAt(i);\n\t\t}\n\t\t\n\t\tif(number.equalsIgnoreCase(number1))\n\t\t{\n\t\t\tSystem.out.println(\"yes\");\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"No\");\n\n\t}",
"public static void main(String[] args) {\n\t\tint a=33, sum=0;\r\n\t\tint temp=a;\r\n\t\tint r;\r\n\t while(a>0)\t{\r\n\t \tr=a%10;\r\n\t sum= (sum*10)+ r;\r\n\t\ta=a/10;\r\n\t }\r\n\t\tif(temp==sum) {\r\n\t\tSystem.out.println(sum+ \"the given number is palindrome \");\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\tSystem.out.println(sum + \"not a palindrome\");\r\n\t\t}}",
"public static boolean palindromEligible(String str) {\n \n Map<Character, Integer> parityMap = new HashMap<>();\n \n for (char c : str.toCharArray()) {\n if (parityMap.containsKey(c)) {\n parityMap.put(c, (parityMap.get(c) + 1) % 2);\n } else {\n parityMap.put(c, 1);\n }\n }\n \n \n // count 1s\n int count = 0;\n for (char c : parityMap.keySet()) {\n if (parityMap.get(c) == 1) {\n count ++;\n }\n }\n \n if (count > 1) {\n return false;\n }\n return true;\n }",
"int main()\n{\n int a,t,sum1=0,sum2=0;\n cin>>a;\n while(a>0)\n {\n t=a%10;\n if(t%2!=0)\n {\n sum1=sum1+t;\n }\n else\n {\n sum2=sum2+t;\n }\n a=a/10;\n }\n (sum1==sum2)?cout<<\"Yes\":cout<<\"No\";\n return 0;\n}",
"void solve() {\n num = new ArrayList<>();\n num.add(BigInteger.valueOf(4));\n for (int len = 2; len <= 100; len++)\n generate(\"4\", 1, len, false);\n Collections.sort(num);\n for (int tc = ii(); tc > 0; tc--) {\n long x = il();\n BigInteger X = BigInteger.valueOf(x);\n for (int i = 0; i < num.size(); i++) {\n if (num.get(i).mod(X).equals(BigInteger.ZERO)) {\n String z = num.get(i).toString();\n int end = z.lastIndexOf('4');\n int len = z.length();\n int a = 2 * (end+1);\n int b = len - end;\n out.println(a + b);\n break;\n }\n }\n }\n }",
"public static void main(String[] args) {\nint num=4550,temp,r,sum=0;\ntemp=num;\nwhile(num>0) {\n\tr=num%10;\n\tsum=(sum*10)+r;\n\tnum=num/10;\n\t\n}\n\tif(temp==sum) {\n\t\tSystem.out.println(\"number is palindrome\");\n\t}\n\telse {\n\t\tSystem.out.println(\"number is not palindrome\");\n\t}\n\t}",
"public boolean isEquals() {\n long len = -1L;\n\n //1. check the lengths of the words\n for(S left : slp.getAxioms()) {\n if(len == -1L) {\n len = slp.length(left);\n }\n else {\n if(len != slp.length(left)) {\n return false;\n }\n }\n }\n\n // all words are the empty word\n if(len == 0) {\n return true;\n }\n\n // 2. the length are all equals and not zero => execute the recompression\n execute();\n\n S otherSymbol = null;\n boolean first = true;\n\n // 3. chech now if for all axioms X : |val(X)| = 1 and all val(X) are equals.\n for(S left : slp.getAxioms()) {\n if(first) {\n slp.length(left, true);\n first = false;\n }\n\n if(slp.length(left) != 1) {\n return false;\n }\n else {\n S symbol = slp.get(left, 1);\n if(otherSymbol == null) {\n otherSymbol = symbol;\n }\n\n if(!symbol.equals(otherSymbol)) {\n return false;\n }\n }\n }\n\n return true;\n }",
"private int run() {\r\n int[] num = new int[13];\r\n boolean IsRun = false;\r\n int count = 0, index=0, combination=1;\r\n for (String aCard : Card) {\r\n switch (aCard.substring(0, 1)) {\r\n case \"A\":\r\n num[0]++;\r\n continue;\r\n case \"2\":\r\n num[1]++;\r\n continue;\r\n case \"3\":\r\n num[2]++;\r\n continue;\r\n case \"4\":\r\n num[3]++;\r\n continue;\r\n case \"5\":\r\n num[4]++;\r\n continue;\r\n case \"6\":\r\n num[5]++;\r\n continue;\r\n case \"7\":\r\n num[6]++;\r\n continue;\r\n case \"8\":\r\n num[7]++;\r\n continue;\r\n case \"9\":\r\n num[8]++;\r\n continue;\r\n case \"T\":\r\n num[9]++;\r\n continue;\r\n case \"J\":\r\n num[10]++;\r\n continue;\r\n case \"Q\":\r\n num[11]++;\r\n continue;\r\n case \"K\":\r\n num[12]++;\r\n }\r\n }\r\n\r\n for (int i = 1; i < 14; i++) {\r\n if (num[i-1]!=0){\r\n count++;\r\n index=i-1;\r\n }\r\n if (count>=3){\r\n IsRun=true;\r\n }\r\n if (i<13) {\r\n if (num[i] == 0 && IsRun) { //if there is a run already, break the recursion if the next num doesn't exist.\r\n break;\r\n }\r\n if (num[i] == 0 && !IsRun) {\r\n count = 0;\r\n index = 0;\r\n }\r\n }\r\n }\r\n\r\n if (IsRun){\r\n for (int i = index-count+1; i < index+1; i++) {\r\n combination*=num[i];\r\n }\r\n return combination*count;\r\n }\r\n return 0;\r\n }",
"public void testGetOnesDigit() {\n\t\tNumberConverter test5 = new NumberConverter(295);\n\t\tNumberConverter test9 = new NumberConverter(109);\n\t\tNumberConverter test11 = new NumberConverter(311);\n\t\tNumberConverter test0 = new NumberConverter(310);\n\t\tNumberConverter test00 = new NumberConverter(2);\n\t\tassertEquals(\"Should have returned last digit\", test5.getNthDigit(1), 5);\n\t\tassertEquals(\"Should have returned last digit\", test9.getNthDigit(1), 9);\n\t\tassertEquals(\"Should have returned last digit\", test11.getNthDigit(1),\n\t\t\t\t1);\n\t\tassertEquals(\"Should have returned last digit\", test0.getNthDigit(1), 0);\n\t\tassertEquals(\"Should have returned last digit\", test00.getNthDigit(1),\n\t\t\t\t2);\n\t}",
"public static void main(String[] args) {\nint r,sum=0,t;\r\nint n=12121; \r\nt=n;\r\nwhile(n>0) {\r\n\tr=n%10;\r\n\tsum=(sum*10)+r;\r\n\tn=n/10; \t\r\n}\r\nif(t==sum) \r\n\t System.out.println(\"palindrome number \"); \r\n\t else \r\n\t System.out.println(\"not palindrome\"); \r\n\t}",
"void circulardecode()\n{\nfor(i=0;i<s.length();i++)\n{\nc=s.charAt(i);\nk=(int)c;\nif(k==90)\nk1=65;\nelse\nif(k==122)\nk1=97;\nelse\nk1=k+1;\nc1=caseconverter(k,k1);\nSystem.out.print(c1);\n}\n}",
"public int fullHouse() {\n\n for (int i = 0; i < this.allCards.length - 4; i++) {//was 3\n int thisValue = this.allCards[i].value;\n if (thisValue == this.allCards[i + 1].value && thisValue == this.allCards[i + 2].value && this.allCards[i + 3].value == this.allCards[i + 4].value) {\n return thisValue;\n }\n if (thisValue == this.allCards[i + 1].value && this.allCards[i + 2].value == this.allCards[i + 3].value && this.allCards[i + 3].value == this.allCards[i + 4].value) {\n return this.allCards[i + 2].value;\n }\n }\n return -1;\n }",
"public static boolean isArmStrongNumber(int num){\n\n String number = String.valueOf(num); // converting int to String (String.valueOf)\n int multiplier = number.length(); // find the length; if length is 3 digits\n int sum =0;\n\n for(int i=0; i<multiplier; i++){ // loop the original number\n int digit = Integer.parseInt(\"\" +number.charAt(i));\n sum += Math.pow(digit,multiplier);\n }\n return sum == num;\n\n\n\n }",
"public static void main(String args[]){\n\n //even number of everything\n //odd number of 1 thing MAX\n\n //sort string\n //check subsequent chars to count their numbers until length -1\n //break if 2 odd number chars\n System.out.println(isPalindromePermutation(\"22334455asdfdsa66\"));\n\n\n }",
"static String isValid(String s){\n // Complete this function\n int[] charArray = new int[26];\n for(int i=0;i<26;i++){\n charArray[i] = 0;\n }\n for(int i=0;i<s.length();i++){\n int index = s.charAt(i) - 'a';\n charArray[index]++;\n }\n boolean oneDelete = false;\n //int prevValue = charArray[0];\n //System.out.println(\"a\" + \": \" + charArray[0]);\n /*for(int i=1;i<26;i++){\n System.out.println((char) (i+'a') + \": \" + charArray[i] + \" \" + \"prevValue\" + \": \" + prevValue);\n \n if(charArray[i] !=0 && prevValue!= 0 && charArray[i] != prevValue){\n if(oneDelete){\n return \"NO\";\n }else{\n if(Math.abs(charArray[i] - prevValue) != 1){\n return \"NO\";\n }else{\n oneDelete = true;\n }\n }\n }\n if(charArray[i] !=0){\n prevValue = charArray[i]; \n }\n }*/\n HashMap<Integer,Integer> frequencyCount = new HashMap<>();\n for(int i=0;i<26;i++){\n if(charArray[i] !=0){\n if(!frequencyCount.containsKey(charArray[i])){\n frequencyCount.put(charArray[i],1);\n }else{\n int count =frequencyCount.get(charArray[i]);\n frequencyCount.put(charArray[i],count+1);\n }\n }\n }\n \n if(frequencyCount.size() > 2){\n return \"NO\";\n }else if(frequencyCount.size() == 2){\n if(frequencyCount.containsKey(1) && frequencyCount.get(1) == 1){\n return \"YES\";\n }\n if(isConsecutiveFrequencies(frequencyCount)){\n return \"YES\";\n }else{\n return \"NO\";\n }\n }else{\n return \"YES\"; \n }\n \n \n }",
"public static void main (String[] args){\n Scanner sc = new Scanner(System.in);\n int num = sc.nextInt();\n int temp = num;\n int c = 0;\n \n while (num != 0)\n {\n int a = num%10;\n num = num/10;\n c = c + (a*a*a);\n \n }\n \n \n \n if(c == temp)\n System.out.println(\"Armstrong Number\");\n else\n System.out.println(\"Not a Armstrong Number\");\n \n\t}",
"String einfachesErsetzen(String s) {\n\t\tString newS = s.replace(\"2\", \"0\");\n\t\tif (newS == s) {\n\t\t\tSystem.out.println(\"gleich\");\n\t\t}\n\t\treturn newS;\n\t}",
"public static void main(String[] args) {\n\t\r\n\t\tint a=153;\r\n\t\tint temp=a;\r\n\t\t\r\n\t\tint c=0;\r\n\t\tint b=0;\r\n\t\twhile(a>0)\r\n\t\t{\r\n\t\t\tc=a%10;\r\n\t\tb=b+c*c*c;\r\n\t\ta=a/10;}\r\n\tif(temp==b)\r\n\t{\r\n\t\tSystem.out.println(\"given no is amstrong\");\r\n\t\t\t\r\n\t}\t\r\n\telse\r\n\t{\r\n\t\tSystem.out.println(\"given no is not an amstrong number\");\r\n\t}\r\n\r\n\t\r\n\r\n\r\n}",
"public static void main(String[] args) {\n\t\tint orgnum1=1634,orgnum;\r\n\t\tfloat res=0,rem=0;\r\n\t\torgnum=orgnum1;\r\n\t\r\n\t\twhile(orgnum!=0)\r\n\t\t{\r\n\t\trem=(orgnum%10);\t\r\n\t\tres+=(rem*rem*rem);\r\n\t\torgnum/=10;\r\n\t\t}\r\n\t\tSystem.out.println(\"res\"+ res + \" \"+ orgnum+\" n value\"+orgnum1);\r\n if(orgnum1==res)\r\n \tSystem.out.println(\"arms strong\");\r\n else\r\n \t System.out.println(\"not arms strong\");\r\n \t \r\n\t}",
"static String GetCheckDigitAndCheckCode(String input) {\n int sum = 0;\n for(int i = 0; i < input.length(); i++) {\n if(i%2 == 0 || i == 0) {\n\n sum += 3 * Character.getNumericValue(input.charAt(i));\n }else {\n sum += Character.getNumericValue(input.charAt(i));\n }\n }\n int subDigit = ((sum/10) + 1 ) * 10;\n int checkDigit = subDigit - sum;\n\n input = input + checkDigit;\n\n\n int digit1 = get9Digits(input.substring(0, 8));\n int digit2 = get9Digits(input.substring(9));\n\n // NOTE - Not able to understand what means by index of 2\n // digit numbers so here am just adding instead of multiplying the 2 9 digits.\n int result = digit1 + digit2 + 207;\n int remainder = result % 103;\n\n StringBuilder sb = new StringBuilder();\n sb.append(checkDigit);\n sb.append(',');\n sb.append(remainder);\n return sb.toString();\n }",
"@Test\n public void testKMP() {\n\n int[] next = getNextArr(modeStr);\n ////int[] next = getNext2(modeStr);\n ////int[] next = getNext(modeStr);\n log.info(JSON.toJSONString(next));\n\n final char[] charArr = mainStr.toCharArray();\n final char[] modeCharArr = modeStr.toCharArray();\n final int charLen = charArr.length;\n final int modeCharLen = modeCharArr.length;\n int match = 0;\n int compareCount = 0;\n for (int i = 0; i < charLen - modeCharLen +1; ) {\n int offset = 1;\n for (int j = 0, startIndex = i; j < modeCharLen; j++) {\n int indexToBeMoved = next[j];\n compareCount++;\n log.info(\"{}与{}比较\", modeCharArr[j], charArr[startIndex]);\n if (charArr[startIndex] == modeCharArr[j]) {\n match++;\n startIndex++;\n if (match == modeCharLen) {\n //计算最终串的初始下标\n int initIndex = (--startIndex) - (modeCharLen - 1);\n log.info(\"找到下标【\" + initIndex + \"】,值为【\" + charArr[initIndex] + \"】\");\n log.info(\"比较次数:{}\", compareCount);\n return;\n }\n } else if (indexToBeMoved == -1) {\n startIndex++;\n match = 0;\n break;\n } else if (indexToBeMoved >= 0) {\n //log.error(\"记录下标{}\",i+match);\n offset = (modeCharLen - indexToBeMoved - 1);\n offset = offset > (charLen - modeCharLen) ? 1 : offset;\n match = 0;\n break;\n }\n }\n i += offset;\n }\n }",
"private static boolean KawigiEdit_RunTest(int testNum, int[] p0, boolean hasAnswer, int p1) {\n System.out.print(\"Test \" + testNum + \": [\" + \"{\");\n for (int i = 0; p0.length > i; ++i) {\n if (i > 0) {\n System.out.print(\",\");\n }\n System.out.print(p0[i]);\n }\n System.out.print(\"}\");\n System.out.println(\"]\");\n EllysAndXor obj;\n int answer;\n obj = new EllysAndXor();\n long startTime = System.currentTimeMillis();\n answer = obj.getMax(p0);\n long endTime = System.currentTimeMillis();\n boolean res;\n res = true;\n System.out.println(\"Time: \" + (endTime - startTime) / 1000.0 + \" seconds\");\n if (hasAnswer) {\n System.out.println(\"Desired answer:\");\n System.out.println(\"\\t\" + p1);\n }\n System.out.println(\"Your answer:\");\n System.out.println(\"\\t\" + answer);\n if (hasAnswer) {\n res = answer == p1;\n }\n if (!res) {\n System.out.println(\"DOESN'T MATCH!!!!\");\n } else if ((endTime - startTime) / 1000.0 >= 2) {\n System.out.println(\"FAIL the timeout\");\n res = false;\n } else if (hasAnswer) {\n System.out.println(\"Match :-)\");\n } else {\n System.out.println(\"OK, but is it right?\");\n }\n System.out.println(\"\");\n return res;\n }",
"public char FirstAppearingOnce()\n {\n String s1 = sb.toString();\n for (int i = 0; i < s1.length(); i++){\n String s2 = s1.replace(String.valueOf(s1.charAt(i)),\"\");//用空代替第i位出现的所有字符\n //如果某个字符出现一次,则s1和s2的长度只差1,如果有多个字符,那么不差1\n if (s1.length()-s2.length() == 1) return s1.charAt(i);\n }\n return '#';\n }",
"static int beautifulBinaryString(String b) {\n int index = b.indexOf(\"010\", 0) ;\n int change = 0;\n while (index != -1) {\n change++;\n index = b.indexOf(\"010\", index + 3) ;\n }\n return change;\n }",
"boolean hasNumb();",
"int run(char t, boolean o) {\n return !o & ++total > bench ? t == 'e' ? notOks.add(total) ? t : d : ++ok\n : t == 's' & bench++ <= total ? ++s + ++ok\n : t == 'a' ? ++a + ++ok\n : t < 'c' & notOks.add(total) ? ++b + ++ok\n : t > 'b' && t <= 'd' ? ++d\n : s;\n }",
"@Override\n\tpublic boolean check(int[] digits) {\n\t\tif (digits.length <= 1 || digits == null) {\n\t\t\treturn false;\n\t\t}\n\t\tint total = 0;\n\t\tint check = digits[digits.length - 1]; // check digit\n\t\tboolean alternate = true;\n\n\t\tfor (int i = digits.length - 2; i >= 0; i--) {\n\n\t\t\t// double the value of every second digit\n\t\t\tif (alternate) {\n\t\t\t\tdigits[i] *= 2;\n\t\t\t}\n\n\t\t\tif (digits[i] > 9) {\n\t\t\t\tdigits[i] -= 9;\n\t\t\t}\n\n\t\t\talternate = !alternate;\n\t\t\ttotal += digits[i];\n\t\t}\n\n\t\ttotal += check; // add check digit to total\n\n\t\treturn total % 10 == 0;\n\t}",
"static void call_when_parity_not(String passed){\n\t\tif(!P)\n\t\t\tcomplete_call_req(passed.substring(4));\n\t}",
"@Test\n public void Keypad() {\n Assert.assertEquals(11, Computation.keypadTime(\"91566165\",\"639485712\"));\n Assert.assertEquals(1, Computation.keypadTime(\"5111\",\"752961348\"));\n }",
"public void calcS(){\n if (n.subtract(one).mod(new BigNumber(\"2\")).compareTo(zero)!=0){\n s=zero;\n return;\n }\n while(n.subtract(one).mod(pow(two,s)).compareTo(zero)!=0){\n //System.out.println(s);\n s=s.add(one);\n }\n s=s.subtract(one);\n }",
"private void check5(){\n \n if (errorCode == 0){\n \n int firstSum = 0;\n int lastSum = 0;\n String firstFour = number.substring(0,4);\n String lastFour = number.substring(8,12);\n \n for(int i = 0; i < firstFour.length();){\n firstSum += Integer.parseInt(firstFour.substring(i, ++i));\n }\n \n for(int i = 0; i < lastFour.length();){\n lastSum += Integer.parseInt(lastFour.substring(i, ++i));\n }\n \n if (!(firstSum == lastSum - 1)){\n valid = false;\n errorCode = 5;\n }\n }\n\t}",
"private boolean checkValue(){\n\t\tfor (int i = 0; i <binary.length();i++){\n\t\t\tif(Character.getNumericValue(binary.charAt(i))>'1' || binary.length()>32 || binary.length()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t%4 != 0){\n\t\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t\t\tpw.println(\"Invalid Input\");\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\t\t\n\t}",
"public boolean isContainSameSequence(String password) {\n\t\treturn password.toLowerCase().matches(\"^.*(.)\\\\1.*$\");\n\t}",
"private int pairValue() {\n int pValue = 0;\n \n for (int i = 0; i < combos.length; i++) {\n if (combos[i].length == 2 && combos[i][0].charAt(0) == combos[i][1].charAt(0)) {\n pValue += 2;\n }\n }\n \n return pValue;\n }",
"static boolean isBitPalindrome(int x) {\n\t\tint y = 0, count = 0;\n\n\t\t// count the # of effectively bits of x\n\t\tint t = x;\n\t\twhile (t != 0) {\n\t\t\tt >>= 1;\n\t\t\tcount++;\n\t\t}\n\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\t// left move y for the next bit\n\t\t\ty <<= 1;\n\t\t\t// the least significant bit of x is 1, then update y's.\n\t\t\tSystem.out.printf(\"x & 1 [%d]: %d y:%d\\n\", i, x & 1, y);\n\t\t\tif ((x & 1) > 0) { // remeber & operator should in parentheses\n\t\t\t\ty |= 1;\n\t\t\t}\n\t\t\t// decrease x, e.g. 11001 -> 1100\n\t\t\tx >>= 1;\n\n\t\t\t// Since x is keep decreasing and y is keep increasing, we can but\n\t\t\t// the loop early once x <= y\n\t\t\tif (x <= y)\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (count % 2 != 0)\n\t\t\ty >>= 1;\n\n\t\tSystem.out.println(x + \" \" + y);\n\t\treturn x == y;\n\t}",
"public static void main(String args[] ) throws Exception {\n Scanner in = new Scanner(System.in);\n \n String original = in.next();\n int n = original.length();\n long moda = 1000000007;\n long ones = 1;\n long sum=0; \n for (int s=original.length()-1; s>=0; s--) {\n sum = (sum + (s+1) * (original.charAt(s) - '0') * ones) %moda; \n ones = (ones * 10 + 1) % moda;\n \n }\n \n System.out.println(sum);\n \n }",
"private final void step1()\n\t { if (b[k] == 's')\n\t { if (ends(\"sses\")) k -= 2; else\n\t if (ends(\"ies\")) setto(\"i\"); else\n\t if (b[k-1] != 's') k--;\n\t }\n\t if (ends(\"eed\")) { if (m() > 0) k--; } else\n\t if ((ends(\"ed\") || ends(\"ing\")) && vowelinstem())\n\t { k = j;\n\t if (ends(\"at\")) setto(\"ate\"); else\n\t if (ends(\"bl\")) setto(\"ble\"); else\n\t if (ends(\"iz\")) setto(\"ize\"); else\n\t if (doublec(k))\n\t { k--;\n\t { int ch = b[k];\n\t if (ch == 'l' || ch == 's' || ch == 'z') k++;\n\t }\n\t }\n\t else if (m() == 1 && cvc(k)) setto(\"e\");\n\t }\n\t }",
"@Test\n public void calculationOnElevenDigitMsgIsCorrect() {\n final String msg = \"00110001110\";\n final int[] expectedMsg = {0,0,1,0, 1,0,1,1, 1,0,0,0, 1,1,1,0};\n\n // When\n int[] transformedMsg = HammingAlgorithm.calculate(msg);\n\n // Then\n assertThat(transformedMsg).isEqualTo(expectedMsg);\n }",
"private void checkParity( int section, int start, int end )\n {\n \tmCRC[ section ] = detectAndCorrect( start, end );\n }",
"public void phaseTwoCheck() {\r\n String guess = phaseTwoAnswer.toString();\r\n int length = guess.length();\r\n\r\n // check if valid word\r\n if (length >= 3) { // check if the length of the word is >= 3\r\n if (dictionary.contains(guess.toLowerCase())) { // check if the dictionary contains the word\r\n mSoundPool.play(mSoundCorrect, mVolume, mVolume, 1, 0, 1f); // chime when correct\r\n // set amount of points\r\n int bonus = 0;\r\n for (char c : guess.toCharArray()) {\r\n if (c == 'E' || c == 'A' || c == 'I' || c == 'O' || c == 'N' || c == 'R' || c == 'T' || c == 'L' || c == 'S') {\r\n pointsScore += 1; // bonus for x, y, or z in word\r\n } else if (c == 'D' || c == 'G') {\r\n pointsScore += 2;\r\n } else if (c == 'B' || c == 'C' || c == 'M' || c == 'P') {\r\n pointsScore += 3;\r\n } else if (c == 'F' || c == 'H' || c == 'V' || c == 'W' || c == 'Y') {\r\n pointsScore += 4;\r\n } else if (c == 'K') {\r\n pointsScore += 5;\r\n } else if (c == 'J' || c == 'X') {\r\n pointsScore += 8;\r\n } else {\r\n pointsScore += 10;\r\n }\r\n }\r\n if (length == 9 && phase == 1) bonus += length; // bonus for 9 letter word during phase 1\r\n pointsScore += (length + bonus) * 2; // calculate total score\r\n scoreBoard.setText(\"\"+pointsScore); // set scoreboard to total\r\n timer.cancel();\r\n timer.onFinish();\r\n }\r\n } else {\r\n mSoundPool.play(mSoundIncorrect, mVolume, mVolume, 1, 0, 1f); // quack when incorrect\r\n pointsScore -= 3; // penalize for submitting an incorrect word\r\n scoreBoard.setText(\"\"+pointsScore); // set scoreboard to total\r\n }\r\n }",
"public static void main (String[] args) {\nSystem.out.println(\"Privet\");\r\n int a=20;\r\n int b=8;\r\n int c=a+b;\r\n int test;\r\n String s = \"Deleni po mod \";\r\n// boolean check1, check2;\r\n test=a%b;\r\n System.out.print(s);\r\n System.out.println(test);\r\n System.out.println(c);\r\n double d=35.9;\r\n\t\t double f=c+d;\r\n\t\t double tes=f%c; \r\n\t\t String s2=\"Delenie f/c\";\r\n\t\t \r\n\t\t System.out.println(f);\r\n\t\t System.out.println(s2);\r\n\t\t System.out.println(tes);\r\n\t\t System.out.println(s+s2);// s и s2\r\n\t\t if (f==61.9) {System.out.println(\"Proverka ok\"); } // if \r\n\t\t else {System.out.println(\"proverka not\");}}",
"protected long bruteForce(long endingNumber) {\n StringBuffer buffer = new StringBuffer();\n for (int index = 1; index <= endingNumber; ++index) {\n buffer.append(index);\n }\n String digits = buffer.toString();\n int matches = 0, offset = 0;\n while ((offset = digits.indexOf('2', offset)) != -1) {\n matches++;\n offset++;\n }\n return matches;\n }",
"public boolean isStrobogrammatic(String num) {\n char input[] = num.toCharArray();\n int p1 = 0, p2 = num.length() - 1;//pointers\n while(p1 <= p2) {\n if(input[p1] == '6') {\n if(input[p2] != '9') return false;\n } else if (input[p1] == '9') {\n if(input[p2] != '6') return false;\n } else if (input[p1] == '1' || input[p1] == '8'||input[p1] == '0') {\n if (input[p2] != input[p1]) return false;\n } else {\n return false;\n }\n p1++;\n p2--;\n }\n return true;\n }",
"public static void main(String[] args) {\n\n\t\t Scanner sc = new Scanner(System.in);\n\t\t String numb = sc.nextLine();\n\t\t char[] numbArr = numb.toCharArray();\n\t\t int sum =0;\n\t\t for(int i =0 ; i < numbArr.length ; i++){\n\t\t sum += Math.pow(Character.getNumericValue(numbArr[i]),3);\n\t\t }\n\t\t \n\t\t if(sum == Integer.parseInt(numb)){\n\t\t System.out.println(true);\n\t\t }else{\n\t\t System.out.println(false);\n\t\t }\n\n\t\t }",
"public static void main (String[] args){\n Scanner joe= new Scanner(System.in);\n int n= joe.nextInt();\n int cd=0;\n int temp=n;\n int digit;\n int sum=0;\n while(n>0)\n {\n int prod=1;\n digit = n % 10;\n for(int i =1;i<=digit;i++)\n {\n prod = prod * i;\n }\n //System.out.println(prod);\n sum = sum+prod;\n n = n/10;\n\t }\n if(temp==sum)\n {\n System.out.println(\"Yes\");\n //System.out.println(sum);\n }\n else\n {\n System.out.println(\"No\");\n // System.out.println(sum);\n }\n }"
] | [
"0.59862953",
"0.58434063",
"0.5739371",
"0.5722019",
"0.563902",
"0.5584977",
"0.55588585",
"0.5543357",
"0.55209714",
"0.5516937",
"0.54999983",
"0.5492766",
"0.547734",
"0.5462244",
"0.5428287",
"0.5425261",
"0.54251176",
"0.5411872",
"0.54093295",
"0.53868145",
"0.5380977",
"0.5374969",
"0.5372793",
"0.5372725",
"0.53577644",
"0.5343988",
"0.5340874",
"0.533345",
"0.53283316",
"0.5310608",
"0.5307347",
"0.52917564",
"0.52835715",
"0.5283212",
"0.5276561",
"0.52596784",
"0.5256314",
"0.52458113",
"0.5231186",
"0.52273655",
"0.52219206",
"0.5220548",
"0.5209153",
"0.51868564",
"0.5186565",
"0.51854044",
"0.51833546",
"0.5177587",
"0.517576",
"0.51699287",
"0.5165848",
"0.51657623",
"0.5163957",
"0.5163752",
"0.5163752",
"0.5163752",
"0.51551044",
"0.51525164",
"0.51413214",
"0.5138219",
"0.5133813",
"0.51317114",
"0.51221764",
"0.51194054",
"0.51186407",
"0.5117092",
"0.51140475",
"0.51087344",
"0.5107248",
"0.510075",
"0.50992125",
"0.5094752",
"0.50897664",
"0.5085949",
"0.5084943",
"0.5082882",
"0.5078657",
"0.50774837",
"0.50772595",
"0.5058741",
"0.50586474",
"0.5058565",
"0.50562537",
"0.5053086",
"0.50491107",
"0.5048916",
"0.5045647",
"0.50453216",
"0.5044943",
"0.5042362",
"0.50352436",
"0.50336653",
"0.50332767",
"0.5030862",
"0.502479",
"0.50230664",
"0.5020501",
"0.5019574",
"0.50167686",
"0.5012894",
"0.50119615"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void annotate(JDefinedClass cls) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void javadoc(JDefinedClass cls) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void buildConstants(JDefinedClass cls) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void buildAttributes(JDefinedClass cls) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.