Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 709579925a6fe0457369f2b74d8c6598615e09d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
modeltype genModel uses "http://www.eclipse.org/gmf/2008/GenModel";

library ViewmapAttributesUtils;

helper isStoringChildPositions(layoutType : genModel::ViewmapLayoutType) : Boolean {
	return genModel::ViewmapLayoutType::XY_LAYOUT = layoutType
}

helper isFixedFont(viewmap : genModel::Viewmap) : Boolean {
	return null <> viewmap and (viewmap.attributes)[genModel::StyleAttributes]->exists(e | e.fixedFont)
}

helper isFixedForeground(viewmap : genModel::Viewmap) : Boolean {
	return null <> viewmap and (viewmap.attributes)[genModel::StyleAttributes]->exists(e | e.fixedForeground)
}

helper isFixedBackground(viewmap : genModel::Viewmap) : Boolean {
	return null <> viewmap and (viewmap.attributes)[genModel::StyleAttributes]->exists(e | e.fixedBackground)
}

helper getResizeConstraints(viewmap : genModel::Viewmap) : genModel::ResizeConstraints {
	return (if null = viewmap then null else (viewmap.attributes)[genModel::ResizeConstraints]->first().oclAsType(genModel::ResizeConstraints) endif)
}

helper getDefaultSizeAttributes(viewmap : genModel::Viewmap) : genModel::DefaultSizeAttributes {
	return (if null = viewmap then null else (viewmap.attributes)[genModel::DefaultSizeAttributes]->first().oclAsType(genModel::DefaultSizeAttributes) endif)
}

helper defaultSizeWidth(viewmap : genModel::Viewmap, defaultValue : Integer) : Integer {
	return let a = getDefaultSizeAttributes(viewmap) in (if null = a then defaultValue else a.width endif)
}

helper defaultSizeHeight(viewmap : genModel::Viewmap, defaultValue : Integer) : Integer {
	return let a = getDefaultSizeAttributes(viewmap) in (if null = a then defaultValue else a.height endif)
}

helper getLabelOffsetAttributes(viewmap : genModel::Viewmap) : genModel::LabelOffsetAttributes {
	return (if null = viewmap then null else (viewmap.attributes)[genModel::LabelOffsetAttributes]->first().oclAsType(genModel::LabelOffsetAttributes) endif)
}

helper labelOffsetX(viewmap : genModel::Viewmap, defaultValue : Integer) : Integer {
	return let a = getLabelOffsetAttributes(viewmap) in (if null = a then defaultValue else a.x endif)
}

helper labelOffsetY(viewmap : genModel::Viewmap, defaultValue : Integer) : Integer {
	return let a = getLabelOffsetAttributes(viewmap) in (if null = a then defaultValue else a.y endif)
}

Back to the top