Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00016 package com.generalrobotix.ui.view.tdview;
00017
00018 import java.awt.*;
00019 import java.awt.event.*;
00020
00021 import javax.swing.*;
00022
00023 @SuppressWarnings("serial")
00024 public class ResizableCanvas extends JScrollPane {
00025 Canvas canvas_;
00026
00032 public ResizableCanvas(Canvas canvas) {
00033 super(canvas, VERTICAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_NEVER);
00034 canvas_ = canvas;
00035 setBorder(null);
00036
00037 addComponentListener(
00038 new ComponentAdapter() {
00039 public void componentResized(ComponentEvent evt) {
00040 canvas_.setSize(
00041 ResizableCanvas.this.getSize().width,
00042 ResizableCanvas.this.getSize().height
00043 );
00044 }
00045 }
00046 );
00047 }
00048
00054 public Canvas getCanvas() {
00055 return canvas_;
00056 }
00057 }