| API specifications of NAB framework June 21, 2006 |
Contents
|
Chapter 5 NAB Framework API Reference
This chapter explains the following classes as the NAB Framework API reference:
- NtkManager(Framework Manager)
- INtkInitializer(Toolkit Initializer)
- NtkEventCallbackManager(Callback Manager)
- INtkContext(Toolkit Context Manager)
- INtkProjectManager(Project Manager)
- INtkInstanceManager(Toolkit Instance Manager)
5.1 NtkManager(Framework Manager)
(NTK management classes)
NtkManager retains entities of the NTK initialization class, context management class, instance management class, project management class, and event callback class.
The NAB Framework user acquires instances of these management classes through NtkManager.
|
Method name |
Outline |
|
static void setNtkInitializer(INtkInitializer inst) |
Sets an entity of the NTK initialization class in NtkManager. |
|
static void setNtkContext(INtkContext inst) |
Sets an entity of the NTK context management class in NtkManager. |
|
static void setNtkInstanceManager(INtkInstanceManager inst) |
Sets an entity of the NTK instance management class in NtkManager. |
|
static void setNtkProjectManager(INtkProjectManager inst) |
Sets an entity of the NTK project management class in NtkManager. |
|
static NtkEventCallbackManager getEventCallbackManager() |
Acquires an instance of the NTK event callback management class. * Returns the event callback manager belonging to the NTK initialization class. |
|
static synchronized void ntkInitialize() |
Initializes an NTK. An instance of the appropriate NTK initialization class must be set before it is called. |
|
static boolean isInitialized() |
Acquires information on whether an NTK was initialized. |
|
static void setSyncDisplay(Display disp) |
Sets an SWT display resource for synchronization with SWT. The set display resource is delivered to the NTK initialization class for use. |
|
static Display getSyncDisplay() |
Acquires an SWT display resource for synchronization with SWT, and returns the display resource delivered to the NTK initialization class. |
|
static INtkContext getNtkContext() |
Acquires an entity of the NTK context management class from NtkManager. |
|
static INtkInstanceManager getNtkInstanceManager() |
Acquires an entity of the NTK instance management class from NtkManager. |
|
static INtkProjectManager getNtkProjectManager() |
Acquires an entity of the NTK project management class from NtkManager. |
5.2 INtkInitializer(Toolkit Initializer)
INtkInitializer defines the interface for NTK initialization processing in NAB Framework.
An instance of the implementation class of this interface is set in NtkManager, and it operates under the control of NtkManager.
Implementation example: MwtInitializer
|
Method name |
Outline |
|
NtkEventCallbackManager getEventCallbackManager() |
Acquires NtkEventCallbackManager. The NAB Framework user uses this EventCallbackManager through NtkManager. Usually, processing to return NtkEventCallbackManager() is described in the implementation class. |
|
void initialize() |
Executes the NTK initialization process. Usually, processing to initialize the presently used toolkit is described in the implementation class. |
|
void setSyncDisplay(Display disp) |
Sets an SWT display resource for synchronization with SWT. |
|
Display getSyncDisplay() |
Acquires an SWT display resource for synchronization with SWT. |
|
boolean isInitialized() |
Returns information on whether an NTK was initialized. |
|
void kill() |
Executes NTK end process. Usually, processing to end an NTK is described in the implementation class. |
5.3 NtkEventCallbackManager(Callback Manager)
This class provides a framework for callback operations in NAB Framework in response to a call from an NTK event. (A listener function for NTKs is provided.)
The event (character string that defines a name) and the name of the Java function to be used must be specified. After they are specified, the specified Java function is called at the time the NTK event is thrown.
|
Method name |
Outline |
|
void delProc(int no) |
Deletes the callback of the specified ID. |
|
long addProc(String trigger, Object inst, String method, Object par) |
Sets an event name and the callback function. |
|
void execProc(String trigger) |
Sets an event name and executes the callback function. |
5.4 INtkContext(Toolkit Context Manager)
INtkContext defines the interface used to manage each NTK status in NAB Framework.
An instance of the implementation class of this interface is set in NtkManager, and it operates under the control of NtkManager.
Implementation example: MwtContext
|
Method name |
Outline |
|
int lock() |
Enables calling from SWT by locking an NTK thread when calling the NTK. Processing to stop the NTK main loop and to stop an NTK thread to prevent contention is described in the implementation class. |
|
int unlock() |
Unlocks a locked NTK thread to start an NTK operation when calling the NTK. Processing to release the NTK main loop stopped by the lock() interface to prevent contention is described in the implementation class. |
|
int execEventProc(String procName) |
Issues an NTK event. Processing to generate an event corresponding to a defined character string for an NTK is described in the implementation class. |
5.5 INtkProjectManager(Project Manager)
INtkProjectManager defines the interface used to manage project information required for building an NTK application in NAB Framework.
An instance of the implementation class of this interface is set in NtkManager, and it operates under the control of NtkManager.
Implementation example: MwtProjectManager
Generally, the following interfaces can be used:
- Interfaces related to projects
- Interfaces related to fixed information settings
- Interfaces related to project operations
Table: Interfaces related to projects
|
Method name |
Outline |
|
String getProjectDefaultData(long prj,String var,int encoding) |
Acquires the default value of the specified project. In the implementation class, the interface is implemented to acquire default information corresponding to the specified project information from an NTK, and it returns this value in the form of a String-type value. |
|
String getProjectData(long prj,String var,int encoding) |
Acquires the value of the specified project information. In the implementation class, the interface is implemented to acquire information corresponding to the specified project information from an NTK, and it returns this value in the form of a String-type value. |
|
int setProjectData(long prj,String var,String val,int encodeing) |
Sets the value specified for project information in the form of a String-type value. In the implementation class, the interface is implemented to set the String-type information specified for NTK project information. |
|
String getCurrentProjectFullPath() |
Acquires the full path name of the current project. |
|
String getProjectPath() |
Acquires the path name of the current project. |
|
void setCurrentProjectName(String name) |
Sets a name for the current project. |
|
String getCurrentProjectName() |
Acquires the project name of the current project. |
|
long getCurrentProject() |
Acquires the NTK project ID of the current project. |
|
int getCurrentProjectLangType() |
Acquires the language type of the current project. |
Table: Interfaces related to fixed information settings
|
Method name |
Outline |
|
long getStaticData(int kind,long id) |
Acquires the fixed information specified by ID (Long type) in the form of a Long-type value. In the implementation class, the interface is implemented to acquire information corresponding to the specified fixed information from an NTK, and it returns this value in the form of a Long-type value. |
|
String getStaticData(int kind,long id,int encoding) |
Acquires the fixed information specified by ID (Long type) in the form of a String-type value. In the implementation class, the interface is implemented to acquire information corresponding to the specified fixed information from an NTK, and it returns this value in the form of a String-type value. |
|
String getStaticData(int kind,String key,int encoding) |
Acquires the fixed information specified by String type in the form of a String-type value. In the implementation class, the interface is implemented to acquire information corresponding to the specified fixed information from an NTK, and it returns this value in the form of a String-type value. |
|
String getEnvironmentData(String key,int encoding) |
Acquires the environment information specified by String type in the form of a String-type value. In the implementation class, the interface is implemented to acquire information corresponding to the specified environment information from an NTK and returns this value in the form of a String-type value. |
|
int setEnvironmentData(String key,String val,int encoding) |
Sets the environment information specified by String type in the form of a String-type value. In the implementation class, the interface is implemented to set information corresponding to the specified environment information for an NTK in the form of a String-type value. |
|
int saveEnvironmentData() |
Saves environment information. In the implementation class, the interface is implemented to save environment information for an NTK. |
Table: Interfaces related to project operations
|
Method name |
Outline |
|
int doOperation(long prj,int kind) |
Performs the specified type of operation for a project. In the implementation class, the operation for the project is implemented for the operation type. |
|
void closeNtkProject(IProject prj) |
Closes the NTK project corresponding to the specified project. In the implementation class, the interface is implemented to close the project whose information is specific to an NTK not under the control of Eclipse and that corresponds to the specified Eclipse project. |
|
void saveNtkProject(IProject prj) |
Saves the NTK project corresponding to the specified project. In the implementation class, the interface is implemented to save project information specific to an NTK not under the control of Eclipse. |
|
void saveCurrentNtkProject() |
Saves the current NTK project. In the implementation class, the interface is implemented to save project information specific to an NTK not under the control of Eclipse. |
|
void createCurrentNtkProjectSources() |
Saves the current NTK project. In the implementation class, the interface is implemented to create the source code corresponding to a project specific to an NTK. |
|
long loadNtkProject(String prj_name,IProject prj) |
Reads the NTK project corresponding to the specified project. In the implementation class, the interface is implemented to read corresponding project information specific to an NTK. |
|
long createNewNtkProject(String prj_name) |
Creates an NTK project with the specified name. In the implementation class, the interface is implemented to create a project specific to an NTK, using the specified name. |
|
void configureNtkProject(IProject prj,String lang) |
Customizes the specified NTK project. In the implementation class, a specific builder and specific characteristics are set to identify the NTK project. |
|
int createProcedure(String dirname,String filename,int langType,String functionName,String classname) |
Creates a template procedure in the specified directory. |
5.6 INtkInstanceManager(Toolkit Instance Manager)
INtkInsntanceManager defines the interface used to access NTK instance information required for building an NTK application in NAB Framework.
An instance of the implementation class of this interface is set in NtkManager, and it operates under the control of NtkManager.
Implementation example: MwtInstanceManager
Generally, the following interfaces can be used:
- Interfaces related to file input/output of instance information
- Interfaces related to creating/discarding instances
- Interfaces related to instance management
- Interfaces related to instance operation and information acquisition settings
- Interfaces related to event procedures
Table: Interfaces related to file input/output of instance information
|
Method name |
Outline |
|
long readInstanceDataFile(String folder,String fname,int flag) |
Reads instance information from the specified file. |
|
int saveInstanceDataFile(String path,long inst,int encoding) |
Writes instance information to the specified file. |
|
int loadLibrary(String libname) |
Reads the library of the specified name. |
Table: Interfaces related to creating/discarding instances
|
Method name |
Outline |
|
int setNewInstanceClassName(String className) |
Sets a name for the NTK class to be created. |
|
long getNewInstance(String className,String instanceName,long parent) |
Acquires the ID of a created NTK instance. |
|
int deleteInstance(long inst) |
Deletes the interface specified in inst. |
|
long getInstance(String className,String instanceName) |
Acquires the NTK instance ID of the specified class name and instance name. |
|
long checkInstanceName(long id,String name) |
Checks whether the instance of the specified ID has the correct name. |
|
long checkProcedureName(String pname) |
Checks whether a name is correct as a procedure name. |
|
int setNewInstancePositionMode(boolean fl) |
Sets whether the mode enables an instance to be created with mouse operations. |
|
int pasteInstance(long inst,long inst2) |
Copies the instance specified in inst2 and pastes it over the instance specified in inst. |
Table: Interfaces related to instance management
|
Method name |
Outline |
|
void setSelectedInstance(long inst) |
Sets the selected instance ID. |
|
boolean existInstance(long inst) |
Checks whether an instance is correct. If it is correct, a true value is returned. |
|
int setInstanceId(int kind, long id) |
Sets an instance ID for the specified management information. |
|
long getInstanceId(long id, int kind,long val) |
Acquires the instance ID that is set in the specified information. |
|
int setupInstance(long inst) |
Initializes an instance. |
|
String getInstanceData(long id,int kind,long val,int encode) |
Removes instance information from the specified management information. |
|
ArrayList setCopyList(ArrayList inst) |
Sets a list of instances to be copied. |
|
ArrayList getCopyList() |
Sets a list of instances to be copied. |
|
ArrayList setDeleteList(ArrayList inst) |
Sets a list of instances to be deleted. |
|
ArrayList getDeleteList() |
Acquires a list of instances to be deleted. |
Table: Interfaces related to instance operation and information acquisition settings
|
Method name |
Outline |
|
int redraw(long inst) |
Redraws the specified instance. |
|
int getInstanceType(long inst) |
Acquires the instance type. |
|
String getClassName(long inst) |
Acquires an instance class name. |
|
int setProperty(long inst, String prop,int val) |
Sets a property value of the int type for an instance. |
|
int setProperty(long inst, String prop,String val) |
Sets a property value of the String type for an instance. |
|
int getProperty(long inst, String prop) |
Acquires a property value of an instance in the form of an int-type value. |
|
String getProperty(long inst, String prop, int encoding) |
Acquires a property of an instance in the form of a String-type value. |
|
boolean existProperty(long inst, String prop) |
Checks whether a property exists. When the return value is "true," this indicates that the property exists. |
|
boolean existTrigger(long id, int trig) |
Checks whether a trigger exists. When the return value is "true," this indicates that the trigger exists. |
|
int getExtTriggerList(long id,ArrayList namelist,ArrayList trglist) |
Acquires a list of extension triggers. |
|
int setUserLongData(long inst,String prop,long val) |
Sets a Long value for an instance. |
|
long getUserLongData(long inst,String prop) |
Acquires the Long value that is set for an instance. |
|
int setUserStringData(long inst, String prop,String val) |
Sets a String value for an instance. |
|
String getUserStringData(long inst, String prop) |
Acquires the String value that is set for an instance. |
|
int setVisible(long inst,boolean fl) |
Sets the instance display status. |
|
Long getParentWindow(long inst) |
Acquires the parent window of an instance. |
|
Long getParent(long inst) |
Acquires the parent instance of an instance. |
Table: Interfaces related to event procedure settings
|
Method name |
Outline |
|
int addProcedure(long id, String procedureName, String functionName, int triggerNum) |
Sets another event procedure for an instance. It returns a procedure ID. |
|
int delProcedure(long id,long procid) |
Deletes the event procedure that is set for an instance and has the specified procedure ID. |
|
int configureProcedure(long procId,String procedureName, String functionName, int triggerNum) |
Sets again the event procedure that is set for an instance and has the specified procedure ID. |
|
String getProcedureName(long procId) |
Acquires the procedure name of the event procedure whose procedure ID is specified. |
|
String getFunctionName(long procId) |
Acquires the procedure function name of the event procedure whose procedure ID is specified. |
|
int getTrigger(long procId) |
Acquires the trigger of the event procedure whose procedure ID is specified. |
|
String getProcedureAttribute(long procId,String attr) |
Acquires the attribute value of the event procedure whose procedure ID is specified. |
|
int setProcedureName(long procId,String pname) |
Sets a procedure name. |
|
int setFunctionName(long procId,String fname) |
Sets a procedure function name. |
|
int setTrigger(long procId,int trigger) |
Sets a trigger. |
|
int setProcedureAttribute(long procId,String attr,String val) |
Sets a procedure attribute. |
Contents
|


