Line line1 = new Line(20, 40, 270, 40); line1.getStrokeDashArray().addAll(25d, 20d, 5d, 20d); Line line2 = new Line(20, 60, 270, 60); line2.getStrokeDashArray().addAll(50d, 40d); Line line3 = new Line(20, 80, 270, 80); line3.getStrokeDashArray().addAll(25d, 10d); Line line4 = new Line(20, 100, 270, 100); line4.getStrokeDashArray().addAll(2d); Line line5 = new Line(20, 120, 270, 120); line5.getStrokeDashArray().addAll(2d, 21d); pane.getChildren().addAll(line1, line2, line3, line4, line5);
Line eastHorz = new Line(); eastHorz.SetVerts(10f, 10f, 0f, 10f, -10f, 0f); eastHorz.SetColor(.8f, .8f, 0f, 1.0f); Line northHorz = new Line(); northHorz.SetVerts(-10f, 10f, 0f, 10f, 10f, 0f); northHorz.SetColor(0.8f, 0.8f, 0f, 1.0f); Line westHorz = new Line(); westHorz.SetVerts(-10f, -10f, 0f, -10f, 10f, 0f); westHorz.SetColor(0.8f, 0.8f, 0f, 1.0f); Line southHorz = new Line(); southHorz.SetVerts(-10f, -10f, 0f, 10f, -10f, 0f); southHorz.SetColor(0.8f, 0.8f, 0f, 1.0f); Lines.add(eastHorz); Lines.add(northHorz); Lines.add(westHorz); Lines.add(southHorz);
public void run(String arg) { ImagePlus imp = IJ.getImage(); Roi roi = imp.getRoi(); boolean rotatedRectangle = roi!=null && (roi instanceof RotatedRectRoi); if (roi==null || !(roi.isLine()||rotatedRectangle)) { IJ.error("Straightener", "Line, or rotated rectangle, selection required"); return; IJ.run(imp, "Duplicate...", " "); return; newTitle = gd.getNextString(); width = (int)gd.getNextNumber(); Line.setWidth(width); if (stackSize>1) processStack = gd.getNextBoolean(); roi = (Roi)imp.getRoi().clone(); int type = roi.getType(); if (type==Roi.FREELINE) imp2.setCalibration(cal); imp2.show(); if (isMacro) Line.setWidth(originalWidth);
double[][] profiles; profiles = new double[MAX_LANES+1][]; IJ.showStatus("Plotting " + nLanes + " lanes"); ImageProcessor ipRotated = imp.getProcessor(); if (isVertical) ipRotated = ipRotated.rotateLeft(); ImagePlus imp2 = new ImagePlus("", ipRotated); imp2.setCalibration(imp.getCalibration()); if (uncalibratedOD && (imp2.getType()==ImagePlus.GRAY16 || imp2.getType()==ImagePlus.GRAY32)) new ImageConverter(imp2).convertToGray8(); Dimension screen = IJ.getScreenSize(); if (plotWidth>screen.width-screen.width/6) plotWidth = screen.width - screen.width/6; ip.lineTo((int)(j*xScale+0.5), base-(int)((profile[j]-min)*yScale+0.5)); Line.setWidth(1); ImagePlus plots = new Plots(); plots.setProcessor("Plots of "+imp.getShortTitle(), ip);
options.setSkipBitmapOptions(isCSV); metrics = options.getMetrics(); if (!IJ.macroRunning()) setParametersFromPreferences(); counts = Arrays.copyOfRange(counts, startRow, endRow + 1); } else { IJ.log("*** Warning: " + getDescription() + "\n*** Option to restrict " + "analysis ignored: Not a valid selection of rows"); final int depth = img.getNSlices(); is3D = depth > 1; z = img.getZ(); channel = img.getC(); if (roi != null && roi.getType() == Roi.LINE) { endRadius = vxSize * chord.getRawLength(); chordAngle = Math.abs(chord.getAngle(x, y, chord.x2, chord.y2)); primaryFromPointRoi = false; multipointCount = 0; } else if (roi != null && roi.getType() == Roi.POINT) {
private Line valueMarker = new Line(); private XYChart.Series<Number, Number> series = new XYChart.Series<>(); private NumberAxis yAxis; valueMarker.setStartY(yShift + displayPosition); valueMarker.setEndY(yShift + displayPosition); Pane pane = new Pane(); pane.getChildren().addAll(chart, valueMarker); Scene scene = new Scene(pane); stage.setScene(scene); stage.show(); valueMarker.setStartX(chartAreaBounds.getMinX()); valueMarker.setEndX(chartAreaBounds.getMaxX()); updateMarker();
noRoi = false; Roi roi = imp.getRoi(); Y2 = Math.round(line.y2); r = line.getRawLength(); IJ.error("Radial reslice", "Output Z spacing ("+IJ.d2s(outputZSpacing,0)+" pixels) is too large."); return null; boolean virtualStack = imp.getStack().isVirtual(); String status = null; ImagePlus imp2 = null; ImageStack stack2 = null; boolean isStack = imp.getStackSize()>1; IJ.resetEscape(); for (int i=0; i<outputSlices; i++) { if (virtualStack)
gc.setFill(pattern); gc.fillRect(0, 0, 600, 600); primaryStage.setScene(new Scene(new StackPane(canvas))); primaryStage.show(); Pane pane = new Pane(); pane.setPrefSize(20, 20); Line fw = new Line(-5, -5, 25, 25); Line bw = new Line(-5, 25, 25, -5); fw.setStroke(Color.ALICEBLUE); bw.setStroke(Color.ALICEBLUE); fw.setStrokeWidth(5); bw.setStrokeWidth(5); pane.getChildren().addAll(fw, bw); new Scene(pane); return pane.snapshot(null, null);
public void start(Stage stage) { Pane pane = new Pane(); Line line = new Line(100, 100, 1000, 1000); pane.getChildren().add(line); vScrollBar.minProperty().bind(scrollPane.vminProperty()); vScrollBar.maxProperty().bind(scrollPane.vmaxProperty()); vScrollBar.visibleAmountProperty().bind(scrollPane.heightProperty().divide(pane.heightProperty())); scrollPane.vvalueProperty().bindBidirectional(vScrollBar.valueProperty()); scene.getStylesheets().add(this.getClass().getResource("style.css").toExternalForm()); stage.setScene(scene); stage.show();
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm()); Pane pane = new Pane(); pane.setStyle("-fx-background-color:red;"); StackPane sp = new StackPane(); VBox vbox = new VBox(); sp.getChildren().addAll(pane, vbox); Line line = new Line(10, 10, 500, 10); line.setStrokeWidth(3); pane.getChildren().add(line); line.setOnMouseClicked(e -> { System.out.println("Line Clicked!"); }); root.setCenter(sp); primaryStage.setScene(scene); primaryStage.show(); } catch(Exception e) { e.printStackTrace();
Roi roi = null; if (imp!=null) { overlay = imp.getOverlay(); roi = imp.getRoi(); if (roi!=null) roi = (Roi)roi.clone(); int size = imp!=null?imp.getWidth():512; roi = new Roi(0, 0, size/4, size/4); if (!roi.isDrawingTool()) { if (roi.getStroke()==null) roi.setStrokeWidth(defaultRoi.getStrokeWidth()); if (roi.getStrokeColor()==null || Line.getWidth()>1&&defaultRoi.getStrokeColor()!=null) roi.setStrokeColor(defaultRoi.getStrokeColor()); if (roi.getFillColor()==null)
@Override public void start(Stage primaryStage) throws Exception { Group group = new Group(); primaryStage.setScene(new Scene(group, 200, 350)); Line line = new Line(100, 50, 100, 300); LinearGradient linearGradient = new LinearGradient(0d, 0d, 0d, 1d, true, CycleMethod.NO_CYCLE, new Stop(0,Color.RED),new Stop(1,Color.GREEN)); line.setStrokeWidth(36); // 3em line.setStroke(linearGradient); group.getChildren().add(line); primaryStage.show(); }
Pane root = new Pane(); Line line = new Line( 400,200,400,200); root.addEventFilter(MouseEvent.MOUSE_MOVED, e -> { line.setEndX(e.getSceneX()); line.setEndY(e.getSceneY()); root.getChildren().add(line); primaryStage.setScene(scene); primaryStage.show();
Pane root = new Pane(); innerCircle.setRadius(innerRadius); Line topLeftBottomRightLine = new Line(-outerRadius, -outerRadius, outerRadius, outerRadius); topLeftBottomRightLine.setStrokeWidth(dist); Line bottomLeftTopRightLine = new Line(-outerRadius, outerRadius, outerRadius, -outerRadius); bottomLeftTopRightLine.setStrokeWidth(dist); root.getChildren().addAll(shape); primaryStage.setScene(scene); primaryStage.show();
Pane pane = new Pane(); Circle circle1 = createDraggingCircle(50, 50, 25, Color.BLUE); Circle circle2 = createDraggingCircle(350, 350, 25, Color.RED); Line line = new Line(); line.startXProperty().bind(circle1.centerXProperty()); line.startYProperty().bind(circle1.centerYProperty()); line.endXProperty().bind(circle2.centerXProperty()); line.endYProperty().bind(circle2.centerYProperty()); pane.getChildren().addAll(circle1, circle2, line); primaryStage.setScene(scene); primaryStage.show();
Pane root = new Pane(); Scene scene = new Scene(root, 800, 600, Color.WHITE); stage.setScene(scene); polylines.getChildren().add(line1); Line xAxis = new Line(0, 50, 800, 50); Line yAxis = new Line(50, 0, 50, 800); root.setScaleY(-1); root.getChildren().addAll(xAxis, yAxis); root.getChildren().add(polylines); stage.show();
Line line = new Line(lineCenterX, lineCenterY, 0, 100); line.setStroke(Color.YELLOW); Rotate rotate = new Rotate(); rotate.setPivotX(lineCenterX); rotate.setPivotY(lineCenterY); line.getTransforms().add(rotate); Pane pane = new Pane(); pane.getChildren().addAll(arc, line); primaryStage.setScene(scene); primaryStage.show();
double aspectRatio = 1.0; String unit = "pixel"; boolean global1 = imp.getGlobalCalibration()!=null; boolean global2; Calibration cal = imp.getCalibration(); Calibration calOrig = cal.copy(); boolean isCalibrated = cal.scaled(); int digits = 2; Roi roi = imp.getRoi(); if (roi!=null && (roi instanceof Line)) { measured = ((Line)roi).getRawLength(); length = IJ.d2s(measured, 2); digits = Tools.getDecimalPlaces(dscale); unit = cal.getUnit(); scale = IJ.d2s(dscale, digits)+" pixels/"+unit; aspectRatio = cal.pixelHeight/cal.pixelWidth; cal.setUnit("pixel"); } else { if (gd.scaleChanged || IJ.macroRunning()) { cal.pixelWidth = known/measured; if (cal.pixelDepth==1.0)