本文整理了Java中ij.gui.Line
类的一些代码示例,展示了Line
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Line
类的具体详情如下:
包路径:ij.gui.Line
类名称:Line
[英]This class represents a straight line selection.
[中]此类表示直线选择。
代码示例来源:origin: stackoverflow.com
var line1 = new Line(0, 0, 0, 100);
var line2 = new Line(0, 100, 100, 100);
var line3 = new Line(100, 100, 100, 0);
var line4 = new Line(100, 0, 0, 0);
代码示例来源:origin: stackoverflow.com
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);
代码示例来源:origin: stackoverflow.com
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);
代码示例来源:origin: net.imagej/ij
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);
代码示例来源:origin: net.imagej/ij
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);
代码示例来源:origin: ca.mcgill/Sholl_Analysis
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) {
代码示例来源:origin: stackoverflow.com
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();
代码示例来源:origin: sc.fiji/Fiji_Plugins
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)
代码示例来源:origin: stackoverflow.com
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);
代码示例来源:origin: stackoverflow.com
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();
代码示例来源:origin: stackoverflow.com
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();
代码示例来源:origin: net.imagej/ij
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)
代码示例来源:origin: stackoverflow.com
@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();
}
代码示例来源:origin: stackoverflow.com
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();
代码示例来源:origin: stackoverflow.com
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();
代码示例来源:origin: stackoverflow.com
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();
代码示例来源:origin: stackoverflow.com
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();
代码示例来源:origin: stackoverflow.com
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();
代码示例来源:origin: stackoverflow.com
Line line = new Line(startx, starty, endx, endy);
Line arrowHead1 = new Line(endx, endy, x1, y1);
Line arrowHead2 = new Line(endx, endy, x2, y2);
primaryStage.setScene(new Scene(root, 800, 600));
primaryStage.show();
代码示例来源:origin: net.imagej/ij
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)
内容来源于网络,如有侵权,请联系作者删除!