[SCM] GeoGebra: Dynamic mathematics software for education branch, patch/version, updated. upstream/3.2.47.0+dfsg1-129-g7881af7

Giovanni Mascellani mascellani at poisson.phc.unipi.it
Sat Dec 24 09:35:27 UTC 2011


The following commit has been merged in the patch/version branch:
commit 7881af7c63327d3dc7507d83c6148912d1574756
Merge: b2cf8d2030a80923ce5f57d595260c7675e201e9 87975a17a0cae2bceae76ca9d1d68ba6799db207
Author: Giovanni Mascellani <mascellani at poisson.phc.unipi.it>
Date:   Wed Dec 7 17:42:47 2011 +0100

    Merge commit 'refs/top-bases/patch/version' into patch/version
    
    Conflicts:
    	geogebra/GeoGebra.java
    	geogebra/GeoGebraAppletPreloader.java
    	geogebra/gui/menubar/MenubarImpl.java
    	geogebra/main/Application.java

diff --combined geogebra/GeoGebra.java
index fed2a9a,f25403d..86c3333
--- a/geogebra/GeoGebra.java
+++ b/geogebra/GeoGebra.java
@@@ -19,42 -19,56 +19,59 @@@ import java.net.URL
  public class GeoGebra extends Object {
  	
  	// GeoGebra version
- 	public static final String BUILD_DATE = "June 03, 2011";
- 	
- 	public static final String VERSION_STRING = "3.2.47.0";
- 	public static final String SHORT_VERSION_STRING = "3.2"; // used for online archive
+ 	public static final String BUILD_DATE = "30 November 2011";
+ 	public static final String VERSION_STRING = "4.0.13.0"; 
+ 	public static final String SPLASH_STRING = "splash40.png";
+ 	public static final String PREFERENCES_ROOT = "/geogebra40";
+ 	public static final String SHORT_VERSION_STRING = "4.0"; // used for online archive
+ 	public static final boolean CAS_VIEW_ENABLED = false;
+ 	public static final boolean IS_PRE_RELEASE = !VERSION_STRING.endsWith(".0");
 -	
 +
 +	// Debian version
 +	public static final String DEBIAN_VERSION_STRING = GeoGebraDebian.DEBIAN_VERSION_STRING;
 +		
  	// File format versions
- 	public static final String XML_FILE_FORMAT = "3.2";
- 	public static final String I2G_FILE_FORMAT = "1.00.20080731";
+ 	public static final String XML_FILE_FORMAT = "4.0";
+ 	public static final String GGB_XSD_FILENAME = "ggb.xsd"; // for ggb files
+ 	public static final String GGT_XSD_FILENAME = "ggt.xsd"; // for macro files 
+ 	public static final String I2G_FILE_FORMAT = "0.1.20080731";
  	
  	// pre-releases and I2G
- 	public static final boolean IS_PRE_RELEASE = !VERSION_STRING.endsWith(".0");
- 	public static final boolean DISABLE_I2G = true;
+ 	public static final boolean DISABLE_I2G = !IS_PRE_RELEASE;	
  
  	// URLs
- 	public final static String GEOGEBRA_ONLINE_ARCHIVE_BASE = "http://www.geogebra.org/webstart/" + SHORT_VERSION_STRING +"/";
+ 	public final static String GEOGEBRA_ONLINE_ARCHIVE_BASE = "http://www.geogebra.org/webstart/" + SHORT_VERSION_STRING + "/";
+ 	public final static String GEOGEBRA_ONLINE_WEBSTART_BASE = "http://www.geogebra.org/webstart/" + SHORT_VERSION_STRING + "/";
+ 	public final static String GEOGEBRA_ONLINE_WEBSTART_BASE_ALTERNATIVE = "http://jars.geogebra.org/webstart/" + SHORT_VERSION_STRING + "/";
  	public static final String LOADING_GIF = "http://www.geogebra.org/webstart/loading.gif";
  	public final static String GEOGEBRA_WEBSITE = "http://www.geogebra.org/";
+ 	public final static String HELP_URL = GEOGEBRA_WEBSITE + "help";
+ 	public final static String GEOGEBRATUBE_WEBSITE = "http://www.geogebratube.org/";
  	
  	// max possible heap space for applets in MB
  	public final static int MAX_HEAP_SPACE = 512;
  	
-     public static void main(String[] args) {  
- 
-     	Frame splashFrame = null;
+ 	public static Frame splashFrame = null;
+ 	
+     public static void main(String[] cmdArgs) {  
+ 		CommandLineArguments args = new CommandLineArguments(cmdArgs);
+ 				
      	boolean showSplash = true;
-     	for (int i = 0 ; i < args.length ; i++) {
-     		if (args[i].equals("--showSplash=false")) showSplash = false;
-     		else if (args[i].equals("--help")) showSplash = false;
+     	if(!args.getBooleanValue("showSplash", true)) {
+     		showSplash = false;
+     	}
+     	
+     	if(args.containsArg("help")||args.containsArg("v")) {
+     		showSplash = false;
      	}
+ 
+ 	if(args.containsArg("regressionFile")) {
+ 		showSplash = false;
+ 	}
      	
      	if (showSplash) {
      	  // Show splash screen
- 		  URL imageURL = GeoGebra.class.getResource("/geogebra/splash.png");
+ 		  URL imageURL = GeoGebra.class.getResource("/geogebra/"+SPLASH_STRING);
  		  if (imageURL != null) {
  		      splashFrame = SplashWindow.splash(
  		          Toolkit.getDefaultToolkit().createImage(imageURL)
@@@ -77,9 -91,9 +94,9 @@@
  		  if (splashFrame != null) splashFrame.setVisible(false);
      }
      
-     private static void startGeoGebra(String [] args) {
+     private static void startGeoGebra(CommandLineArguments args) {
      	// create and open first GeoGebra window        	
      	geogebra.gui.app.GeoGebraFrame.main(args);
      }
      
--}
++}
diff --combined geogebra/GeoGebraAppletPreloader.java
index 51a66e5,d8de89d..2929722
--- a/geogebra/GeoGebraAppletPreloader.java
+++ b/geogebra/GeoGebraAppletPreloader.java
@@@ -11,19 -11,18 +11,19 @@@ public class GeoGebraAppletPreloader ex
  
  	public void init() {
  		setBackground(Color.white);
 -		System.out.println("GeoGebraAppletPreloader " + GeoGebra.VERSION_STRING + " started");
 +		System.out.println("GeoGebraAppletPreloader " + GeoGebra.VERSION_STRING
- 				+ " (Debian package " + GeoGebra.DEBIAN_VERSION_STRING + " started");
- 		loadAllJarFiles();
++				+ " (Debian package " + GeoGebra.DEBIAN_VERSION_STRING + ") started");
+ 		loadAllJarFiles(true);
  	}
  	
  	/**
  	 * Loads all jar files in a background task. 
  	 */
- 	public static void loadAllJarFiles() {
+ 	public static void loadAllJarFiles(final boolean loadJavaScriptJAR) {
  		Thread jarLoader = new Thread() {
  			public void run() {
  				// touch on file in all jar files to force loading
- 				
+ 
  				// load main jar
  				System.out.print("loading geogebra_main.jar... ");
  				System.out.flush();
@@@ -32,6 -31,21 +32,21 @@@
  					System.out.println("done");
  				} catch (Exception e) {
  					System.out.println("failed");
+ 				} catch (Throwable e) {
+ 					System.out.println("failed");
+ 				}
+ 				System.out.flush();
+ 				
+ 				// load main jar
+ 				System.out.print("loading geogebra_algos.jar... ");
+ 				System.out.flush();
+ 				try {
+ 					geogebra.kernel.discrete.AlgoVoronoi.class.getClass();
+ 					System.out.println("done");
+ 				} catch (Exception e) {
+ 					System.out.println("failed");
+ 				} catch (Throwable e) {
+ 					System.out.println("failed");
  				}
  				System.out.flush();
  				
@@@ -43,6 -57,8 +58,8 @@@
  					System.out.println("done");
  				} catch (Exception e) {
  					System.out.println("failed");
+ 				} catch (Throwable e) {
+ 					System.out.println("failed");
  				}
  				System.out.flush();
  				
@@@ -50,10 -66,12 +67,12 @@@
  				System.out.print("loading geogebra_gui.jar... ");
  				System.out.flush();
  				try {
- 					geogebra.gui.DefaultGuiManager.class.getClass();
+ 					geogebra.gui.GuiManager.class.getClass();
  					System.out.println("done");
  				} catch (Exception e) {
  					System.out.println("failed");
+ 				} catch (Throwable e) {
+ 					System.out.println("failed");
  				}
  				System.out.flush();
  				
@@@ -68,6 -86,8 +87,8 @@@
  						System.out.println("not found");
  				} catch (Exception e) {
  					System.out.println("not found");
+ 				} catch (Throwable e) {
+ 					System.out.println("not found");
  				}
  				System.out.flush();
  				
@@@ -79,8 -99,64 +100,64 @@@
  					System.out.println("done");
  				} catch (Exception e) {
  					System.out.println("failed");
+ 				} catch (Throwable e) {
+ 					System.out.println("failed");
  				}
  				System.out.flush();
+ 				
+ 				// load jlatexmath jar
+ 				System.out.print("loading jlatexmath.jar... ");
+ 				System.out.flush();
+ 				try {
+ 					org.scilab.forge.jlatexmath.TeXFormula.class.getClass();
+ 					System.out.println("done");
+ 				} catch (Exception e) {
+ 					System.out.println("failed");
+ 				} catch (Throwable e) {
+ 					System.out.println("failed");
+ 				}
+ 				System.out.flush();
+ 				
+ 				// load jlm_greek jar
+ 				System.out.print("loading jlm_greek.jar... ");
+ 				System.out.flush();
+ 				try {
+ 					org.scilab.forge.jlatexmath.greek.GreekRegistration.class.getClass();
+ 					System.out.println("done");
+ 				} catch (Exception e) {
+ 					System.out.println("failed");
+ 				} catch (Throwable e) {
+ 					System.out.println("failed");
+ 				}
+ 				System.out.flush();
+ 				
+ 				// load jlm_cyrillic jar
+ 				System.out.print("loading jlm_cyrillic.jar... ");
+ 				System.out.flush();
+ 				try {
+ 					org.scilab.forge.jlatexmath.cyrillic.CyrillicRegistration.class.getClass();
+ 					System.out.println("done");
+ 				} catch (Exception e) {
+ 					System.out.println("failed");
+ 				} catch (Throwable e) {
+ 					System.out.println("failed");
+ 				}
+ 				System.out.flush();
+ 				
+ 				if (loadJavaScriptJAR) {
+ 					// load javascript jar
+ 					System.out.print("loading geogebra_javascript.jar... ");
+ 					System.out.flush();
+ 					try {
+ 						org.mozilla.javascript.Context.class.getClass();
+ 						System.out.println("done");
+ 					} catch (Exception e) {
+ 						System.out.println("failed");
+ 					} catch (Throwable e) {
+ 						System.out.println("failed");
+ 					}
+ 					System.out.flush();
+ 				}
  			}
  		};
  		jarLoader.start();
diff --combined geogebra/gui/menubar/GeoGebraMenuBar.java
index 6f56a45,6991e2c..d6529df
--- a/geogebra/gui/menubar/GeoGebraMenuBar.java
+++ b/geogebra/gui/menubar/GeoGebraMenuBar.java
@@@ -1,119 -1,353 +1,355 @@@
- package geogebra.gui.menubar;
- 
- import geogebra.kernel.Kernel;
- import geogebra.main.Application;
- 
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- 
- public class GeoGebraMenuBar extends MenubarImpl implements Menubar, ActionListener {
- 
- 	public GeoGebraMenuBar(Application app) {
- 		super();
- 		this.app = app;
- 		kernel = app.getKernel();
- 	}
- 
- 	public void actionPerformed(ActionEvent event) {
- 		String cmd = event.getActionCommand();
- 		
- 		// change angle unit
- 		if (cmd.equals("Degree")) {
- 			kernel.setAngleUnit(Kernel.ANGLE_DEGREE);
- 			kernel.updateConstruction();
- 			app.setUnsaved();
- 		} else if (cmd.equals("Radiant")) {
- 			kernel.setAngleUnit(Kernel.ANGLE_RADIANT);
- 			kernel.updateConstruction();
- 			app.setUnsaved();
- 		}
- 
- 		// change graphics quality
- 		else if (cmd.equals("LowQuality")) {
- 			app.getEuclidianView().setAntialiasing(false);
- 		} else if (cmd.equals("HighQuality")) {
- 			app.getEuclidianView().setAntialiasing(true);
- 		}
- 
- 		// font size
- 		else if (cmd.endsWith("pt")) {
- 			try {
- 				app.setFontSize(Integer.parseInt(cmd.substring(0, 2)));
- 				app.getGuiManager().updateSpreadsheetColumnWidths();
- 				app.setUnsaved();
- 				System.gc();
- 			} catch (Exception e) {
- 				app.showError(e.toString());
- 			}
- 			;
- 		}
- 		
- 		// decimal places
- 		else if (cmd.endsWith("decimals")) {
- 			try {
- 				String decStr = cmd.substring(0,2).trim();							
- 				int decimals = Integer.parseInt(decStr);
- 				//Application.debug("decimals " + decimals);
- 				
- 				kernel.setPrintDecimals(decimals);				
- 				kernel.updateConstruction();
- 				app.refreshViews();
- 				
- 				// see ticket 79
- 				kernel.updateConstruction();
- 				
- 				app.setUnsaved();
- 				app.storeUndoInfo();
- 			} catch (Exception e) {
- 				app.showError(e.toString());
- 			}			
- 		}
- 
- 		// significant figures
- 		else if (cmd.endsWith("figures")) {
- 			try {
- 				String decStr = cmd.substring(0,2).trim();							
- 				int figures = Integer.parseInt(decStr);
- 				//Application.debug("figures " + figures);
- 				
- 				kernel.setPrintFigures(figures);
- 				kernel.updateConstruction();
- 				app.refreshViews();
- 				
- 				// see ticket 79
- 				kernel.updateConstruction();
- 				
- 				app.setUnsaved();
- 				app.storeUndoInfo();
- 			} catch (Exception e) {
- 				app.showError(e.toString());
- 			}			
- 		}
- 
- 		// Point capturing
- 		else if (cmd.endsWith("PointCapturing")) {
- 			int mode = Integer.parseInt(cmd.substring(0, 1));
- 			app.getEuclidianView().setPointCapturing(mode);
- 			app.setUnsaved();
- 		}
- 
- 		// Continuity
- 		else if (cmd.endsWith("Continuity")) {
- 			boolean state = cmd.startsWith("true");
- 			kernel.setContinuous(state);
- 			kernel.updateConstruction();
- 			app.setUnsaved();
- 		}
- 		
- 		
- 		// Labeling
- 		else if (cmd.endsWith("labeling")) {
- 			int style = Integer.parseInt(cmd.substring(0, 1));
- 			app.setLabelingStyle(style);
- 			app.setUnsaved();
- 		}
- 		
- 	}
- 	
- 	
- }
+ package geogebra.gui.menubar;
+ 
+ import geogebra.GeoGebra;
+ import geogebra.gui.layout.DockManager;
+ import geogebra.gui.layout.Layout;
+ import geogebra.kernel.Kernel;
+ import geogebra.main.Application;
+ import geogebra.main.GeoGebraPreferences;
+ 
+ import java.awt.BorderLayout;
+ import java.awt.Font;
+ import java.awt.SystemColor;
+ import java.awt.Toolkit;
+ import java.awt.datatransfer.StringSelection;
+ import java.awt.event.ActionEvent;
+ import java.awt.print.PageFormat;
+ import java.awt.print.Printable;
+ import java.io.File;
+ import java.io.FileNotFoundException;
+ import java.util.Scanner;
+ 
+ import javax.swing.AbstractAction;
+ import javax.swing.BorderFactory;
+ import javax.swing.JButton;
+ import javax.swing.JDialog;
+ import javax.swing.JLabel;
+ import javax.swing.JMenuBar;
+ import javax.swing.JOptionPane;
+ import javax.swing.JPanel;
+ import javax.swing.JScrollPane;
+ import javax.swing.JTextArea;
+ 
+ public class GeoGebraMenuBar extends JMenuBar {
+ 	private static final long serialVersionUID = 1736020764918189176L;
+ 
+ 	private BaseMenu fileMenu, editMenu, viewMenu, perspectivesMenu, optionsMenu, toolsMenu, windowMenu, helpMenu;
+ 
+ 	private Application app;
+ 	private Layout layout;
+ 	
+ 
+ 	/**
+ 	 * Creates new menubar
+ 	 * @param app Application
+ 	 * @param layout Layout
+ 	 */
+ 	public GeoGebraMenuBar(Application app, Layout layout) {
+ 		this.layout = layout;
+ 
+ 		/**
+ 		 * A nasty workaround to prevent any borders from being drawn. All other
+ 		 * elements will have a border at the top to prevent visual conflicts
+ 		 * while moving the toolbar / algebra input to the top / bottom. The
+ 		 * JMenuBar *always* draws a border at the bottom however, even if the
+ 		 * border set via setBorder() is empty. By drawing an one pixel border
+ 		 * with the color of the background we can prevent this.
+ 		 */
+ 		setBorder(BorderFactory.createCompoundBorder(BorderFactory
+ 				.createMatteBorder(0, 0, 1, 0, SystemColor.control),
+ 				BorderFactory.createEmptyBorder(1, 1, 0, 1)));
+ 
+ 		this.app = app;
+ 	}
+ 
+ 
+ 	/**
+ 	 * Initialize the menubar. No update is required after initialization.
+ 	 */
+ 	public void initMenubar() {
+ 		removeAll();
+ 	
+ 		// "File"
+ 			fileMenu = new FileMenu(app);
+ 			add(fileMenu);
+ 				
+ 		// "Edit"
+ 		editMenu = new EditMenu(app);
+ 		add(editMenu);
+ 		
+ 		// "View"
+ 		viewMenu = new ViewMenu(app, layout);
+ 		add(viewMenu);
+ 		
+ 		// "Perspectives"
+ 		if(!app.isApplet()) {
+ 			perspectivesMenu = new PerspectivesMenu(app, layout);
+ 			add(perspectivesMenu);
+ 		}
+ 		
+ 		// "Options"
+ 		optionsMenu = new OptionsMenu(app, layout);
+ 		add(optionsMenu);
+ 		
+ 		// "Tools"
+ 		toolsMenu = new ToolsMenu(app);
+ 		add(toolsMenu);
+ 		
+ 		// "Window"
+ 		windowMenu = new WindowMenu(app);
+ 		
+ 		if(!app.isApplet()) // just add the menu if this is not an applet we're 
+ 		{
+ 			add(windowMenu);
+ 			
+ 			if (app.getPluginManager() != null) {
+ 				javax.swing.JMenu pim = app.getPluginManager().getPluginMenu();
+ 				if (pim != null) {
+ 					add(pim);
+ 				} // H-P Ulven 2008-04-17
+ 			}
+ 		}
+ 		
+ 		// "Help"
+ 		helpMenu = new HelpMenu(app);
+ 		add(helpMenu);
+ 	}
+ 
+ 	/**
+ 	 * Update the menubar.
+ 	 */
+ 	public void updateMenubar() {
+ 		Application.debug("update menu");
+ 		fileMenu.update();
+ 		editMenu.update();
+ 		viewMenu.update();
+ 		optionsMenu.update();
+ 		toolsMenu.update();
+ 		if (perspectivesMenu != null)
+ 			perspectivesMenu.update();
+ 		
+ 		if(!app.isApplet())
+ 			windowMenu.update();
+ 		
+ 		helpMenu.update();
+ 		
+ 		updateSelection();
+ 	}
+ 
+ 	/**
+ 	 * Update the selection.
+ 	 */
+ 	public void updateSelection() {
+ 		((EditMenu)editMenu).updateSelection();
+ 	}
+ 	
+ 	/**
+ 	 * Update the file menu without being forced to updated the other menus as well.
+ 	 */
+ 	public void updateMenuFile() {
+ 		if(fileMenu!=null)fileMenu.update();
+ 	}
+ 	
+ 	/**
+ 	 * Update the window menu without having to update the other menus as well.
+ 	 */
+ 	public void updateMenuWindow() {
+ 		windowMenu.update();
+ 	}
+ 	
+ 	/**
+ 	 * Show the print preview dialog.
+ 	 * 
+ 	 * @param app
+ 	 */
+ 	public static void showPrintPreview(final Application app) {
+ 		try {
+ 			Thread runner = new Thread() {
+ 				public void run() {
+ 
+ 					try {
+ 						app.setWaitCursor();
+ 						// use reflection for
+ 						// new geogebra.export.PrintPreview(app,
+ 						// app.getEuclidianView(), PageFormat.LANDSCAPE);
+ 						// Class classObject =
+ 						// Class.forName("geogebra.export.PrintPreview");
+ 						// Object[] args = new Object[] { app ,
+ 						// app.getEuclidianView(), new
+ 						// Integer(PageFormat.LANDSCAPE)};
+ 						// Class [] types = new Class[] {Application.class,
+ 						// Printable.class, int.class};
+ 						// Constructor constructor =
+ 						// classObject.getDeclaredConstructor(types);
+ 						// constructor.newInstance(args);
+ /* old code
+ 						boolean printCAS=false;
+ 						if (app.getGuiManager().hasCasView()){	
+ 							DockManager dm=app.getGuiManager().getLayout().getDockManager();
+ 							//if CAS-view has Focus, print CAS
+ 							if (dm.getFocusedPanel()==dm.getPanel(Application.VIEW_CAS)){
+ 								new geogebra.export.PrintPreview(app, app.getGuiManager().getCasView(), PageFormat.LANDSCAPE);
+ 								printCAS=true;
+ 							}
+ 						}			
+ 						
+ 						if (!printCAS)
+ 							new geogebra.export.PrintPreview(app, app
+ 								.getEuclidianView(), PageFormat.LANDSCAPE);
+ 						
+ 						
+ 	*/					
+ 						
+ 						DockManager dm=app.getGuiManager().getLayout().getDockManager();
+ 						
+ 						if (dm.getFocusedPanel()==dm.getPanel(Application.VIEW_CAS))
+ 							new geogebra.export.PrintPreview(app, app.getGuiManager().getCasView(), PageFormat.LANDSCAPE);
+ 						else if (dm.getFocusedPanel()==dm.getPanel(Application.VIEW_CONSTRUCTION_PROTOCOL))
+ 							new geogebra.export.PrintPreview(app, app.getGuiManager().getConstructionProtocolView(), PageFormat.LANDSCAPE);
+ 						else if (dm.getFocusedPanel()==dm.getPanel(Application.VIEW_SPREADSHEET))
+ 							new geogebra.export.PrintPreview(app, app.getGuiManager().getSpreadsheetView(), PageFormat.LANDSCAPE);
+ 						else if (dm.getFocusedPanel()==dm.getPanel(Application.VIEW_EUCLIDIAN2))
+ 							new geogebra.export.PrintPreview(app, app.getEuclidianView2(), PageFormat.LANDSCAPE);
+ 						else if (dm.getFocusedPanel()==dm.getPanel(Application.VIEW_ALGEBRA))
+ 							new geogebra.export.PrintPreview(app, app.getGuiManager().getAlgebraView(), PageFormat.LANDSCAPE);
+ 						else //graphics view focused
+ 							new geogebra.export.PrintPreview(app, app.getEuclidianView(), PageFormat.LANDSCAPE);
+ 										
+ 						
+ 					} catch (Exception e) {
+ 						Application.debug("Print preview not available");
+ 					} finally{
+ 						app.setDefaultCursor();						
+ 					}
+ 
+ 				}
+ 			};
+ 			runner.start();
+ 		} catch (java.lang.NoClassDefFoundError ee) {
+ 			app.showErrorDialog(app.getError("ExportJarMissing"));
+ 			ee.printStackTrace();
+ 		}
+ 	}
+ 
+ 	/**
+ 	 * Show the "About" dialog.
+ 	 * 
+ 	 * @param app
+ 	 */
+ 	public static void showAboutDialog(final Application app) {
+ 		final StringBuilder vsb = new StringBuilder();
+ 		vsb.append(app.getPlain("ApplicationName"));
+ 		vsb.append(" ");
+ 		vsb.append(GeoGebra.VERSION_STRING);
+ 		switch (Kernel.DEFAULT_CAS) {
+ 		case Application.CAS_MAXIMA:
+ 			vsb.append('m');
+ 			break;
+ 			// default: do nothing
+ 		}
+ 		if (app.getApplet() != null) vsb.append(" Applet");
+ 		else if (Application.isWebstartDebug()) vsb.append(" Debug");
+ 		else if (Application.isWebstart()) vsb.append(" Webstart");
+ 		
+ 		StringBuilder sb = new StringBuilder();
+ 		sb.append("<html><b>");
+ 		sb.append(vsb);
 -		sb.append("</b>  (");
++		sb.append("</b> <i>Debian package ");
++		sb.append(GeoGebra.DEBIAN_VERSION_STRING);
++		sb.append("</i>  (");
+ 		sb.append("Java "); 
+ 		sb.append(System.getProperty("java.version")); 
+ 		sb.append(", ");
+ 		sb.append(app.getHeapSize()/1024/1024);
+ 		sb.append("MB, ");
+ 		sb.append(Application.getCASVersionString());
+ 		sb.append(")<br>");	
+ 		sb.append(GeoGebra.BUILD_DATE);
+ 
+ 		// license
+ 		String text = app.loadTextFile(Application.LICENSE_FILE);
+ 		// We may want to modify the window size when the license file changes:
+ 		JTextArea textArea = new JTextArea(24, 72); // window size fine tuning (rows, cols)
+ 		JScrollPane scrollPane = new JScrollPane(textArea,
+ 				JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
+ 				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+ 		textArea.setEditable(false);
+ 		// not sure if Monospaced is installed everywhere:
+ 		textArea.setFont(new Font("Monospaced",Font.PLAIN,12));
+ 		textArea.setText(text);
+ 		textArea.setCaretPosition(0);
+ 
+ 		JPanel systemInfoPanel = new JPanel(new BorderLayout(5, 5));
+ 		systemInfoPanel.add(new JLabel(sb.toString()), BorderLayout.CENTER);
+ 		
+ 		// copy system information to clipboard
+ 		systemInfoPanel.add(new JButton(new AbstractAction(app.getPlain("SystemInformation")) {
+ 			public void actionPerformed(ActionEvent arg0) {
+ 				StringBuilder systemInfo = new StringBuilder();
+ 				systemInfo.append("[code]");
+ 				systemInfo.append(vsb);
+ 				systemInfo.append(" (");
+ 				systemInfo.append(GeoGebra.BUILD_DATE);
+ 				systemInfo.append(")\nJava: ");
+ 				systemInfo.append(System.getProperty("java.version"));
+ 				systemInfo.append(")\nCodebase: ");
+ 				systemInfo.append(Application.getCodeBase());
+ 				systemInfo.append("\nOS: ");
+ 				systemInfo.append(System.getProperty("os.name"));
+ 				systemInfo.append("\nArchitecture: ");
+ 				systemInfo.append(System.getProperty("os.arch")); // tells us 32 or 64 bit (Java)
+ 				systemInfo.append("\nHeap: ");
+ 				systemInfo.append(app.getHeapSize()/1024/1024);
+ 				systemInfo.append("MB\nCAS: ");
+ 				systemInfo.append(Application.getCASVersionString());
+ 				systemInfo.append("\n\n");
+ 				
+ 				
+ 				// copy log file to systemInfo
+ 				if (app.logFile != null) {
+ 				    String NL = System.getProperty("line.separator");
+ 				    Scanner scanner = null;
+ 				    try {
+ 					  scanner = new Scanner(new File(app.logFile.toString()));
+ 				      while (scanner.hasNextLine()){
+ 				    	  systemInfo.append(scanner.nextLine() + NL);
+ 				      }
+ 				    } catch (FileNotFoundException e) {
+ 				    	
+ 				    }
+ 				    finally{
+ 				      if (scanner != null) scanner.close();
+ 				    }
+ 				}
+ 				
+ 				// append ggb file (except images)
+ 				systemInfo.append(app.getXML());
+ 				systemInfo.append("\n\n");
+ 				systemInfo.append(app.getMacroXML());
+ 				systemInfo.append("\n\nLibraryJavaScript:\n");
+ 				app.getKernel().getLibraryJavaScript();
+ 				
+ 				systemInfo.append("\n\nPreferences:\n");
+ 				systemInfo.append(GeoGebraPreferences.getPref().getXMLPreferences());
+ 				systemInfo.append("[/code]");
+ 				Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
+ 					new StringSelection(systemInfo.toString()), null
+ 				);
+ 				
+ 				app.showMessage(app.getPlain("SystemInformationMessage"));
+ 			}
+ 		}), BorderLayout.EAST);
+ 		
+ 		JPanel panel = new JPanel(new BorderLayout(5, 5));
+ 		panel.add(systemInfoPanel, BorderLayout.NORTH);
+ 		panel.add(scrollPane, BorderLayout.SOUTH);
+ 
+ 		JOptionPane infoPane = new JOptionPane(panel,
+ 				JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION);
+ 		
+ 		final JDialog dialog = infoPane.createDialog(app.getMainComponent(),
+ 				app.getMenu("About") + " / " + app.getMenu("License"));
+ 
+ 		dialog.setVisible(true);
+ 	}
+ }

-- 
GeoGebra: Dynamic mathematics software for education



More information about the pkg-java-commits mailing list