Add a visual to the canvas, and build its program by the same
        occasion.

        We can't build the visual's program before, because we need the canvas'
        transforms first.
18082
def add_visual(self, visual):
        
        # Retrieve the visual's GLSL inserter.
        inserter = visual.inserter
        # Add the visual's transforms.
        inserter.add_transform_chain(visual.transforms)
        # Then, add the canvas' transforms.
        canvas_transforms = visual.canvas_transforms_filter(self.transforms)
        inserter.add_transform_chain(canvas_transforms)
        # Also, add the canvas' inserter.
        inserter += self.inserter
        # Now, we insert the transforms GLSL into the shaders.
        vs, fs = visual.vertex_shader, visual.fragment_shader
        vs, fs = inserter.insert_into_shaders(vs, fs)
        # Finally, we create the visual's program.
        visual.program = gloo.Program(vs, fs)
        logger.log(5, "Vertex shader: %s", vs)
        logger.log(5, "Fragment shader: %s", fs)
        # Initialize the size.
        visual.on_resize(self.size)
        # Register the visual in the list of visuals in the canvas.
        self.visuals.append(visual)
        self.events.visual_added(visual=visual)
5466
function(model) {
      var t = this,
          componentView = new ComponentView({model: model});
      componentView.$el
        .addClass('nm-pv-component')
        .data('view', componentView);
      componentView.render();
      t.canvas.append(componentView.$el);
      t.componentViews[model.get('id')] = componentView;
    }
288196
private void addNewTracks() {
//		System.out.println("----------- Adding new tracks ---------------");

		tracker.spawnTracks();
		List<PointTrack> spawned = tracker.getNewTracks(null);

		// estimate 3D coordinate using stereo vision
		for( PointTrack t : spawned ) {
			Point2D3DTrack p = t.getCookie();
			if( p == null) {
				t.cookie = p = new Point2D3DTrack();
			}

			// discard point if it can't localized
			if( !pixelTo3D.process(t.x,t.y) || pixelTo3D.getW() == 0 ) {
				tracker.dropTrack(t);
			} else {
				Point3D_F64 X = p.getLocation();

				double w = pixelTo3D.getW();
				X.set(pixelTo3D.getX() / w, pixelTo3D.getY() / w, pixelTo3D.getZ() / w);

				// translate the point into the key frame
				// SePointOps_F64.transform(currToKey,X,X);
				// not needed since the current frame was just set to be the key frame

				p.lastInlier = tick;
				pixelToNorm.compute(t.x, t.y, p.observation);
			}
		}
	}
531749
def add_widget(self, wid, index=0, canvas=None):
        
        super().add_widget(wid, index, canvas)
        if not hasattr(wid, 'group'):
            return
        wid._no_use_canvas = True
        mycanvas = (
            self.canvas.before if canvas == 'before' else
            self.canvas.after if canvas == 'after' else
            self.canvas
        )
        mycanvas.remove(wid.canvas)
        pawncanvas = (
            self.board.spotlayout.canvas.before if canvas == 'before' else
            self.board.spotlayout.canvas.after if canvas == 'after' else
            self.board.spotlayout.canvas
        )
        for child in self.children:
            if hasattr(child, 'group') and child.group in pawncanvas.children:
                pawncanvas.remove(child.group)
            pawncanvas.add(child.group)
        self.pospawn(wid)
1268668
function(px) {
        var newPx = this.clone();
        if (px) {
            newPx = this.add(px.x, px.y);
        }
        return newPx;
    }
708146
def update(self, figure):
        

        if hasattr(self, "figure_canvas"):
            self.figure_canvas.Destroy()

        self.figure_canvas = self._get_figure_canvas(figure)

        self.figure_canvas.SetSize(self.GetSize())
        figure.subplots_adjust()

        self.main_sizer.Add(self.figure_canvas, 1,
                            wx.EXPAND | wx.FIXED_MINSIZE, 0)

        self.Layout()
        self.figure_canvas.draw()
770625
def redraw(self):
        
        if self._multiscat is not None:
            self._multiscat._update()
        self.vispy_widget.canvas.update()
434156
def build(self):
        
        for cls, data_list in self._items.items():
            # Some variables are not concatenated. They are specified
            # in `allow_list`.
            data = _accumulate(data_list, cls.allow_list)
            box_index = data.pop('box_index')
            visual = cls()
            self.add_visual(visual)
            visual.set_data(**data)
            # NOTE: visual.program.__contains__ is implemented in vispy master
            # so we can replace this with `if 'a_box_index' in visual.program`
            # after the next VisPy release.
            if 'a_box_index' in visual.program._code_variables:
                visual.program['a_box_index'] = box_index.astype(np.float32)
        # TODO: refactor this when there is the possibility to update existing
        # visuals without recreating the whole scene.
        if self.lasso:
            self.lasso.create_visual()
        self.update()
368213
public void draw() {
		//=================================================================
		//Now plot the STP with the Utility.PlotSTPTemporalModule class
		//=================================================================
		PlotSTPTemporalModule view;
		Toolkit tk = Toolkit.getDefaultToolkit();
		int xSize = ((int) tk.getScreenSize().getWidth());
		int ySize = ((int) tk.getScreenSize().getHeight());
		//int ySize = 500;

		//GIVE tm TO VISIUALIZER		
		view = new PlotSTPTemporalModule(this, xSize, ySize);
		JFrame myFrame = new JFrame("Simple Temporal Network");

		Container pane = myFrame.getContentPane();
		pane.setLayout(new BorderLayout());
		pane.add(view, BorderLayout.NORTH);
		myFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

		myFrame.setSize(xSize,ySize);

		myFrame.pack();
		myFrame.setVisible(true);

		view.touchLBUBNodes();
		//=================================================================
		//End STP plotting
		//=================================================================
	}
533215
def add_view(self, view):
        

        self.add_child(view)
        self.views.append(view)
186743
def paint(self, p, *args):
        '''
          
        '''
        if self.picturenotgened:
            self.generatePicture(self.getBoundingParents()[0].rect())
            self.picturenotgened = False
        pg.ImageItem.paint(self, p, *args)
        self.generatePicture(self.getBoundingParents()[0].rect())
942437
public void addNavButtons()
    {
        ResourceBundle resources = ((BaseApplication)this.getTask().getApplication()).getResources(ResourceConstants.PROGRAM_RESOURCE, true);
        new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, MenuConstants.GROUP, ClassProject.RESOURCE_DETAIL_SCREEN, resources.getString(ClassProject.RESOURCE_DETAIL_SCREEN));
        new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, MenuConstants.DISTRIBUTION, ClassProject.CLASS_DETAIL_SCREEN, resources.getString(ClassProject.CLASS_DETAIL_SCREEN));
        super.addNavButtons();
    }
720941
function(htOption) {
        this._bIsPainted = false;
        this._htOption = htOption;
        this._elCanvas = new Canvas(htOption.size, htOption.size);
        //this._elCanvas.width = htOption.size;
        //this._elCanvas.height = htOption.size;
        this._oContext = this._elCanvas.getContext('2d');
        //this._oContext = this._elCanvas.getContext("2d");
        this._bIsPainted = false;
        this._bSupportDataURI = null;
        this._callback = htOption.callback;
        this._bindElement = htOption.bindElement;
    }
764751
public void recreate() {
    int newSize = noxItems.size();
    WeakReference<Bitmap> newBitmaps[] = new WeakReference[newSize];
    Drawable newDrawables[] = new Drawable[newSize];
    Drawable newPlaceholders[] = new Drawable[newSize];
    boolean newLoadings[] = new boolean[newSize];
    ImageLoader.Listener newListeners[] = new ImageLoader.Listener[newSize];
    float length = Math.min(bitmaps.length, newSize);
    for (int i = 0; i < length; i++) {
      newBitmaps[i] = bitmaps[i];
      newDrawables[i] = drawables[i];
      newPlaceholders[i] = placeholders[i];
      newLoadings[i] = loading[i];
      newListeners[i] = listeners[i];
    }
    bitmaps = newBitmaps;
    drawables = newDrawables;
    placeholders = newPlaceholders;
    loading = newLoadings;
    listeners = newListeners;
  }
927075
def add_subvisual(self, visual):
        
        visual.transforms = self.transforms
        visual._prepare_transforms(visual)
        self._subvisuals.append(visual)
        visual.events.update.connect(self._subv_update)
        self.update()
1158525
function add(v) {
         return this._set(this._x + v.x, this._y + v.y, this._z + (v.z || 0));
       }
308107
function() {
        var c = this._canvas;
        c.width = Crafty.viewport.width;
        c.height = Crafty.viewport.height;

        var gl = this.context;
        gl.viewportWidth = c.width;
        gl.viewportHeight = c.height;
    }