/** * 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"))); } }
/** * 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 (!"Arc".equals(tagName)) { LOGGER.debug("Expecting node name of Arc got {}", tagName); } if (element.hasAttribute("Type")) { // Attribute property which is an enumeration Type setType(ArcType.fromString( element.getAttribute("Type"))); } }
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); } }
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); }
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); }
slice.setRadiusX(radius); slice.setRadiusY(radius); slice.setType(ArcType.ROUND); slice.setFill(data.getColor()); slice.setStartAngle(totalAngle); sep.setRadiusX(radius+1);//enough to cover the border of the slice sep.setRadiusY(radius+1); sep.setType(ArcType.ROUND); sep.setFill(separatorColor); sep.setLength(-separatorLength); hole.setRadiusX(innerHoleRadius); hole.setRadiusY(innerHoleRadius); hole.setType(ArcType.ROUND); hole.setFill(holeColor); hole.setStartAngle(0);
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)) {
arc.setID(LIGHTSOURCE_ARC_ID); arc.setModel(LIGHTSOURCE_ARC_MODEL); arc.setType(ARC_TYPE); arc.setPower(new Power(LIGHTSOURCE_ARC_POWER, UNITS.MILLIWATT)); instrument.addLightSource(arc);
arc.setID(InOutCurrentTest.LIGHTSOURCE_ARC_ID); arc.setModel(InOutCurrentTest.LIGHTSOURCE_ARC_MODEL); arc.setType(InOutCurrentTest.ARC_TYPE); arc.setPower(new Power(InOutCurrentTest.LIGHTSOURCE_ARC_POWER, UNITS.MILLIWATT)); CommentAnnotation arcAnnotation = new CommentAnnotation();