Class Transition

java.lang.Object
com.codename1.presentation.Transition

public final class Transition extends Object
How a slide comes on screen in a slide show, and when the show moves on from it.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    Milliseconds after which the show moves on by itself, or -1 for never.
    final boolean
    True when a click, tap or key moves to the next slide.
    static final String
    The slide slides in over the previous one.
    static final Transition
    No transition, advanced by a click.
    final String
    The direction the new slide comes from, one of the FROM_ constants.
    final int
    The duration in milliseconds.
    static final String
    The slide fades in over the previous one.
    static final String
    From the bottom.
    static final String
    From the left.
    static final String
    From the right.
    static final String
    From the top.
    static final String
    The slide simply replaces the previous one.
    static final String
    The slide pushes the previous one off screen.
    final String
    The effect, one of the effect constants.
    static final String
    The previous slide slides off, uncovering this one.
    static final String
    The slide is revealed by an edge sweeping across.
    static final String
    The slide grows from the centre.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Transition(String type, int duration, String direction, boolean advanceOnClick, int advanceAfter)
    A transition.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for the object.
    static Transition
    of(String type, int duration)
    A transition advanced by a click.
    This transition advancing by itself.
    This transition from another direction.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NONE

      public static final String NONE
      The slide simply replaces the previous one.
      See Also:
    • FADE

      public static final String FADE
      The slide fades in over the previous one.
      See Also:
    • PUSH

      public static final String PUSH
      The slide pushes the previous one off screen.
      See Also:
    • COVER

      public static final String COVER
      The slide slides in over the previous one.
      See Also:
    • UNCOVER

      public static final String UNCOVER
      The previous slide slides off, uncovering this one.
      See Also:
    • WIPE

      public static final String WIPE
      The slide is revealed by an edge sweeping across.
      See Also:
    • ZOOM

      public static final String ZOOM
      The slide grows from the centre.
      See Also:
    • FROM_LEFT

      public static final String FROM_LEFT
      From the left.
      See Also:
    • FROM_RIGHT

      public static final String FROM_RIGHT
      From the right.
      See Also:
    • FROM_TOP

      public static final String FROM_TOP
      From the top.
      See Also:
    • FROM_BOTTOM

      public static final String FROM_BOTTOM
      From the bottom.
      See Also:
    • DEFAULT

      public static final Transition DEFAULT
      No transition, advanced by a click.
    • type

      public final String type
      The effect, one of the effect constants.
    • duration

      public final int duration
      The duration in milliseconds.
    • direction

      public final String direction
      The direction the new slide comes from, one of the FROM_ constants.
    • advanceOnClick

      public final boolean advanceOnClick
      True when a click, tap or key moves to the next slide.
    • advanceAfter

      public final int advanceAfter
      Milliseconds after which the show moves on by itself, or -1 for never.
  • Constructor Details

    • Transition

      public Transition(String type, int duration, String direction, boolean advanceOnClick, int advanceAfter)

      A transition.

      Parameters
      • type: the effect

      • duration: milliseconds

      • direction: a FROM_ constant

      • advanceOnClick: whether a click advances

      • advanceAfter: milliseconds before advancing by itself, or -1

  • Method Details

    • of

      public static Transition of(String type, int duration)

      A transition advanced by a click.

      Parameters
      • type: the effect

      • duration: milliseconds

      Returns

      the transition

    • withDirection

      public Transition withDirection(String value)

      This transition from another direction.

      Parameters
      • value: a FROM_ constant
      Returns

      the transition

    • withAdvanceAfter

      public Transition withAdvanceAfter(int ms)

      This transition advancing by itself.

      Parameters
      • ms: milliseconds, or -1 for never
      Returns

      the transition

    • equals

      public boolean equals(Object o)
      Description copied from class: Object
      Indicates whether some other object is "equal to" this one. The equals method implements an equivalence relation: It is reflexive: for any reference value x, x.equals(x) should return true. It is symmetric: for any reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true. It is transitive: for any reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true. It is consistent: for any reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the object is modified. For any non-null reference value x, x.equals(null) should return false. The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Description copied from class: Object
      Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable. The general contract of hashCode is: Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables. As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)
      Overrides:
      hashCode in class Object