/*
* Created by JFormDesigner on Tue Nov 10 00:13:23 WET 2009
*/
package pt.treps.ui;
import java.awt.*;
import javax.swing.*;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.border.LineBorder;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
import org.jdesktop.swingx.JXPanel;
import pt.treps.listeners.TimeReportingTextAreaKeyListener;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
/**
* @author Tiago Pais
*/
public class MainFrame extends JFrame {
public JXPanel timeReportPanel;
public RSyntaxTextArea timeReportTA;
public ReportingTimeBusyLabel busyLabel;
public WhatWereUDoingPanel whatWUDPanel;
public MainFrame() {
initComponents();
initExtraComponents();
}
private void initExtraComponents() {
this.busyLabel = new ReportingTimeBusyLabel();
this.busyLabel.setBounds(200, 28, 350, 50);
this.busyLabel.setDoubleBuffered(true);
this.busyLabel.setFont(this.busyLabel.getFont().deriveFont(16f));
this.timeReportPanel = new JXPanel();
this.timeReportPanel.setAlpha(1.0f);
this.timeReportPanel.setBounds(1, 1, 631, 105);
this.timeReportTA = new RSyntaxTextArea(4, 50);
this.timeReportTA.setWrapStyleWord(true);
this.timeReportTA.setFont(this.timeReportTA.getFont().deriveFont(15f));
this.timeReportTA.setLineWrap(true);
this.timeReportTA.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_UNIX_SHELL);
this.timeReportTA.getSyntaxScheme().restoreDefaults();
this.timeReportTA.setTextAntiAliasHint(RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB.toString());
this.timeReportTA.addKeyListener(new TimeReportingTextAreaKeyListener(this));
this.timeReportTA.getPopupMenu().setMinimumSize(new Dimension(250, this.timeReportTA.getPopupMenu().getHeight()));
this.whatWUDPanel = new WhatWereUDoingPanel();
this.whatWUDPanel.setAlpha(0.7f);
this.whatWUDPanel.setBounds(1, 1, 631, 105);
this.timeReportPanel.setLayout(new BorderLayout());
this.timeReportPanel.add(this.timeReportTA, BorderLayout.CENTER);
this.layeredPane.add(this.timeReportPanel, 2);
this.layeredPane.add(this.whatWUDPanel, 0);
this.layeredPane.add(this.busyLabel, 1);
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
layeredPane = new JLayeredPane();
panel1 = new JPanel();
comboBox1 = new JComboBox();
comboBox2 = new JComboBox();
spinner1 = new JSpinner();
CellConstraints cc = new CellConstraints();
//======== this ========
setMinimumSize(new Dimension(600, 160));
setUndecorated(true);
Container contentPane = getContentPane();
contentPane.setLayout(new FormLayout(
"$ugap, 633px, $ugap",
"$ugap, fill:default:grow, $lgap, default, $ugap"));
//======== layeredPane ========
{
layeredPane.setBorder(LineBorder.createBlackLineBorder());
}
contentPane.add(layeredPane, cc.xy(2, 2));
//======== panel1 ========
{
panel1.setLayout(new FormLayout(
"2*(288px, $lcgap), default:grow",
"default"));
panel1.add(comboBox1, cc.xy(1, 1));
panel1.add(comboBox2, cc.xy(3, 1));
//---- spinner1 ----
spinner1.setModel(new SpinnerNumberModel(2, null, null, 1));
panel1.add(spinner1, cc.xy(5, 1));
}
contentPane.add(panel1, cc.xy(2, 4));
pack();
setLocationRelativeTo(getOwner());
// JFormDesigner - End of component initialization //GEN-END:initComponents
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
public JLayeredPane layeredPane;
private JPanel panel1;
private JComboBox comboBox1;
private JComboBox comboBox2;
private JSpinner spinner1;
// JFormDesigner - End of variables declaration //GEN-END:variables
public JComboBox getComboBoxProjects() {
return comboBox1;
}
public JComboBox getComboBoxTasks() {
return comboBox2;
}
}