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
ZIndexComparator

extends Object
implements Comparator<T>

Inheritance

  • java.lang.Object
    • sofia.graphics.ZIndexComparator

Class Overview

A comparator for shapes that orders them by increasing z-index, or for identical z-indices, orders them by increasing insertion time (i.e., newer shapes are after older shapes).


Summary

Public Constructors
ZIndexComparator()
Public Methods
int compare(Shape shape1, Shape shape2)
Protected Methods
int compareTimestamps(Shape shape1, Shape shape2)
Compare the insertion times of two shapes.
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)
Methods inherited from interface java.util.Comparator
abstract int compare(T arg0, T arg1)
abstract boolean equals(Object arg0)

Public Constructors

public ZIndexComparator ()


Public Methods

public int compare (Shape shape1, Shape shape2)


Protected Methods

protected int compareTimestamps (Shape shape1, Shape shape2)

Compare the insertion times of two shapes.

Parameters
shape1
The first shape.
shape2
The second shape.
Returns

-1 if shape1 was added to the ShapeSet before shape2, 0 if they were added at the same time, or 1 if shape2 was added before shape1.