Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: experimental/webgtt/javascript/edge.js

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/webgtt/javascript/canvas.js ('k') | experimental/webgtt/javascript/graph.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/webgtt/javascript/edge.js
diff --git a/experimental/webgtt/javascript/edge.js b/experimental/webgtt/javascript/edge.js
deleted file mode 100644
index 2b5f12379b597c17c325f834fbf6cd19b862337e..0000000000000000000000000000000000000000
--- a/experimental/webgtt/javascript/edge.js
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2011 The Native Client Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be found
-// in the LICENSE file.
-
-/**
- * @fileoverview This file contains the JavaScript required for the WebGTT
- * application, specifically, the implementation of the Edge class. This
- * implementation provides functions for creating, selecting, coloring, and
- * drawing an edge.
- *
- * @author ragad@google.com (Raga Gopalakrishnan)
- */
-
-/**
- * This constant holds the size used to draw an edge.
- * @type {number}
- * @const
- */
-var EDGE_SIZE = 4;
-
-/**
- * This class is used to represent an edge of the graph.
- *
- * @param {object} start Reference to the object representing the start vertex.
- * @param {object} end Reference to the object representing the end vertex.
- * @constructor
- */
-Edge = function (start, end) {
- this.start = start;
- this.end = end;
-
- /**
- * This boolean variable indicates whether the edge is selected or not.
- */
- this.isSelected = false;
-
- /**
- * This variable stores the color used while drawing the edge on the canvas.
- */
- this.color = 'black';
-};
-
-/**
- * This function sets the value of Edge.isSelected.
- *
- * @param {boolean} isSelected The value to be assigned to Edge.isSelected.
- */
-Edge.prototype.setSelected = function (isSelected) {
- this.isSelected = isSelected;
-};
-
-/**
- * This function sets the value of Edge.color.
- *
- * @param {string} color The value to be assigned to Edge.color.
- */
-Edge.prototype.setColor = function (color) {
- this.color = color;
-};
-
-/**
- * This function draws the edge on the canvas, with a specified color and
- * line width.
- *
- * @param {object} drawingContext The handle to the drawing surface of the
- * canvas.
- * @param {string} color The color with which the edge is to be drawn.
- * @param {number} lineWidth The width with which the edge is to be drawn.
- */
-Edge.prototype.drawSpecific = function (drawingContext, color, lineWidth) {
- drawingContext.strokeStyle = color;
- drawingContext.lineWidth = lineWidth;
- drawingContext.beginPath();
- drawingContext.moveTo(this.start.x, this.start.y);
- drawingContext.lineTo(this.end.x, this.end.y);
- drawingContext.closePath();
- drawingContext.stroke();
-};
-
-/**
- * This function draws the edge on the canvas.
- *
- * The edge is drawn as a line from (start.x,start.y) to (end.x,end.y) with
- * size (thickness) specified by EDGE_SIZE. If isSelected is true, a thicker
- * red line is also drawn, to indicate that the edge is selected.
- *
- * @param {object} drawingContext The handle to the drawing surface of the
- * canvas.
- */
-Edge.prototype.draw = function (drawingContext) {
- this.drawSpecific(drawingContext, this.color, EDGE_SIZE);
- if (this.isSelected) {
- this.drawSpecific(drawingContext, 'red', 3*EDGE_SIZE/2);
- }
-};
« no previous file with comments | « experimental/webgtt/javascript/canvas.js ('k') | experimental/webgtt/javascript/graph.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698