001 // GraphLab Project: http://graphlab.sharif.edu 002 // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology 003 // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/ 004 package graphlab.ui.components; 005 006 007 import graphlab.platform.core.BlackBoard; 008 009 import javax.swing.*; 010 import javax.swing.border.EmptyBorder; 011 import java.awt.*; 012 013 /** 014 * @author azin azadi 015 */ 016 public class GStatusBar extends JPanel { 017 /** 018 * 019 */ 020 private static final long serialVersionUID = 7638151469264118382L; 021 private BlackBoard blackboard; 022 023 024 public GStatusBar(BlackBoard blackboard) { 025 super(); 026 this.blackboard = blackboard; 027 FlowLayout l = new FlowLayout(FlowLayout.LEFT, 1, 1); 028 setLayout(l); 029 setBorder(new EmptyBorder(1, 1, 0, 1)); 030 031 } 032 033 /* 034 //todo: man hadafam in bood ke ham tarafe raste statusbar beshe ie chizi gozash ham chapesh, vali ie cheke sar dasi ke ba netbeans kardam, natoonestam ie joori componentaro ham tarafe rast ezafe konam ham tarafe chap (ba flowlayout). bara hamin felan bikhialesh shodam. ie chizi base misazam ina baraie //todo: <-- ;) :D 035 public void addRight(Component c){ 036 } 037 public void addLeft(Component c){ 038 } 039 */ 040 041 /** 042 * adds a new Component to the status bar 043 */ 044 public void addComponent(Component c) { 045 add(c); 046 add(newSeparator()); 047 validate(); 048 } 049 050 /** 051 * @return a new instance of JSeperator to put between components in status bar 052 */ 053 private JSeparator newSeparator() { 054 JSeparator s = new JSeparator(JSeparator.VERTICAL); 055 s.setPreferredSize(new Dimension(3, 15)); 056 //sp.setForeground(Color.orange); 057 return s; 058 } 059 }