00001 package gui.Widgets; 00002 00003 import gui.Toolbars.FileChangeListener; 00004 import gui.Toolbars.FileChangePublisher; 00005 00006 import java.awt.TextArea; 00007 00008 import javax.swing.SwingUtilities; 00009 00010 import commandline.NormalMeshAlgorithm.Configuration; 00011 00018 public class BeeldInformatieTextBox extends TextArea implements MyImageDisplayListerner,FileChangeListener, printListener{ 00019 00020 00021 private final static String newline = "\n"; 00022 private Configuration configuration; 00023 public BeeldInformatieTextBox(Configuration configuration) { 00024 this.configuration=configuration; 00025 //this.setBackground(new Color(11,220,250)); 00026 super.setEditable(false); 00027 // Debug.print(this.paramString()); 00028 } 00029 00030 00031 public void setIngelezenBeeld(MyImageDisplay display){ 00032 changeText(); 00033 super.append("dimensions:= " +configuration.getImageDimension().getWidth() +" x " + configuration.getImageDimension().getHeight()); 00034 super.repaint(); 00035 } 00036 00037 00038 public void changeText(){ 00039 super.setText(""); 00040 super.append("name:= " + configuration.getImageName()+ newline); 00041 super.append("size:= " +configuration.getFileSize()/1000f+" Kb" + newline); 00042 } 00043 00044 public void updateFilePath(FileChangePublisher fileChangePublisher){ 00045 changeText(); 00046 super.repaint(); 00047 } 00048 00049 public void printOut(final String s){ 00050 00051 00052 final BeeldInformatieTextBox box=this; 00053 Runnable r =new Runnable(){ 00054 public void run(){ 00055 box.append(s+newline); 00056 box.repaint(); 00057 } 00058 }; 00059 00060 SwingUtilities.invokeLater(r); 00061 00062 00063 00064 00065 00066 } 00067 }
1.5.5