src/org/math/plot/DataPanel.java

00001 package org.math.plot;
00002 
00003 import java.awt.*;
00004 import java.awt.event.*;
00005 import java.io.*;
00006 
00007 import javax.swing.*;
00008 
00009 import org.math.io.*;
00010 import org.math.plot.components.*;
00011 
00018 public abstract class DataPanel extends JPanel implements ComponentListener, FilePrintable, ClipBoardPrintable, StringPrintable {
00019 
00020         protected DataToolBar toolBar;
00021 
00022         protected JScrollPane scrollPane;
00023 
00024         public static int[] dimension = new int[] { 400, 400 };
00025 
00026         public DataPanel() {
00027                 setLayout(new BorderLayout());
00028                 initToolBar();
00029                 init();
00030         }
00031 
00032         protected void initToolBar() {
00033                 toolBar = new DataToolBar(this);
00034                 add(toolBar, BorderLayout.NORTH);
00035                 toolBar.setFloatable(false);
00036         }
00037 
00038         protected void initSize() {
00039                 scrollPane.setSize(this.getSize());
00040                 // scrollPane.setPreferredSize(this.getSize());
00041         }
00042 
00043         protected void init() {
00044                 // initSize();
00045                 addComponentListener(this);
00046         }
00047 
00048         public void update() {
00049                 // this.remove(scrollPane);
00050                 toWindow();
00051                 repaint();
00052         }
00053 
00054         protected abstract void toWindow();
00055 
00056         public abstract void toClipBoard();
00057 
00058         public abstract void toASCIIFile(File file);
00059 
00060         public void componentHidden(ComponentEvent e) {
00061         }
00062 
00063         public void componentMoved(ComponentEvent e) {
00064         }
00065 
00066         public void componentResized(ComponentEvent e) {
00067                 /*
00068                  * dimension = new int[] { (int) (this.getSize().getWidth()), (int)
00069                  * (this.getSize().getHeight()) };
00070                  */
00071                 initSize();
00072         }
00073 
00074         public void componentShown(ComponentEvent e) {
00075         }
00076 
00077 }

Generated on Wed Sep 5 21:44:01 2007 for jmathplot by  doxygen 1.5.1