name java_demo
startup otk_java
toolkit object
creo_type parametric
java_app_class MyJavaApp
java_app_classpath <full path to the application classes
and archives>
java_app_start start
java_app_stop stop
allow_stop true
delay_start true
text_dir <path to text directory used by
message and menu related commands>
end| • | name—Assigns a unique name to this Creo Object TOOLKIT Java application. The name identifies the application when there is more than one in the creotk.dat or protk.dat file. The maximum size of the name is 31 characters for the name, plus the end-of-string character. |
| • | startup—Specifies the method Creo should use to communicate with the Creo Object TOOLKIT Java application. For Creo Object TOOLKIT Java applications, set startup to otk_java. |
| • | toolkit—Specifies the name of the Toolkit which was used to create the customization. The valid values for this field are object and protoolkit. An application created in Creo Object TOOLKIT Java must always have the value of this field set as object.
Note
This field can also be used to indicate other toolkits. Its default value is protoolkit, which specifies that the customizing application was created in Creo TOOLKIT. If you set the value for this field as protoolkit, or omit this field, then the application can be used only with Creo Parametric.
|
| • | creo_type—Specifies the Creo applications that support the Creo Object TOOLKIT Java applications. The valid values for this field are:
Note
Other Creo applications will be supported in future releases.
|
| • | java_app_class—Specifies the fully qualified package and name of a Java class. This class contains the Creo Object TOOLKIT Java application’s start and stop methods. |
| • | java_app_classpath—An optional field to specify the full path to the Creo Object TOOLKIT Java application jar file. Refer to the section CLASSPATH Variables for more information on the other available mechanisms to set the CLASSPATH. This field has a character limit of 2047 wide characters (wchar_t). |
| • | java_app_start—Specifies the start method of your program. See the section Start and Stop Methods for more information. |
| • | java_app_stop—Specifies the stop method of your program. See the section Start and Stop Methods for more information. |
| • | allow_stop—Stops the application during the session if it is set to true. If this field is missing or set to false, you cannot stop the application, regardless of how it was started. |
| • | delay_start—Enables you to choose when to start the Creo Object TOOLKIT Java application if it is set to true. Creo application does not start the Creo Object TOOLKIT Java application during startup. If this field is missing or is set to false, the Creo Object TOOLKIT Java application starts automatically. |
| • | text_dir—Specifies the location of the text directory that contains the language-specific directories. The language-specific directories contain the message files, menu files, resource files and UI bitmaps in the language supported by the Creo Object TOOLKIT Java application. The files must be located under a directory called text or text/<language>, if localized messages are used in the application. This field has a character limit of 2047 wide characters (wchar_t). |
| • | rbn_path—Specifies the name of the ribbon file along with its path, which must be loaded when you open the Creo application. The location of the ribbon file is relative to the location of the text directory. The field text_dir specifies the path for the text directory. If the field is not specified, by default, the ribbon file with its location, text_dir/toolkitribbonui.rbn is used.
|
| • | end—Indicates the end of the description of the Creo Object TOOLKIT Java application. You can define multiple Creo Object TOOLKIT Java applications in the registry files. All these applications are started by Creo application. |
| 1. | A file called creotk.dat or protk.dat in the current directory |
| 2. | A file named in a creotk.dat, protk.dat, or toolkit_registry_file statement in theCreo application configuration file |
| 3. | A file called creotk.dat or protk.dat in the directory <creo_loadpoint>\<version>\Common Files\<machine type>\text\<language> |
| 4. | A file called creotk.dat or protk.dat in the directory <creo_loadpoint>\<version>\Common Files\text |
| • | <creo_loadpoint>—The Creo loadpoint (not the Creo Object TOOLKIT Java loadpoint) |
| • | <machine type>—The machine-specific subdirectory such as x86e_win64 or i486_nt |
| • | <language>—The language of Creo application with which the Creo Object TOOLKIT Java application is used such as usascii (English), german, or japanese |
| 1. | From the Creo Parametric toolbar, select . |
| 2. | Choose the name of the application. |
| 3. | Click Start.
|
| • | Associate and run a Creo Object TOOLKIT Java application with a model |
| • | Create a JAR file for Model-Program Dependency |
| 1. | Load the solid model that you want to associate and run with the Creo Object TOOLKIT Java application. |
| 2. | From the PART or ASSEMBLY menu, select . |
| 3. | If the application is stored in a Java archive (JAR) file, click Add File in the Model Programs dialog box and add the JAR file to the list of Java archive files. If the application is stored in a .class file proceed to the next step. |
| 4. | Click Add and enter the following information in the Java Application Properties dialog box:
|
jar cvf0 myjar.jar *.java *.classpublic static void startMyProgram()
{
runMyUtilities();
configureMyModels();
addMyUI();
}
public static void stop() {
cleanupModels();
outputToPrinterFiles();
}