[4] | 1 | /* |
---|
| 2 | * This program is free software; you can redistribute it and/or modify |
---|
| 3 | * it under the terms of the GNU General Public License as published by |
---|
| 4 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 5 | * (at your option) any later version. |
---|
| 6 | * |
---|
| 7 | * This program is distributed in the hope that it will be useful, |
---|
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 10 | * GNU General Public License for more details. |
---|
| 11 | * |
---|
| 12 | * You should have received a copy of the GNU General Public License |
---|
| 13 | * along with this program; if not, write to the Free Software |
---|
| 14 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | /* |
---|
| 18 | * LayoutEngine.java |
---|
| 19 | * Copyright (C) 2003 University of Waikato, Hamilton, New Zealand |
---|
| 20 | * |
---|
| 21 | */ |
---|
| 22 | |
---|
| 23 | package weka.gui.graphvisualizer; |
---|
| 24 | |
---|
| 25 | import weka.core.FastVector; |
---|
| 26 | import javax.swing.JPanel; |
---|
| 27 | import javax.swing.JProgressBar; |
---|
| 28 | |
---|
| 29 | /** |
---|
| 30 | * This interface class has been added to facilitate the addition |
---|
| 31 | * of other layout engines to this package. Any class |
---|
| 32 | * that wants to lay out a graph should implement this |
---|
| 33 | * interface. |
---|
| 34 | * |
---|
| 35 | * @author Ashraf M. Kibriya (amk14@cs.waikato.ac.nz) |
---|
| 36 | * @version $Revision: 1.6 $ - 24 Apr 2003 - Initial version (Ashraf M. Kibriya) |
---|
| 37 | */ |
---|
| 38 | public interface LayoutEngine { |
---|
| 39 | /** |
---|
| 40 | * This method lays out the graph for better visualization |
---|
| 41 | */ |
---|
| 42 | void layoutGraph(); |
---|
| 43 | |
---|
| 44 | /** |
---|
| 45 | * This method sets the nodes and edges vectors of the LayoutEngine |
---|
| 46 | */ |
---|
| 47 | void setNodesEdges(FastVector nodes, FastVector edges); |
---|
| 48 | /** |
---|
| 49 | * This method sets the allowed size of the node |
---|
| 50 | */ |
---|
| 51 | void setNodeSize(int nodeWidth, int nodeHeight); |
---|
| 52 | |
---|
| 53 | /** give access to set of graph nodes */ |
---|
| 54 | FastVector getNodes(); |
---|
| 55 | |
---|
| 56 | /** |
---|
| 57 | * This method returns the extra controls panel |
---|
| 58 | * for the LayoutEngine, if there is any. |
---|
| 59 | */ |
---|
| 60 | JPanel getControlPanel(); |
---|
| 61 | |
---|
| 62 | /** |
---|
| 63 | * This method returns the progress bar |
---|
| 64 | * for the LayoutEngine, which shows |
---|
| 65 | * the progress of the layout process, |
---|
| 66 | * if it takes a while to layout the |
---|
| 67 | * graph |
---|
| 68 | */ |
---|
| 69 | JProgressBar getProgressBar(); |
---|
| 70 | |
---|
| 71 | /** |
---|
| 72 | * This method adds a LayoutCompleteEventListener to the |
---|
| 73 | * LayoutEngine. |
---|
| 74 | * @param e - The LayoutCompleteEventListener to add |
---|
| 75 | */ |
---|
| 76 | void addLayoutCompleteEventListener(LayoutCompleteEventListener e); |
---|
| 77 | |
---|
| 78 | /** |
---|
| 79 | * This method removes a LayoutCompleteEventListener from the |
---|
| 80 | * LayoutEngine. |
---|
| 81 | * @param e - The LayoutCompleteEventListener to remove. |
---|
| 82 | */ |
---|
| 83 | void removeLayoutCompleteEventListener(LayoutCompleteEventListener e); |
---|
| 84 | |
---|
| 85 | /** |
---|
| 86 | * This fires a LayoutCompleteEvent once a layout has been completed. |
---|
| 87 | */ |
---|
| 88 | void fireLayoutCompleteEvent(LayoutCompleteEvent e); |
---|
| 89 | } |
---|