Package jme3utilities
Class MyControl
java.lang.Object
jme3utilities.MyControl
Utility methods that operate on jME3 scene-graph controls in general. If
physics controls might be present, use the corresponding methods in Minie's
MyControlP class instead.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanDisable(com.jme3.scene.control.Control sgc) Check whether a scene-graph control implements isEnabled() and setEnabled().static Stringdescribe(com.jme3.scene.control.Control control) Generate a textual description of the specified scene-graph control.static StringdescribeType(com.jme3.scene.control.Control control) Describe the type of a scene-graph control.static intfindIndex(com.jme3.scene.control.Control sgc, com.jme3.scene.Spatial spatial) Find the index of the specified scene-graph control in the specified spatial.static com.jme3.animation.SkeletonfindSkeleton(com.jme3.scene.control.Control sgc) Access the skeleton (if any) in the specified scene-graph control.static voidinsertAt(com.jme3.scene.Spatial spatial, int index, com.jme3.scene.control.Control sgc) Deprecated.static booleanisEnabled(com.jme3.scene.control.Control sgc) Test whether the specified scene-graph control is enabled.static voidsetEnabled(com.jme3.scene.control.Control sgc, boolean newState) Alter the enabled state of a scene-graph control.
-
Method Details
-
canDisable
public static boolean canDisable(com.jme3.scene.control.Control sgc) Check whether a scene-graph control implements isEnabled() and setEnabled().- Parameters:
sgc- control to test (may be null, unaffected)- Returns:
- true if it's implemented, otherwise false
-
describe
Generate a textual description of the specified scene-graph control.- Parameters:
control- the instance to describe (not null, unaffected)- Returns:
- a description (not null, not empty)
-
describeType
Describe the type of a scene-graph control.- Parameters:
control- instance to describe (not null, unaffected)- Returns:
- description (not null)
-
findIndex
public static int findIndex(com.jme3.scene.control.Control sgc, com.jme3.scene.Spatial spatial) Find the index of the specified scene-graph control in the specified spatial.- Parameters:
sgc- scene-graph control to find (not null, unaffected)spatial- where the control was added (not null, unaffected)- Returns:
- index (≥0) or -1 if not found
-
findSkeleton
public static com.jme3.animation.Skeleton findSkeleton(com.jme3.scene.control.Control sgc) Access the skeleton (if any) in the specified scene-graph control.- Parameters:
sgc- which scene-graph control (may be null, unaffected)- Returns:
- the pre-existing instance, or null if none found
-
insertAt
@Deprecated public static void insertAt(com.jme3.scene.Spatial spatial, int index, com.jme3.scene.control.Control sgc) Deprecated.useSpatial.addControlAt(int, com.jme3.scene.control.Control)Add the specified Control at the specified position in thecontrolslist of the specified Spatial.- Parameters:
spatial- the Spatial to add to (not null, modified)index- the index at which to add the Control (≥0)sgc- the Control to add (not null)
-
isEnabled
public static boolean isEnabled(com.jme3.scene.control.Control sgc) Test whether the specified scene-graph control is enabled.- Parameters:
sgc- the control to test (not null, unaffected)- Returns:
- true if the control is enabled, otherwise false
-
setEnabled
public static void setEnabled(com.jme3.scene.control.Control sgc, boolean newState) Alter the enabled state of a scene-graph control.- Parameters:
sgc- control to alter (not null)newState- true means enable the control, false means disable it
-
Spatial.addControlAt(int, com.jme3.scene.control.Control)