com.cult3d.world
Class Tooltip

java.lang.Object
  |
  +--com.cult3d.world.Tooltip

public class Tooltip
extends java.lang.Object

This class provides a Java representation of a Cult3D Tooltip that exists in the scene graph of the Cult3D Designer.

Here is an example for getting all registered CultObject for a certain Tooltip.

  Tooltip tooltip = new ToolTip("ToolTip1");
  Vector associatedObjects = tooltip.getAssociatedObjects();
  

Since:
Cult3D 5.3

Constructor Summary
Tooltip(java.lang.String name)
          Constructs a Java representation of a Cult3D Tooltip that exists in the scene graph of the Cult3D Designer.
 
Method Summary
 void addObject(CultObject object)
          Add the given CultObject to this Tooltips list over associated objects.
 java.util.Vector getAssociatedObjects()
          Gets a list of all registered/associated objects for this Tooltip.
 CultObject getFirstAssociatedObject()
          Gets the first object which are registed/associated for this Tooltip.
 Vector2 getFixedPosition()
          Gets the X Y coordinates where this Tooltip are in the Cult3D window.
 java.lang.String getInfo()
           Returns a string representation of the values of this object.
 java.lang.String getName()
          This method gets the name of this toolitp
 CultObject getNextAssociatedObject()
          Gets the next associated object for this Tooltip.
 Texture getTexture()
          Gets this Tooltips texture.
 boolean isActive()
          Checks if this Tooltip are active.
 boolean isTrackingMouse()
          Checks whether this Tooltips are following the mouse.
 void removeObject(CultObject object)
          Removes the given CultObject from this Tooltip's list over associated objects.
 void setActive(boolean state)
          Activates or deactivates this Tooltip depending on the value of parameter state.
 void setFixedPosition(int x, int y)
          Show this Tooltip on a specific coordinate in the Cult3D window. 0.0 coordinate is at the leftmost upper corner.
 void setFixedPosition(Vector2 position)
          Show this Tooltip on a specific coordinate in the Cult3D Window.
 java.lang.String toString()
           This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementation and versions of Cult3D.
 void trackMouse(boolean status)
          Activates or deactivates the option to let this Tooltip folllow the mouse.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tooltip

public Tooltip(java.lang.String name)
Constructs a Java representation of a Cult3D Tooltip that exists in the scene graph of the Cult3D Designer. The uniqe name of the object, as defined in the Designer, is given as a parameter. Make sure that the spelling of the name is exactly as in the Designer, including any captial letters.
Parameters:
name - The name of the object.
Throws:
NameNotFoundException - if an object with the given name can't be found.
Since:
Cult3D 5.3
Method Detail

getTexture

public Texture getTexture()
Gets this Tooltips texture.
Returns:
This Tooltips texture.
Since:
Cult3D 5.3

isActive

public boolean isActive()
Checks if this Tooltip are active.
Returns:
true if this Tooltip are active, false otherwise.
Since:
Cult3D 5.3

setActive

public void setActive(boolean state)
Activates or deactivates this Tooltip depending on the value of parameter state.
Parameters:
state - Set to true to activate this Tooltip, set to false to deactivate.
Since:
Cult3D 5.3

getFixedPosition

public Vector2 getFixedPosition()
Gets the X Y coordinates where this Tooltip are in the Cult3D window. This method will be ignored if trackMouse() method is activated.
Returns:
The coordinates where this Tooltip are in the cult3D window.
Since:
Cult3D 5.3
See Also:
trackMouse(boolean)

setFixedPosition

public void setFixedPosition(int x,
                             int y)
Show this Tooltip on a specific coordinate in the Cult3D window. 0.0 coordinate is at the leftmost upper corner. This method will be ignored if trackMouse() method is activated.
Parameters:
x - The x coordinate for this Tooltip.
y - The y coordinate for this Tooltip.
Since:
Cult3D 5.3
See Also:
trackMouse(boolean)

setFixedPosition

public void setFixedPosition(Vector2 position)
Show this Tooltip on a specific coordinate in the Cult3D Window. It will be ignored if track mouse are active. The Vector2 values must not have decimals. If they have decimals it will be truncated in Java style.
Parameters:
position - The vector which contains the X Y values for the coordinates.
Since:
Cult3D 5.3
See Also:
trackMouse(boolean)

isTrackingMouse

public boolean isTrackingMouse()
Checks whether this Tooltips are following the mouse.
Returns:
True if this Tooltips is tracking the mouse, false otherwise.
Since:
Cult3D 5.3
See Also:
trackMouse(boolean), getFixedPosition(), setFixedPosition(int, int), setFixedPosition(Vector2)

trackMouse

public void trackMouse(boolean status)
Activates or deactivates the option to let this Tooltip folllow the mouse.
Parameters:
status - If this Tooltip should follow the mouse set this to true, otherwise false.
Since:
Cult3D 5.3
See Also:
isTrackingMouse(), getFixedPosition(), setFixedPosition(int, int), setFixedPosition(Vector2)

getAssociatedObjects

public java.util.Vector getAssociatedObjects()
Gets a list of all registered/associated objects for this Tooltip. It will return an empty java.util.Vector if there are no registered objects.
Returns:
A java.util.Vector which contains all associated objects for this Tooltip
Since:
Cult3D 5.3

getFirstAssociatedObject

public CultObject getFirstAssociatedObject()
Gets the first object which are registed/associated for this Tooltip. Will return null if there are no associated objects.
Returns:
The first associated object for this Tooltip
Since:
Cult3D 5.3
See Also:
getNextAssociatedObject()

getNextAssociatedObject

public CultObject getNextAssociatedObject()
Gets the next associated object for this Tooltip. If there are no more objects associated this method will return null. Be sure to call getFirstAssociatedObject before you call this mehod, otherwise you will get an NullPointerException.
Returns:
The next associated object for this Tooltip.
Throws:
NullPointerException - will occur if you call this method before getFirstAssociatedObject() method.
Since:
Cult3D 5.3
See Also:
getFirstAssociatedObject()

removeObject

public void removeObject(CultObject object)
Removes the given CultObject from this Tooltip's list over associated objects.
Parameters:
object - The CultObject to be removed.
Since:
Cult3D 5.3
See Also:
addObject(CultObject)

addObject

public void addObject(CultObject object)
Add the given CultObject to this Tooltips list over associated objects.
Parameters:
object - The CultObject to be added to this Tooltip's list over associated objects.
Since:
Cult3D 5.3
See Also:
removeObject(CultObject)

getName

public java.lang.String getName()
This method gets the name of this toolitp
Since:
Cult3D 5.3

getInfo

public java.lang.String getInfo()

Returns a string representation of the values of this object.

This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations and versions of Cult3D.

Returns:
A string representing this object.
Since:
Cult3D 5.3

toString

public java.lang.String toString()

This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementation and versions of Cult3D.

Overrides:
toString in class java.lang.Object
Returns:
A string representing this object.