public double getTailIndent() { MachineSizedFloatPtr ptr = new MachineSizedFloatPtr(); getValueForSpecifier(CTParagraphStyleSpecifier.TailIndent, MachineSizedFloatPtr.sizeOf(), ptr.as(VoidPtr.class)); return ptr.get(); } public double getDefaultTabInterval() {
public void setParagraphSpacing(double paragraphSpacing) { MachineSizedFloatPtr ptr = new MachineSizedFloatPtr(); ptr.set(paragraphSpacing); setValueForSpecifier(CTParagraphStyleSpecifier.ParagraphSpacing, ptr.as(VoidPtr.class)); } public void setParagraphSpacingBefore(double paragraphSpacingBefore) {
/** * Copies {@code count} floats from the memory pointed to by this * {@link MachineSizedFloatPtr} to {@code dst} starting at offset {@code offset}. * Does {@code double} to {@code float} conversion if running on * a 64-bit platform. * * @param dst the destination. * @param offset the offset within the destination array to start copying to. * @param count the number of elements to copy. */ public void get(float[] dst, int offset, int count) { if (_sizeOf() == 4) { asFloatBuffer(count).get(dst, offset, count); } else { Arrays.checkOffsetAndCount(dst.length, offset, count); DoubleBuffer buf = asDoubleBuffer(count); for (int i = 0; i < count; i++) { dst[i + offset] = (float) buf.get(); } } }
/** * @since Available in iOS 3.2 and later. */ public double[] getLigatureCaretPositions(short glyph, int maxPositions) { MachineSizedFloatPtr ptr = new MachineSizedFloatPtr(); getLigatureCaretPositions(glyph, ptr, maxPositions); return ptr.toDoubleArray(maxPositions); } /*<methods>*/
/** * @since Available in iOS 2.0 and later. */ public double getDouble(long index) { MachineSizedFloatPtr ptr = new MachineSizedFloatPtr(); if (getNumber(index, ptr)) { return ptr.get(); } return 0; } public boolean hasName(long index) {
/** * Returns a {@link FloatBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 32-bit platforms. * * @param n the maximum number of floats the {@link FloatBuffer} can * read/write. This will be the {@link FloatBuffer}'s * <code>capacity</code>. * @return the {@link FloatBuffer}. * @throws IllegalStateException if this isn't a 32-bit platform. */ public FloatBuffer asFloatBuffer(int n) { if (_sizeOf() != 4) { throw new IllegalStateException("Not a 32-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 2) .order(ByteOrder.nativeOrder()).asFloatBuffer(); }
/** * Copies {@code src.length} floats from {@code src} to the memory pointed * to by this {@link MachineSizedFloatPtr}. Does {@code float} * to {@code double} conversion if running on a 64-bit platform. * * @param src the source. */ public void set(float[] src) { set(src, 0, src.length); }
public double[] getComponentsD() { return getComponents(this).toDoubleArray((int) getNumberOfComponents()); } public float[] getComponentsF() {
case MinimumLineSpacing: case LineSpacingAdjustment: size = MachineSizedFloatPtr.sizeOf(); break; case TabStops:
/** * @since Available in iOS 2.0 and later. */ public double getDouble(String key) { MachineSizedFloatPtr ptr = new MachineSizedFloatPtr(); if (getNumber(key, ptr)) { return ptr.get(); } return 0; } public boolean hasName(String key) {
/** * Returns a {@link DoubleBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 64-bit platforms. * * @param n the maximum number of doubles the {@link DoubleBuffer} can * read/write. This will be the {@link DoubleBuffer}'s * <code>capacity</code>. * @return the {@link DoubleBuffer}. * @throws IllegalStateException if this isn't a 64-bit platform. */ public DoubleBuffer asDoubleBuffer(int n) { if (_sizeOf() != 8) { throw new IllegalStateException("Not a 64-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 3) .order(ByteOrder.nativeOrder()).asDoubleBuffer(); }
/** * Copies {@code src.length} doubles from {@code src} to the memory pointed * to by this {@link MachineSizedFloatPtr}. Does {@code double} to * {@code float} conversion if running on a 32-bit platform. * * @param src the source. */ public void set(double[] src) { set(src, 0, src.length); }
/** * @since Available in iOS 3.2 and later. */ public double[] getLigatureCaretPositions(short glyph, int maxPositions) { MachineSizedFloatPtr ptr = new MachineSizedFloatPtr(); getLigatureCaretPositions(glyph, ptr, maxPositions); return ptr.toDoubleArray(maxPositions); } /*<methods>*/
public double[] getComponentsD() { return components().toDoubleArray((int) getNumberOfComponents()); }
public double getMinimumLineHeight() { MachineSizedFloatPtr ptr = new MachineSizedFloatPtr(); getValueForSpecifier(CTParagraphStyleSpecifier.MinimumLineHeight, MachineSizedFloatPtr.sizeOf(), ptr.as(VoidPtr.class)); return ptr.get(); } public double getLineSpacing() {
/** * Copies {@code count} doubles from the memory pointed to by this * {@link MachineSizedFloatPtr} to {@code dst} starting at offset {@code offset}. * Does {@code float} to {@code double} conversion if running on * a 32-bit platform. * * @param dst the destination. * @param offset the offset within the destination array to start copying to. * @param count the number of elements to copy. */ public void get(double[] dst, int offset, int count) { if (_sizeOf() == 8) { asDoubleBuffer(count).get(dst, offset, count); } else { Arrays.checkOffsetAndCount(dst.length, offset, count); FloatBuffer buf = asFloatBuffer(count); for (int i = 0; i < count; i++) { dst[i + offset] = buf.get(); } } }
public void setMaximumLineSpacing(double maximumLineSpacing) { MachineSizedFloatPtr ptr = new MachineSizedFloatPtr(); ptr.set(maximumLineSpacing); setValueForSpecifier(CTParagraphStyleSpecifier.MaximumLineSpacing, ptr.as(VoidPtr.class)); } public void setMinimumLineSpacing(double minimumLineSpacing) {
public double getBoundingSphereRadius() { MachineSizedFloatPtr ptr = new MachineSizedFloatPtr(); boolean result = getBoundingSphere(null, ptr); if (result) { return ptr.get(); } return 0; } public void setBoundingBox(SCNVector3 min, SCNVector3 max) {
/** * Returns a {@link FloatBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 32-bit platforms. * * @param n the maximum number of floats the {@link FloatBuffer} can * read/write. This will be the {@link FloatBuffer}'s * <code>capacity</code>. * @return the {@link FloatBuffer}. * @throws IllegalStateException if this isn't a 32-bit platform. */ public FloatBuffer asFloatBuffer(int n) { if (_sizeOf() != 4) { throw new IllegalStateException("Not a 32-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 2) .order(ByteOrder.nativeOrder()).asFloatBuffer(); }
public void setLineDash(double[] pattern, double phase) { if (pattern == null) { throw new NullPointerException("pattern"); } MachineSizedFloatPtr patternPtr = Struct.allocate(MachineSizedFloatPtr.class, pattern.length); patternPtr.set(pattern); setLineDash(patternPtr, pattern.length, phase); }