Arc slice = new Arc(); slice.setCenterX(centerX); slice.setCenterY(centerY); slice.setRadiusX(radius); slice.setRadiusY(radius); slice.setType(ArcType.ROUND); slice.setFill(data.getColor()); slice.setStartAngle(totalAngle); slice.setLength(-length); totalAngle -= length; slice.setOnMouseEntered(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { slice.setFill(data.getColor().brighter()); tooltip.show(slice, event.getScreenX()+10, event.getScreenY()+10); slice.setOnMouseExited(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { slice.setFill(data.getColor()); tooltip.hide(); Arc sep = new Arc(); sep.setCenterX(centerX); sep.setCenterY(centerY); sep.setRadiusX(radius+1);//enough to cover the border of the slice sep.setRadiusY(radius+1);
public ArcType getArcType(int instrumentIndex, int lightSourceIndex) { // Parents: None // Type is not a reference return ((Arc)root.getInstrument(instrumentIndex).getLightSource(lightSourceIndex)).getType(); }
public String getArcID(int instrumentIndex, int lightSourceIndex) { // Parents: None // ID is not a reference return ((Arc)root.getInstrument(instrumentIndex).getLightSource(lightSourceIndex)).getID(); }
Arc a = new Arc(); a.setProjectionMatrix(cam.combined); a.begin(ShapeType.Line); a.arc(10, 10, 10, 30, 120); a.end();
import javafx.application.Application; import javafx.scene.*; import javafx.scene.paint.Color; import javafx.scene.shape.*; import javafx.stage.Stage; public class SemiCircleSample extends Application { @Override public void start(Stage stage) { Arc arc = new Arc(50, 50, 25, 25, 0, 180); arc.setType(ArcType.OPEN); arc.setStrokeWidth(10); arc.setStroke(Color.CORAL); arc.setStrokeType(StrokeType.INSIDE); arc.setFill(null); stage.setScene(new Scene(new Group(arc), 100, 80)); stage.show(); } public static void main(String[] args) { launch(args); } }
private static Arc createArc(double radius, double centerX, double centerY, double fromAngle, double toAngle, Paint stroke, double strokeWidth) { Arc arc = new Arc(centerX, centerY, radius, radius, fromAngle, toAngle - fromAngle); arc.setFill(null); arc.setStroke(stroke); arc.setStrokeWidth(strokeWidth); return arc; } @Override public void start(Stage primaryStage) { Pane pane = new Pane( createArc(50, 60, 60, 90, 315, Color.BLUE, 10), // part of the blue ring containing part covered by yellow createArc(50, 110, 110, 0, 360, Color.YELLOW, 10), createArc(50, 60, 60, -45, 90, Color.BLUE, 10) // part covering the yellow ring ); Scene scene = new Scene(pane); primaryStage.setScene(scene); primaryStage.show(); }
return laser; } else if (Arc.class.getName().equals(type)) { Arc arc = new Arc(); arc.setID("LightSource:"+index); arc.setManufacturer(COMPONENT_MANUFACTURER); arc.setSerialNumber(COMPONENT_SERIAL_NUMBER); arc.setLotNumber(COMPONENT_LOT_NUMBER); arc.setModel(COMPONENT_MODEL); arc.setPower(new Power(LIGHTSOURCE_POWER, UNITS.MILLIWATT)); arc.setType(ARC_TYPE); return arc; } else if (Filament.class.getName().equals(type)) {
public void setArcID(String id, int instrumentIndex, int lightSourceIndex) { // Parents: None // ID is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfLightSourceList() == lightSourceIndex) { o1.addLightSource(new Arc()); } Arc o2 = (Arc) o1.getLightSource(lightSourceIndex); model.addModelObject(id, o2); o2.setID(id); }
Arc arc = new Arc(); arc.setCenterX(100); arc.setCenterY(0); arc.setRadiusX(100); arc.setRadiusY(100); arc.setStartAngle(0); arc.setLength(180); arc.relocate(0, 0);
public void setArcType(ArcType type, int instrumentIndex, int lightSourceIndex) { // Parents: None // Type is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfLightSourceList() == lightSourceIndex) { o1.addLightSource(new Arc()); } Arc o2 = (Arc) o1.getLightSource(lightSourceIndex); o2.setType(type); }
final double maxRange = 360 - 2 * startOffset; Arc arc = new Arc(); arc.setFill(null); arc.setRadiusX(100); arc.setRadiusY(100); arc.setCenterX(110); arc.setCenterY(110); arc.setStrokeWidth(10); arc.setStroke(Color.WHITE.deriveColor(0, 0, 1, 0.5)); arc.setStartAngle(270 - startOffset); arc.lengthProperty().bind(value.subtract(minValue).divide(maxValue.subtract(minValue)).multiply(-maxRange));
public void setArcPower(Power power, int instrumentIndex, int lightSourceIndex) { // Parents: None // Power is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfLightSourceList() == lightSourceIndex) { o1.addLightSource(new Arc()); } Arc o2 = (Arc) o1.getLightSource(lightSourceIndex); o2.setPower(power); }
public void setArcModel(String model, int instrumentIndex, int lightSourceIndex) { // Parents: None // Model is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfLightSourceList() == lightSourceIndex) { o1.addLightSource(new Arc()); } Arc o2 = (Arc) o1.getLightSource(lightSourceIndex); o2.setModel(model); }
@Test(dependsOnMethods={"testValidInstrumentNode"},enabled=false) public void testValidArcNode() { Arc arc = (Arc) ome.getInstrument(0).getLightSource(2); assertNotNull(arc); assertEquals(LIGHTSOURCE_ARC_ID, arc.getID()); assertEquals(LIGHTSOURCE_ARC_MODEL, arc.getModel()); assertEquals(LIGHTSOURCE_ARC_POWER, arc.getPower().value(UNITS.MILLIWATT).doubleValue()); assertEquals(ARC_TYPE, arc.getType()); }
public void setArcLotNumber(String lotNumber, int instrumentIndex, int lightSourceIndex) { // Parents: None // LotNumber is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfLightSourceList() == lightSourceIndex) { o1.addLightSource(new Arc()); } Arc o2 = (Arc) o1.getLightSource(lightSourceIndex); o2.setLotNumber(lotNumber); }
public void setArcSerialNumber(String serialNumber, int instrumentIndex, int lightSourceIndex) { // Parents: None // SerialNumber is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfLightSourceList() == lightSourceIndex) { o1.addLightSource(new Arc()); } Arc o2 = (Arc) o1.getLightSource(lightSourceIndex); o2.setSerialNumber(serialNumber); }
public void setArcManufacturer(String manufacturer, int instrumentIndex, int lightSourceIndex) { // Parents: None // Manufacturer is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfLightSourceList() == lightSourceIndex) { o1.addLightSource(new Arc()); } Arc o2 = (Arc) o1.getLightSource(lightSourceIndex); o2.setManufacturer(manufacturer); }
/** * Updates Arc recursively from an XML DOM tree. <b>NOTE:</b> No * properties are removed, only added or updated. * @param element Root of the XML DOM tree to construct a model object * graph from. * @param model Handler for the OME model which keeps track of instances * and references seen during object population. * @throws EnumerationException If there is an error instantiating an * enumeration during model object creation. */ public void update(Element element, OMEModel model) throws EnumerationException { super.update(element, model); String tagName = element.getTagName(); if (element.hasAttribute("Type")) { // Attribute property which is an enumeration Type setType(ArcType.fromString( element.getAttribute("Type"))); } }