Region topSpring = new Region(); Region bottomSpring = new Region(); Scene aboutDialogScene = new Scene(VBoxBuilder.create() .children(topSpring, new Text(text), bottomSpring, closeButton) .alignment(Pos.CENTER) .padding(new Insets(10)) .build(), xSize, ySize, backgroundColor); VBox.setVgrow(topSpring, Priority.ALWAYS); VBox.setVgrow(bottomSpring, Priority.ALWAYS);
private Region cacheRegion(PartitionRegionImpl regionImpl) { final Region region = new Region(regionImpl); regionCache.put(region.getName(), region); return region; }
new Region().getChildren().add(...); // doesn't compile new Pane().getChildren().add(...); // works
@Override public List<Region> getRegions() { final List<Region> regions = new ArrayList<Region>(); for (Partition p : partitionMap.values()) { for (Map.Entry<String, com.amazonaws.partitions.model.Region> entry : p.getRegions().entrySet()) { regions.add(new Region(new PartitionRegionImpl(entry.getKey(), p))); } } return Collections.unmodifiableList(regions); }
private static Region parseRegionElement( final Element regionElement, final boolean endpointVerification) { String name = getChildElementValue(REGION_ID_TAG, regionElement); String domain = getChildElementValue(DOMAIN_TAG, regionElement); InMemoryRegionImpl regionImpl = new InMemoryRegionImpl(name, domain); NodeList endpointNodes = regionElement.getElementsByTagName(ENDPOINT_TAG); for (int i = 0; i < endpointNodes.getLength(); i++) { addRegionEndpoint(regionImpl, (Element) endpointNodes.item(i), endpointVerification); } return new Region(regionImpl); }
public class MainActivity extends Activity implements BeaconConsumer { protected static final String TAG = "RangingActivity"; BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25")); beaconManager.bind(this); } @Override public void onBeaconServiceConnect() { beaconManager.setRangeNotifier(new RangeNotifier() { @Override public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) { if (beacons.size() > 0) { Log.d(TAG, "The first beacon I see is about "+beacons.iterator().next().getDistance()+" meters away."); } } }); try { beaconManager.startRangingBeaconsInRegion(new Region("myRangingUniqueId", null, null, null)); } catch (RemoteException e) { } }
private Region cacheRegion(PartitionRegionImpl regionImpl) { final Region region = new Region(regionImpl); regionCache.put(region.getName(), region); return region; }
@Override public List<Region> getRegions() { final List<Region> regions = new ArrayList<Region>(); for (Partition p : partitionMap.values()) { for (Map.Entry<String, com.amazonaws.partitions.model.Region> entry : p.getRegions().entrySet()) { regions.add(new Region(new PartitionRegionImpl(entry.getKey(), p))); } } return Collections.unmodifiableList(regions); }
private static Region parseRegionElement( final Element regionElement, final boolean endpointVerification) { String name = getChildElementValue(REGION_ID_TAG, regionElement); String domain = getChildElementValue(DOMAIN_TAG, regionElement); Region region = new Region(name, domain); NodeList endpointNodes = regionElement.getElementsByTagName(ENDPOINT_TAG); for (int i = 0; i < endpointNodes.getLength(); i++) { addRegionEndpoint(region, (Element) endpointNodes.item(i), endpointVerification); } return region; }
private static Region parseRegionElement( final Element regionElement, final boolean endpointVerification) { String name = getChildElementValue(REGION_ID_TAG, regionElement); String domain = getChildElementValue(DOMAIN_TAG, regionElement); InMemoryRegionImpl regionImpl = new InMemoryRegionImpl(name, domain); NodeList endpointNodes = regionElement.getElementsByTagName(ENDPOINT_TAG); for (int i = 0; i < endpointNodes.getLength(); i++) { addRegionEndpoint(regionImpl, (Element) endpointNodes.item(i), endpointVerification); } return new Region(regionImpl); }
@Override public void start(Stage mainStage) throws Exception { Scene scene = new Scene(new Region()); mainStage.setWidth(640); mainStage.setHeight(480); mainStage.setScene(scene); //this makes all stages close and the app exit when the main stage is closed mainStage.setOnCloseRequest(e -> Platform.exit()); //add real stuff to the scene... //open secondary stages... etc... }
@BeforeClass public static void setUp() { List<Region> regions = new LinkedList<Region>(); Region region = new Region("us-east-1", null); region.getServiceEndpoints().put("s3", "s3.amazonaws.com"); regions.add(region); region = new Region("us-west-1", null); region.getServiceEndpoints().put("s3", "s3-us-west-1.amazonaws.com"); regions.add(region); regions.add(new Region("cn-north-1", "amazonaws.com.cn")); metadata = new RegionMetadata(regions); }
@Test public void testDefaultDomain() { final Region region = new Region("region", null); Assert.assertEquals("amazonaws.com", region.getDomain()); }
region = new Region("ap-northeast-1", "amazonaws.com"); ret.add(region); updateRegion(region, "autoscaling", "autoscaling.ap-northeast-1.amazonaws.com", false, true); region = new Region("ap-northeast-2", "amazonaws.com"); ret.add(region); updateRegion(region, "autoscaling", "autoscaling.ap-northeast-2.amazonaws.com", false, true); region = new Region("ap-south-1", "amazonaws.com"); ret.add(region); updateRegion(region, "autoscaling", "autoscaling.ap-south-1.amazonaws.com", false, true); region = new Region("ap-southeast-1", "amazonaws.com"); ret.add(region); updateRegion(region, "autoscaling", "autoscaling.ap-southeast-1.amazonaws.com", false, true); region = new Region("ap-southeast-2", "amazonaws.com"); ret.add(region); updateRegion(region, "autoscaling", "autoscaling.ap-southeast-2.amazonaws.com", false, true); region = new Region("ca-central-1", "amazonaws.com"); ret.add(region); updateRegion(region, "autoscaling", "autoscaling.ca-central-1.amazonaws.com", false, true); region = new Region("eu-central-1", "amazonaws.com"); ret.add(region); updateRegion(region, "autoscaling", "autoscaling.eu-central-1.amazonaws.com", false, true); region = new Region("eu-west-1", "amazonaws.com");
Path path1 = new Path(); path1.addCircle(10, 10, 4, Path.Direction.CW); Path path2 = new Path(); path2.addCircle(15, 15, 8, Path.Direction.CW); Region region1 = new Region(); region1.setPath(path1, clip); Region region2 = new Region(); region2.setPath(path2, clip); if (!region1.quickReject(region2) && region1.op(region2, Region.Op.INTERSECT)) { // Collision! }
Path path1 = new Path(); path1.addCircle(10, 10, 4, Path.Direction.CW); Path path2 = new Path(); path2.addCircle(15, 15, 8, Path.Direction.CW); Region region1 = new Region(); region1.setPath(path1, clip); Region region2 = new Region(); region2.setPath(path2, clip); if (!region1.quickReject(region2) && region1.op(region2, Region.Op.INTERSECT)) { // Collision! }
Button btn = new Button(); btn.getStyleClass().add("icon-button"); btn.setPickOnBounds(true); Region icon = new Region(); icon.getStyleClass().add("icon"); btn.setGraphic(icon);