Extensible 3D (X3D) language bindings
Part 2:  Java

Annex C

(normative)

Concrete node interfaces

--- X3D separator bar ---

cube C.1 Introduction and topics

C.1.1 Introduction

This annex provides the definition of the rules to generate interface signature for each interface that represents the concrete node instance as defined in IS0/IEC 19775-1 (see 2.[19775]).

C.1.2 Topics

See Table C.1 for the topics in this clause.

Table C.1 — Topics

--- X3D separator bar ---

cube C.2 Generation rules

C.2.1 Package definition

Each concrete class shall belong to the sub-package name according to the component formal name under the org.web3d.x3d.sai parent package. (See 3.3.1.4 Package Structure)

C.2.2 Class definitions

Concrete node representations in Java shall be expressed as public interfaces.

C.2.3 Class derivation

Each concrete node shall extend the interfaces defined in Annex B as appropriate for the abstract node requirements for each node type. For example, The Inline interface definition is:

    public interface Inline extends X3DChildNode, X3DBoundedObject, X3DUrlObject {
      ...
    }

C.2.4 Method declarations

Within each node interface there shall be methods to read and set the values for every field. The naming convention for each field method shall follow the definition in B.1.2 Conventions for the abstract interfaces. Where fields are already covered by the abstract interface, the concrete interface is not required to redeclare the same methods. The concrete interface shall declare methods that are not defined by the abstract node representation.

--- X3D separator bar ---

cube C.3 Examples

C.3.1 Group

No additional field definitions are required because all fields are covered by the base interfaces.

package org.web3d.x3d.sai.group;

import org.web3d.x3d.sai.*;

public interface Group extends X3DGroupingNode {
}

C.3.2 Text

Text is a type of X3DGeometryNode, which does not have any fields defined in the base node, so all fields must be declared.

package org.web3d.x3d.sai.text;

import org.web3d.x3d.sai.*;

public interface Text extends X3DGeometryNode {
    public void setFontStyle(X3DFontStyleNode node);

    public void setFontStyle(X3DProtoInstance node);

	public X3DNode getFontStyle();

	public void setLength(float[] length);

	public int getNumLength();

	public void getLength(float[] length);

	public void setMaxExtent(float extend);

	public float getMaxExtent();

	public void setString(String[] string);

	public int getNumString();

	public void getString(String[] string);

}

C.3.3 ColorInterpolator

Text is a type of X3DInterpolatorNode, which has some fields defined in the abstract node type as well as some local fields.

package org.web3d.x3d.sai.interpolator;

import org.web3d.x3d.sai.*;

public interface ColorInterpolator extends X3DInterpolatorNode {
    public void setKeyValue(float[] keyValue);

	public int getNumKeyValue();

	public void getKeyValue(float[] keyValue);

	public void getValueChanged(float[] color);
}

--- X3D separator bar ---