本文整理汇总了Java中javafx.beans.property.ReadOnlyIntegerWrapper类的典型用法代码示例。如果您正苦于以下问题:Java ReadOnlyIntegerWrapper类的具体用法?Java ReadOnlyIntegerWrapper怎么用?Java ReadOnlyIntegerWrapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReadOnlyIntegerWrapper类属于javafx.beans.property包,在下文中一共展示了ReadOnlyIntegerWrapper类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preloadMapTiles
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
@Override
public ReadOnlyIntegerProperty preloadMapTiles(double minLatitude, double maxLatitude, double minLongitude, double maxLongitude) {
ReadOnlyIntegerWrapper remainingCount = new ReadOnlyIntegerWrapper();
int minX = getTileX(minLongitude, ZOOM);
int maxX = getTileX(maxLongitude, ZOOM);
int minY = getTileY(minLatitude, ZOOM);
int maxY = getTileY(maxLatitude, ZOOM);
int totalCount = (maxX-minX+1)*(maxY-minY+1);
if (totalCount > MAX_TILES) {
throw new IllegalArgumentException("The number of tiles required ("+totalCount+") is greater than the maximum allowed ("+MAX_TILES+")");
}
int remaining = 0;
for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
File f = getCacheFile(ZOOM, x, y);
if (!f.exists()) {
remaining++;
fetchAndStoreTile(remainingCount, ZOOM, x, y);
}
}
}
remainingCount.set(remaining);
return remainingCount;
}
示例2: HourMinSecTextField
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
public HourMinSecTextField(String time) {
super(time);
this.time = new SimpleLongProperty();
timePattern = Pattern.compile("\\d\\d:\\d\\d:\\d\\d");
if (!validate(time)) {
throw new IllegalArgumentException("Invalid time: " + time);
}
hours = new ReadOnlyIntegerWrapper(this, "hours");
minutes = new ReadOnlyIntegerWrapper(this, "minutes");
hours.bind(new TimeUnitBinding(Unit.HOURS));
minutes.bind(new TimeUnitBinding(Unit.MINUTES));
seconds = new ReadOnlyIntegerWrapper(this, "seconds");
seconds.bind(new TimeUnitBinding(Unit.SECONDS));
this.time.bind(seconds.add(minutes.multiply(60).add(hours.multiply(60))));
}
示例3: AbstractOpenGLRenderer
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
public AbstractOpenGLRenderer(final StreamHandler readHandler) {
this.pendingRunnables = new ConcurrentLinkedQueue<Runnable>();
this.fps = new ReadOnlyIntegerWrapper(this, "fps", 0);
if ((Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0)
throw new UnsupportedOperationException("Support for pbuffers is required.");
try {
pbuffer = new Pbuffer(1, 1, new PixelFormat(), null, null, new ContextAttribs().withDebug(false));
pbuffer.makeCurrent();
} catch (LWJGLException e) {
throw new RuntimeException(e);
}
final ContextCapabilities caps = GLContext.getCapabilities();
if (caps.GL_ARB_debug_output) {
glDebugMessageCallbackARB(new ARBDebugOutputCallback());
} else if (caps.GL_AMD_debug_output) {
glDebugMessageCallbackAMD(new AMDDebugOutputCallback());
}
this.renderStreamFactory = StreamUtil.getRenderStreamImplementation();
this.renderStream = renderStreamFactory.create(readHandler, samples, transfersToBuffer);
}
示例4: World
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
/**
* Instantiates a World object with the specified parameters.
*
* @param name
* The name of the World
* @param width
* The width of the World
* @param height
* The height of the World
* @param baseTileType
* The initial tile type to set every tile to
*/
public World(String name, int width, int height,
int baseTileType, long seed) {
tiles = new Array2D<>(width, height);
this.seed = seed;
this.height = new ReadOnlyIntegerWrapper(height);
this.width = new ReadOnlyIntegerWrapper(width);
initialise();
for (int y = 0; y < getHeight(); y++) {
for (int x = 0; x < getWidth(); x++) {
tiles.set(x, y, new Tile(x, y, baseTileType));
}
}
buildings = new HashSet<>();
this.name = name;
this.modifierManager = new ModifierManager();
this.seasonManager = new SeasonManager();
this.weatherManager = new WeatherManager();
this.fireManager = new FireManager(this);
this.timeManager = new DayNight();
this.contractGenerator = new ContractGenerator();
this.activeContracts = new ContractHandler();
this.availableContracts = new ContractHandler();
this.storageManager = new StorageManager();
this.predatorManager = new PredatorManager();
this.buildingPlacer = new BuildingPlacer();
this.moneyHandler = new Money();
}
示例5: fetchAndStoreTile
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
private void fetchAndStoreTile(ReadOnlyIntegerWrapper remaining, int zoom, int x, int y) {
BackgroundTasks.runInBackground(() -> {
try {
String urlString = TILE_HOST+zoom+"/"+x+"/"+y+".png";
URL url = new URL(urlString);
try (InputStream inputStream = url.openConnection().getInputStream()) {
File candidate = getCacheFile(zoom, x, y);
candidate.getParentFile().mkdirs();
try (FileOutputStream fos = new FileOutputStream(candidate)) {
byte[] buff = new byte[4096];
int len = inputStream.read(buff);
while (len > 0) {
fos.write(buff, 0, len);
len = inputStream.read(buff);
}
fos.close();
}
}
} catch (IOException ex) {
LOG.log(Level.SEVERE, "Failed to fetch & store map tile "+x+","+y, ex);
} finally {
Platform.runLater(() -> {
remaining.set(remaining.get()-1);//Identify it as loaded regardless
});
}
});
}
示例6: HourMinTextField
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
public HourMinTextField(String time) {
super(time);
this.time = new SimpleLongProperty();
timePattern = Pattern.compile("\\d\\d:\\d\\d");
if (!validate(time)) {
throw new IllegalArgumentException("Invalid time: " + time);
}
hours = new ReadOnlyIntegerWrapper(this, "hours");
minutes = new ReadOnlyIntegerWrapper(this, "minutes");
hours.bind(new TimeUnitBinding(Unit.HOURS));
minutes.bind(new TimeUnitBinding(Unit.MINUTES));
this.time.bind(minutes.add(hours.multiply(60)));
}
示例7: widthProperty
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
/** Replies the property that is the width of the box.
*
* @return the width property.
*/
@Pure
public IntegerProperty widthProperty() {
if (this.width == null) {
this.width = new ReadOnlyIntegerWrapper(this, MathFXAttributeNames.WIDTH);
this.width.bind(Bindings.subtract(maxXProperty(), minXProperty()));
}
return this.width;
}
示例8: heightProperty
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
/** Replies the property that is the height of the box.
*
* @return the height property.
*/
@Pure
public IntegerProperty heightProperty() {
if (this.height == null) {
this.height = new ReadOnlyIntegerWrapper(this, MathFXAttributeNames.HEIGHT);
this.height.bind(Bindings.subtract(maxYProperty(), minYProperty()));
}
return this.height;
}
示例9: depthProperty
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
/** Replies the property that is the depth of the box.
*
* @return the depth property.
*/
@Pure
public IntegerProperty depthProperty() {
if (this.depth == null) {
this.depth = new ReadOnlyIntegerWrapper(this, MathFXAttributeNames.DEPTH);
this.depth.bind(Bindings.subtract(maxZProperty(), minZProperty()));
}
return this.depth;
}
示例10: Vulnerability
import javafx.beans.property.ReadOnlyIntegerWrapper; //导入依赖的package包/类
public Vulnerability(int vulnerability) {
this.vulnerability = new ReadOnlyIntegerWrapper(vulnerability);
}