@doc hierarchy="GMLDOM">
Base aspect for zoomable drawings of GML+ models
The zoomable drawing aspect depends on the rules in the following categories:
composition rules
connection rules
drawing rules
editing rules
(c) SAP AG 2003-2006. All rights reserved.
///////////////////////////////////////////////////////////////////////
// ASPECT HEADER
Aspect role ZDrawing : z;
//////////////////////////////////////////////////////////////////
// BOARD CONFIGURATION
Configure BOARDS, COMMANDS, MENUBARS, HOTKEYS
// TODO: the following line is temporary
// (until the GmlScript preprocessor enables writing "implement core.dev:IBoard;" in this declaration unit).
$DOM.attachPrototype('core.dev:IBoard', 'core.svg:ZDrawing');
//////////////////////////////////////////////////////////////////
// DRAWING COMMANDS
$ENV.defineCommand({
id: 'DRAW_FLIP_X',
signal: 'BOARD->flipX()',
text: '#TEXT[XMIT_FLIP_HORIZON]',
icon: '#URL[~skin:icons.flip-x.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_FLIP_Y',
signal: 'BOARD->flipY()',
text: '#TEXT[XMIT_FLIP_VERTICAL]',
icon: '#URL[~skin:icons.flip-y.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_ROTATE_RIGHT',
signal: 'BOARD->rotate(+1)',
text: '#TEXT[XMIT_ROTATE_RIGHT]',
icon: '#URL[~skin:icons.rotate-right.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_ROTATE_LEFT',
signal: 'BOARD->rotate(-1)',
text: '#TEXT[XMIT_ROTATE_LEFT]',
icon: '#URL[~skin:icons.rotate-left.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_SCROLL_DOWN',
signal: 'BOARD->scrollBy(0,+50)',
text: '#TEXT[XMIT_SCROLL_DOWN]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_SCROLL_LEFT',
signal: 'BOARD->scrollBy(-50,0)',
text: '#TEXT[XMIT_SCROLL_LEFT]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_SCROLL_RIGHT',
signal: 'BOARD->scrollBy(+50,0)',
text: '#TEXT[XMIT_SCROLL_RIGHT]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_SCROLL_UP',
signal: 'BOARD->scrollBy(0,-50)',
text: '#TEXT[XMIT_SCROLL_UP]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_OPTIMIZE_SPEED',
signal: 'BOARD->optimizeSpeed()',
text: '#TEXT[XMIT_QUICK_DRAFT]',
icon: '#URL[~skin:icons.optimize-speed.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_OPTIMIZE_QUALITY',
signal: 'BOARD->optimizeQuality()',
text: '#TEXT[XMIT_HIGH_QUALITY]',
icon: '#URL[~skin:icons.optimize-quality.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_CIRCULAR',
signal: 'NYI()',
text: '#TEXT[XMIT_CIRCLE_LAYOUT]',
icon: '#URL[~skin:icons.layout-circular.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_HIERARCHICAL',
signal: 'NYI()',
text: '#TEXT[XMIT_HIERARCHY_LAYOUT]',
icon: '#URL[~skin:icons.layout-hierarchical.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_ORTHOGONAL',
signal: 'NYI()',
text: '#TEXT[XMIT_ORTHOG_LAYOUT]',
icon: '#URL[~skin:icons.layout-orthogonal.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_SYMMETRIC',
signal: 'NYI()',
text: '#TEXT[XMIT_SYMMETRIC_LAYOUT]',
icon: '#URL[~skin:icons.layout-symmetric.gif]',
category: 'DRAWING'
});
$ENV.defineCommand({
id: 'DRAW_LAYOUT_SETTINGS',
signal: '$TSK->openPanel("DRAW_LAYOUT_SETTINGS")',
text: '#TEXT[XGRP_LAYOUT_SETTINGS]',
icon: '#URL[~skin:icons.layout-settings.gif]',
category: 'DRAWING'
});
//////////////////////////////////////////////////////////////////
// DRAWING HOTKEYS
$ENV.defineHotkey('#NS[ZDrawing]', 'C37', 'DRAW_SCROLL_LEFT'); // Ctrl+LEFT
$ENV.defineHotkey('#NS[ZDrawing]', 'C38', 'DRAW_SCROLL_UP'); // Ctrl+UP
$ENV.defineHotkey('#NS[ZDrawing]', 'C39', 'DRAW_SCROLL_RIGHT'); // Ctrl+RIGHT
$ENV.defineHotkey('#NS[ZDrawing]', 'C40', 'DRAW_SCROLL_DOWN'); // Ctrl+DOWN
//////////////////////////////////////////////////////////////////
// MOUSE INTERACTIONS
/*
MOUSE BUTTON MODIFIER OBJECT RESULT
---------- -------- ---------- -------------------- -----------------------------------------------------------------------
CLICK LEFT diagram unselect all
graphic select graphic non-additively
CTRL graphic select graphic additively
-------- ---------- -------------------- -----------------------------------------------------------------------
MIDDLE any enter panning mode
-------- ---------- -------------------- -----------------------------------------------------------------------
RIGHT diagram open diagram context menu
graphic open graphic context menu
---------- -------- ---------- -------------------- -----------------------------------------------------------------------
DBLCLICK LEFT diagram fly into root block
graphic fly into graphic
---------- -------- ---------- -------------------- -----------------------------------------------------------------------
DRAG LEFT diagram draw rubberband and then select the enclosed graphics
graphic move graphic within and/or between blocks
SHIFT graphic move graphic only within containing block
resizing-handle resize graphic
connector-handle enter connection mode
-------- ---------- -------------------- -----------------------------------------------------------------------
MIDDLE any pan viewport
-------- ---------- -------------------- -----------------------------------------------------------------------
RIGHT any draw rubberband and then open a context-menu for the enclosed graphics
---------- -------- ---------- -------------------- -----------------------------------------------------------------------
WHEEL any zoom in/out on point
*/
end