This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Function that handles the drawing of a circle using the triangle fan | |
| * method. This will create a filled circle. | |
| * | |
| * Params: | |
| * x (GLFloat) - the x position of the center point of the circle | |
| * y (GLFloat) - the y position of the center point of the circle | |
| * radius (GLFloat) - the radius that the painted circle will have | |
| */ | |
| void drawFilledCircle(GLfloat x, GLfloat y, GLfloat radius){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Address < ActiveRecord::Base | |
| belongs_to :addressable, :polymorphic => true | |
| validates :addressable, :presence => true | |
| validates :street_1, :presence => true | |
| validates :city, :presence => true | |
| validates :state, :presence => true, :length => { :minimum => 2 } | |
| validates :zip_code, :presence => true, :zipcode_format => true, :length => { :minimum => 5, :maximum => 10 } | |
| validates :country, :presence => true | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test "should create camp" do | |
| assert_difference('Camp.count') do | |
| post :create, :camp => { | |
| :name => "Camp Tester", | |
| :uri => "test-camp", | |
| :email_address => "test@test.com", | |
| :address => { | |
| :street_1 => "mccormick rd", | |
| :city => "barrer", | |
| :state => "MA", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float x = (float) getLocation().getX() / width; | |
| float y = (float) (height - getLocation().getY()) / height; | |
| float w = (float) getSize().getWidth() / width; | |
| float h = (float) getSize().getHeight() / | |
| float radius = (w < h) ? w : h; | |
| gl.glBegin(GL2.GL_TRIANGLE_FAN); | |
| gl.glVertex2f(x, y); | |
| for(int i = 0; i<360; i+=5){ | |
| gl.glVertex2f(x + (float)Math.sin(i) * radius, y + (float)Math.cos(i) * radius); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| //set up your widget | |
| dojo.declare("MyTable", dijit._Widget, { | |
| postCreate: function(){ | |
| this.inherited(arguments); | |
| //initialize your default state... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| //set up your widget | |
| dojo.declare("MyTable", dijit._Widget, { | |
| /* | |
| * An example of a Refresh method in a widget | |
| */ | |
| refresh: function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function updateTheWidget(){ | |
| var newData = getData() // handles the xhr request to retrieve the new set of data | |
| theWidget.attr("data", newData); //update the widget with the new set of data | |
| theWidget.refresh(); //refresh the widget UI | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| //set up your widget | |
| dojo.declare("MyTable", dijit._Widget, { | |
| //initiation methods for your widget | |
| destroy: function(){ | |
| //destroy your child widgets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //================== | |
| // Track a widget | |
| //================== | |
| var actionButtons = new ActionButtons(); //ActionButtons now needs to be destroyed!! | |
| this._childWidgets.push(actionButtons); | |
| //================== | |
| // Track an event handler | |
| //================== | |
| var handle = dojo.connect( /*your params*/ ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| //set up your widget | |
| dojo.declare("MyTable", dijit._Widget, { | |
| constructor: function(args){ | |
| //other stuff to instantiate | |
| this._childWidgets = []; |