Gist.java
Go to the documentation of this file.00001 /* -*- indent-tabs-mode: nil -*- */ 00002 /* 00003 * Main authors: 00004 * Guido Tack <tack@gecode.org> 00005 * 00006 * Copyright: 00007 * Guido Tack, 2006 00008 * 00009 * Last modified: 00010 * $Date: 2006-10-31 16:52:38 +0100 (Tue, 31 Oct 2006) $ by $Author: zayenz $ 00011 * $Revision: 3843 $ 00012 * 00013 * This file is part of Gecode, the generic constraint 00014 * development environment: 00015 * http://www.gecode.org 00016 * 00017 * See the file "LICENSE" for information on usage and 00018 * redistribution of this file, and for a 00019 * DISCLAIMER OF ALL WARRANTIES. 00020 * 00021 */ 00022 00023 package org.gecode.gist; 00024 00025 import org.gecode.Space; 00026 import org.gecode.gist.swing.SwingUI; 00027 00028 import javax.swing.UIManager; 00029 00030 public class Gist { 00031 GistUIInterface ui; 00032 GistController ctrl; 00033 00034 private void setSystemLAF() { 00035 try { 00036 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 00037 } 00038 catch(ClassNotFoundException ex) {} 00039 catch(InstantiationException ex) {} 00040 catch(IllegalAccessException ex) {} 00041 catch(javax.swing.UnsupportedLookAndFeelException ex) {} 00042 } 00043 00044 public Gist(Space rootSpace) { 00045 setSystemLAF(); 00046 ctrl = new GistController(rootSpace, false); 00047 ui = new SwingUI(ctrl); 00048 ui.open(); 00049 } 00050 00051 public Gist(Space rootSpace, boolean bab) { 00052 setSystemLAF(); 00053 ctrl = new GistController(rootSpace, bab); 00054 ui = new SwingUI(ctrl); 00055 ui.open(); 00056 } 00057 00058 public void exploreOne() { 00059 ctrl.exploreOne(); 00060 } 00061 00062 public void exploreAll() { 00063 ctrl.exploreAll(); 00064 } 00065 00066 public void addEventListener(GistEventListener e) { 00067 ctrl.addEventListener(e); 00068 } 00069 00070 }
