Home | History | Annotate | Download | only in resources

Lines Matching defs:Key

33      * @type {Array<Key>}
44 * Add a key to the keyset.
46 add: function(key) {
47 this.keys.push(key);
63 * Searches the tree for the key closest to the point provided.
66 * @return {?kb-key} The key, or null if none found.
70 var key = closestNode.data;
71 if (!key)
74 return key.distanceTo(x, y) <= MAX_TOUCH_FUZZ_DISTANCE ?
75 key.key : null;
83 return this.keys.map(function(key) {
84 return key.toMap();
90 * Container for caching a key's data.
92 * height: number}}} key The key to cache.
93 * left: The x-coordinate of the left edge of the key.
94 * top: The y-coordinate of the top edge of the key.
95 * width: The width of the key in px.
96 * height: The height of the key in px.
99 var Key = function(key) {
100 this.key = key;
101 var style = key.style;
109 Key.prototype = {
111 * Manhattan distance from the the provided point to the key.
122 * Checks whether the key intersects with the line provided.
134 * Returns the Key as a map.
172 test: function(key) {
173 // Key already provides an intersect method. If the key is to the right of
174 // the line, then the line is to the left of the key.
175 return -1 * key.intersect(this);
221 * @param {Array{Key}} The child elements.
283 * Tests whether the key belongs in the left or right branch of this node.
284 * @param {Key} key The key being tested.
287 test: function(key) {
288 return this.decision.testKey(key);
331 * Returns the minimum edge on the key.
332 * @param {Key} key The key.
335 var getMin = function(key) {
336 return orientation == Orientation.HORIZONTAL ? key.top : key.left;
340 * Returns the maximum edge on the key.
341 * @param {Key} key The key.
343 var getMax = function(key) {
344 return orientation == Orientation.HORIZONTAL ? key.bottom : key.right;
376 var key = allKeys[i];
377 var min = getMin(key);
378 var max = getMax(key);
391 var key = allKeys[i];
392 var min = getMin(key);
393 var max = getMax(key);
403 // Key can span multiple edges.
434 layout.add(new Key(nodes[k]));