Home » Modeling » Epsilon » Getting links with EGL
| | | |
Re: Getting links with EGL [message #1739370 is a reply to message #1739367] |
Sat, 30 July 2016 20:08   |
Eclipse User |
|
|
|
@gmf.diagram(foo="bar", rcp="false", onefile="true", diagram.extension="ccase")
class CCase {
val Transition[*] transitions;
val Function[*] functions;
}
@gmf.node(label="name", label.text="Function", border.color="43,106,215")
class Function{
@gmf.compartment
val Parameters[*] declarativePart;
@gmf.compartment
val Statements[*] executablePart;
}
@gmf.node(label="name", figure="rectangle", border.width="1", label.icon="true",label.readOnly = "true", label.placement="internal")
class Parameters{
attr String name;
attr ParameterType type;
}
...
@gmf.node(label="description", label.icon="true", label.placement="internal")
abstract class Statements{
attr String description;
attr String code;
}
....
@gmf.link(source="source", target="target", incoming="true", target.decoration="arrow", color="0,0,0", width="1")
class Transition{
attr String name = "Connection";
ref Statements source;
ref Statements target;
}
Basically, inside of "Function" it's possible add many statements and parameters. The parameters can be linked by one Transition. I have to know where the diagram starts and the order of the statements linked.
|
|
| | | | | | | | | |
Re: Getting links with EGL [message #1746594 is a reply to message #1746521] |
Tue, 01 November 2016 10:30   |
Eclipse User |
|
|
|
Hi Dimitris,
#1It's definitely something that I'l like to do.
#2 This is my .emf file updated:
@namespace(uri="crystal", prefix="crystal")
package crystal;
@gmf.diagram(foo="bar", rcp="false", onefile="true", diagram.extension="crystal")
class Crystal {
val Transition[*] transitions;
val SelectorTransition[*] selectorTransitions;
val Procedure[*] procedures;
val Function[*] functions;
val AnonymousBlock[*] blocks;
}
//Subprograms
@gmf.node(figure="rectangle", border.width="1", label.readOnly = "true")
abstract class Subprograms{
attr String name;
}
@gmf.node(label="name", label.text="Procedure", border.color="255,13,13") //vermelho
class Procedure extends Subprograms {
@gmf.compartment
val Parameters[*] declarativePart;
@gmf.compartment
val Parameters[*] parameters;
@gmf.compartment
val Statements[*] executablePart;
}
@gmf.node(label="name", label.text="Function", border.color="25,191,108") //azul
class Function extends Subprograms {
@gmf.compartment
val Parameters[*] declarativePart;
@gmf.compartment
val Parameters[*] parameters;
@gmf.compartment
val Parameters[1] returnPart;
@gmf.compartment
val Statements[*] executablePart;
}
@gmf.node(label="name", label.text="Anonymous Block", border.color="43,106,215", border.style="dash") //verde
class AnonymousBlock extends Subprograms {
@gmf.compartment
val Parameters[*] declarativePart;
@gmf.compartment
val Statements[*] executablePart;
}
//Parameters
@gmf.node(label="name", figure="rectangle", border.width="1", label.icon="true",label.readOnly = "true", label.placement="internal")
abstract class Parameters{
attr String name;
attr ParameterType type;
}
@gmf.node(label.text="Data Type")
class DataType extends Parameters{
attr String className ="DataType";
attr DataTypeOptions options;
attr int precision = 1;
attr int scale = 0;
}
@gmf.node(label.text="Collection")
class Collections extends Parameters{
attr String className ="Collection";
attr String code = "TYPE name IS TABLE OF NUMBER INDEX BY VARCHAR2(20)";
attr String typeName = "collectionTypeName";
}
@gmf.node(label.text="Record")
class Records extends Parameters{
attr String className ="Record";
attr String code = "TYPE recordType IS RECORD (id number(5), name varchar2(25), lastName tableA.last_name%type)";
attr String typeName = "recordTypeName";
}
@gmf.node(label.text="Cursor")
class Cursor extends Parameters {
attr String className ="Cursor";
attr String cursorQuery = "selectStatement";
}
//Statements
@gmf.node(label="description", label.icon="true", label.placement="internal")
abstract class Statements{
attr String description = "Description";
attr boolean isStart;
}
@gmf.node(figure="rectangle")
class Expression extends Statements {
attr String className ="Expression";
attr String value = "Type the expression here";
}
@gmf.node(figure="rectangle")
class Exception extends Statements{
attr String className ="Exception";
attr String code = "EXCEPTION WHEN no_data_found THEN DBMS_OUTPUT.PUT_LINE('There isnt data registered')";
}
@gmf.node(figure="rectangle")
class If extends Statements{
attr String className ="If";
attr String condition = "Type the IF condition";
@gmf.compartment
val Statements[*] ifs;
@gmf.compartment
val Statements[*] elses;
}
@gmf.node(figure="rectangle")
class Case extends Statements{
attr String className ="Case";
@gmf.compartment
val Selector[*] cases;
}
@gmf.node(figure="rectangle", label="description", label.icon="true", label.placement="internal")
class Selector {
attr String className = "Selector";
attr String condition = "Type the condition for this Selector";
attr String description = "Description";
@gmf.compartment
val Statements[*] caseStatements;
}
@gmf.node(figure="rectangle")
class Insert extends Statements{
attr String className ="Insert";
attr String code = "INSERT INTO tableA (id, name) VALUES (1, 'example')";
}
@gmf.node(figure="rectangle")
class Update extends Statements{
attr String className ="Update";
attr String code = "UPDATE tableA SET name = 'example' WHERE id = 1";
}
@gmf.node(figure="rectangle")
class Delete extends Statements{
attr String className ="Delete";
attr String code = "DELETE FROM tableA WHERE ID = 1";
}
@gmf.node(figure="rectangle")
class Select extends Statements{
attr String className ="Select";
attr String code = "SELECT * FROM tableA WHERE id = 1";
}
@gmf.node(figure="rectangle")
class While extends Statements{
attr String className ="While";
attr String condition = "Type the WHILE condition";
@gmf.compartment
val Statements[*] whileStatements;
}
@gmf.node(figure="rectangle")
class For extends Statements{
attr String className ="For";
attr String counter = "Type the name of the FOR counter";
attr ForCounter typeCounter;
attr int lowestNumber = 0;
attr int highestNumber = 0;
@gmf.compartment
val Statements[*] forStatements;
}
@gmf.node(figure="rectangle")
class Loop extends Statements{
attr String className ="Loop";
attr String breakCondition = "Type the break condition for LOOP";
@gmf.compartment
val Statements[*] loopStatements;
}
@gmf.node(figure="rectangle")
class Open extends Statements{
attr String className ="Open";
attr String cursorName = "cursorName";
}
@gmf.node(figure="rectangle")
class Fetch extends Statements{
attr String className ="Fetch";
attr String cursorName = "cursorName";
attr String variableName = "variableCursor";
}
@gmf.node(figure="rectangle")
class Close extends Statements{
attr String className ="Close";
attr String cursorName = "cursorName";
}
@gmf.node(figure="rectangle")
class CallProcedure extends Statements{
attr String className ="CallProcedure";
attr String nameSubroutine;
}
@gmf.node(figure="rectangle")
class CallFunction extends Statements{
attr String className ="CallFunction";
attr String nameSubroutine;
}
@gmf.link(source="source", target="target", incoming="true", target.decoration="arrow", color="0,0,0", width="1", label="name", label.text="Statement Connection", label.icon="true")
class Transition{
attr String name = "Statement Connection";
ref Statements source;
ref Statements target;
}
@gmf.link(source="source", target="target", incoming="true", target.decoration="arrow", color="0,0,0", width="1", label="name", label.text="Case Connection", label.icon="true")
class SelectorTransition{
attr String name = "Case Connection";
ref Selector source;
ref Selector target;
}
enum ParameterType {
IN = 0;
OUT = 1;
IN_OUT = 2;
}
enum ForCounter {
NORMAL = 0;
REVERSE = 1;
}
enum DataTypeOptions {
CHAR = 0;
NCHAR = 1;
NVARCHAR2 = 2;
VARCHAR2 = 3;
LONG = 4;
RAW = 5;
LONG_RAW = 6;
NUMBER = 7; //can modify the precision and scale
NUMERIC = 8; //can modify the precision and scale
FLOAT = 9;
DEC = 10; //can modify the precision and scale
DECIMAL = 11; //can modify the precision and scale
INTEGER = 12;
INT = 13;
SMALLINT = 14;
REAL = 15;
DOUBLE = 16;
DATE = 17;
TIMESTAMP_WITH_TIME_ZONE = 18;
TIMESTAMP_WITH_LOCAL_TIME_ZONE = 19;
INTERVAL_YEAR_TO_MONTH = 20;
INTERVAL_DAY_TO_SECOND = 21;
BFILE = 22;
BLOB = 23;
CLOB = 24;
NCLOB = 25;
ROWID = 26;
UROWID = 27;
}
Cheers.
|
|
| | | |
Re: Getting links with EGL [message #1752340 is a reply to message #1752338] |
Sun, 22 January 2017 06:19  |
Eclipse User |
|
|
|
Actually, this seems to be quite straightforward. You need to locate the Polyline Decoration that corresponds to the arrow of interest in your .gmfgraph model and turn its line kind to LINE_DASH. If you do this manually, you'll then need to right-click on your .gmfmap model and select "Create generator model ..." and then right-click on your .gmfgen and select "Generate diagram code".
Cheers,
Dimitris
|
|
|
Goto Forum:
Current Time: Wed Jul 23 15:36:14 EDT 2025
Powered by FUDForum. Page generated in 0.06994 seconds
|