ResizableCanvas.java
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * General Robotix Inc.
8  * National Institute of Advanced Industrial Science and Technology (AIST)
9  */
16 package com.generalrobotix.ui.view.tdview;
17 
18 import java.awt.*;
19 import java.awt.event.*;
20 
21 import javax.swing.*;
22 
23 @SuppressWarnings("serial")
24 public class ResizableCanvas extends JScrollPane {
25  Canvas canvas_;
26 
32  public ResizableCanvas(Canvas canvas) {
33  super(canvas, VERTICAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_NEVER);
34  canvas_ = canvas;
35  setBorder(null);
36 
37  addComponentListener(
38  new ComponentAdapter() {
39  public void componentResized(ComponentEvent evt) {
40  canvas_.setSize(
41  ResizableCanvas.this.getSize().width,
42  ResizableCanvas.this.getSize().height
43  );
44  }
45  }
46  );
47  }
48 
54  public Canvas getCanvas() {
55  return canvas_;
56  }
57 }
#define null
our own NULL pointer
Definition: IceTypes.h:57


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat May 8 2021 02:42:40