Model Components

Model Components are classified into
  1. Primitives,
  2. Collections,
  3. UI DataModel,

 

Primitive DataTypes


Int, short, long, byte, float, double, char, boolean, String are primitive data types.

To use these model drag and drop the component into the right panel. 

 

 
If you want to create arrays, vectors etc, choose Model Factory.
  1. Open Model Factory and Select Data Manipulation 
  2. Open the XML Structure ( .DML )( DML - Data Markup Language ) 
  3. Click Add button and enter data 
  4. Save the Data ( .DAT ) 

 
 
Open Model Factory and Select Data Manipulation

 

Open Model Factory and Select Data Manipulation 
Top
Open the XML Structure ( .DML )( DML - Data Markup Language )

 

Open the XML Structure ( .DML )( DML - Data Markup Language )
Top
Click Add button and enter data

 

Click Add button and enter data
Top
Save the Data ( .DAT )

 

Save the Data ( .DAT )
Top

 

Collections

 

A collection represents a group of objects, known as its elements.

Code Generation Components

There are three types of Code generation methods. They are

Check out the Examples of each using Arrays,

  1. Direct Initialization
  2. InLine Initialization
  3. Separate Method
 
Method : Direct Initialization



1. Choosing "Direct Initialization" option constructs a Collection component (array, Vector or Hashtable) from Model component ("sc.dml"). The Collection component placed under Declaration part of the generated Code.

//Declare Datamembers ..

//Collections ...

//Direction Initialization

String[] MyArray = { "Sun Microsystems",
"Apt Solutions",
"IBM Inc" };

Top
Method : InLine Initialization


Choosing "InLine Initialization" option constructs & returns a Collection component (as array, Vector or Hashtable ) during runtime from ModelComponent. This option requires CockTail.jar. The ClassPath should be set to CockTail. The following code will be placed under Constructor part of the generated Code.

//Constructor ...
//InLine Initialization ...

DataFrame MyArray2dataFrame = null;
try{
       MyArray2dataFrame = new DataFrame("/C:/cocktail//project/SC.dat");
}catch(Exception ge){System.out.println("File can't Open");}

String[] MyArray2 = MyArray2dataFrame.getListStringModel();
String[] MyArray2colNames = MyArray2dataFrame.getColNames("/C:/raju/cocktail//project/SC");

Top
Method : Separate Method

Choosing "Separte Method" option constructs & returns a Method. That Method returns as required Collection component (as array, Vector or Hashtable ) during runtime from ModelComponent. This option requires CockTail.jar. The ClassPath should be set to CockTail.jar The Method code will be placed under Method area of the generated Code.  

 // Methods ...
 public String[] arr3Method(){
 String[] arr3colNames;
 String[] arr3;
 DataFrameBean dataFrameBean = null;
 Vector rowData = new Vector();
  try{
          AppDoc appDoc = new AppDoc("/C:/cocktail//project/SC.dml");
       Vector vector = appDoc.getDataModel();
       dataFrameBean = (DataFrameBean)vector.get(0);
          rowData = dataFrameBean.load("/C:/cocktail//project/SC.dat");

      }catch(Exception ge){System.out.println(ge);}

       String[] tempString = new String[rowData.size()];
       for(int i = 0;i<rowData.size();i++)
       tempString[i] = (String)((Vector)rowData.elementAt(i)).elementAt(0);
       arr3 = tempString;
       arr3colNames = dataFrameBean.getColNames();
 return arr3;
}
 

Top
UI DataModel

 

  1. List Model - Returns a List Model from the Model Component(.dml)
  2. Table Model - Returns a Table Model from the Table Component(.dml)
  3. Tree Model - Returns a Tree Model from the Tree Component(.dml)
Top