001 /**
002 * Copyright (C) 2007-2008, Jens Lehmann
003 *
004 * This file is part of DL-Learner.
005 *
006 * DL-Learner is free software; you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation; either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * DL-Learner is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014 * GNU General Public License for more details.
015 *
016 * You should have received a copy of the GNU General Public License
017 * along with this program. If not, see <http://www.gnu.org/licenses/>.
018 *
019 */
020
021 package org.dllearner.tools.ore;
022
023 import java.awt.BorderLayout;
024 import java.awt.Dimension;
025 import java.awt.Font;
026 import java.awt.GridLayout;
027
028 import javax.swing.JLabel;
029 import javax.swing.JPanel;
030
031 /**
032 * Navigation panel where it's shown the actual wizard step and former and following steps.
033 * @author Lorenz Buehmann
034 *
035 */
036 public class LeftPanel extends JPanel{
037
038 private static final long serialVersionUID = -1205252523136710091L;
039 private JLabel[] jLabel;
040
041 /**
042 * Constructor instantiating JLabels with wizard step names.
043 * @param i step number printed bold
044 */
045 public LeftPanel(int i){
046
047 jLabel = new JLabel[6];
048 setBackground(new java.awt.Color(255, 255, 255));
049 JPanel panel2 = new JPanel();
050 panel2.setBackground(new java.awt.Color(255, 255, 255));
051 panel2.setLayout(new GridLayout(5, 1, 0, 10));
052 jLabel[0] = new JLabel("1. Introduction");
053 jLabel[1] = new JLabel("2. Knowledge Source");
054 jLabel[2] = new JLabel("3. Choose Class");
055 jLabel[3] = new JLabel("4. Learn");
056 jLabel[4] = new JLabel("5. Repair");
057 jLabel[5] = new JLabel("6. Save/Exit");
058 jLabel[i].setFont(jLabel[i].getFont().deriveFont(Font.BOLD));
059
060 for(JLabel current : jLabel){
061 panel2.add(current);
062 }
063 setLayout(new BorderLayout());
064 setPreferredSize(new Dimension(140, 500));
065 add(panel2, BorderLayout.NORTH);
066
067 }
068
069 /**
070 * Sets the actual step, that has to be printed bold in the navigation panel.
071 * @param i number of the step
072 */
073 public void set(int i){
074 removeAll();
075
076 setBackground(new java.awt.Color(255, 255, 255));
077 JPanel panel2 = new JPanel();
078 panel2.setBackground(new java.awt.Color(255, 255, 255));
079 panel2.setLayout(new GridLayout(6, 1, 0, 10));
080 jLabel[0] = new JLabel("1. Introduction");
081 jLabel[1] = new JLabel("2. Knowledge Source");
082 jLabel[2] = new JLabel("3. Choose Class");
083 jLabel[3] = new JLabel("4. Learning");
084 jLabel[4] = new JLabel("5. Repair");
085 jLabel[5] = new JLabel("6. Save/Exit");
086
087 jLabel[i].setFont(jLabel[i].getFont().deriveFont(Font.BOLD));
088
089 for(JLabel current : jLabel){
090 panel2.add(current);
091 }
092 setLayout(new BorderLayout());
093 add(panel2, BorderLayout.NORTH);
094 }
095
096 }