Sofia API Reference

  • Package Index
  • Class Index
  • Packages
  • sofia.app
  • sofia.content
  • sofia.data
  • sofia.graphics
    • Interfaces
    • Joint
    • PropertyTransformer
    • Classes
    • AbstractJoint
    • Anchor
    • Color
    • CoordinateSystem
    • DirectionalPad
    • DistanceJoint
    • ElasticInInterpolator
    • ElasticInOutInterpolator
    • ElasticOutInterpolator
    • FillableShape
    • FillableShape.Animator
    • Geometry
    • Image
    • LineShape
    • MotionStep
    • OvalShape
    • PointAndAnchor
    • Polygon
    • PolygonShape
    • Predicate
    • RectangleShape
    • RevoluteJoint
    • Shape
    • Shape.Animator
    • Shape.Filter
    • ShapeField
    • ShapeFilter
    • ShapeSet
    • ShapeView
    • SizeF
    • StrokedShape
    • StrokedShape.Animator
    • TextShape
    • TextShape.Animator
    • Timings
    • ViewEdges
    • ZIndexComparator
    • Enums
    • RepeatMode
    • ShapeMotion
  • sofia.util
  • sofia.view
  • sofia.widget

public class
SizeF

extends Object

Inheritance

  • java.lang.Object
    • sofia.graphics.SizeF

Class Overview

A class used elsewhere in Sofia that holds two float coordinates representing the width and height of an object.


Summary

Fields
float height The height.
float width The width.
Public Constructors
SizeF()
Creates a SizeF with a width and height of zero.
SizeF(float width, float height)
Creates a SizeF with the specified width and height.
SizeF(SizeF size)
Creates a SizeF with values copied from the specified size.
Public Methods
boolean equals(Object other)
boolean equals(float otherWidth, float otherHeight)
Gets a value indicating whether the receiver has the specified width and height.
int hashCode()
float length()
Gets the Euclidean distance from (0, 0) to the point indicated by the width and height of the receiver.
void set(float newWidth, float newHeight)
Sets the width and height of the size.
void set(SizeF size)
Sets the size's width and height to those from the specified size.
String toString()
Gets a human-readable string representation of the size.
Methods inherited from class java.lang.Object
Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait()
final void wait(long arg0, int arg1)
final void wait(long arg0)

Fields

public float height

The height.

public float width

The width.


Public Constructors

public SizeF ()

Creates a SizeF with a width and height of zero.

public SizeF (float width, float height)

Creates a SizeF with the specified width and height.

Parameters
width
the width
height
the height
public SizeF (SizeF size)

Creates a SizeF with values copied from the specified size.

Parameters
size
the size

Public Methods

public boolean equals (Object other)

public boolean equals (float otherWidth, float otherHeight)

Gets a value indicating whether the receiver has the specified width and height.

Parameters
otherWidth
the width to compare the receiver with
otherHeight
the height to compare the receiver with
Returns

true if the receiver has the specified width and height, otherwise false

public int hashCode ()

public float length ()

Gets the Euclidean distance from (0, 0) to the point indicated by the width and height of the receiver.

Returns

the Euclidean distance from (0, 0) to (width, height)

public void set (float newWidth, float newHeight)

Sets the width and height of the size.

Parameters
newWidth
the new width
newHeight
the new height
public void set (SizeF size)

Sets the size's width and height to those from the specified size.

Parameters
size
the size
public String toString ()

Gets a human-readable string representation of the size.

Returns

a human-readable string representation of the size