01: /*
02: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
07: *
08: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
09: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
10: * the license for the specific language governing your rights and limitations.
11: *
12: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
13: */
14: package org.pentaho.reportdesigner.crm.report.wizard;
15:
16: import org.jetbrains.annotations.NotNull;
17: import org.jetbrains.annotations.Nullable;
18: import org.pentaho.reportdesigner.lib.client.util.FontUtils;
19:
20: import javax.swing.*;
21: import javax.swing.border.CompoundBorder;
22: import java.awt.*;
23:
24: /**
25: * User: Martin
26: * Date: 10.02.2006
27: * Time: 14:58:15
28: */
29: public class WizardHeaderComponent extends JPanel {
30: @NotNull
31: private JLabel iconLabel;
32: @NotNull
33: private JLabel titleLabel;
34: @NotNull
35: private JLabel descriptionLabel;
36:
37: public WizardHeaderComponent() {
38: setOpaque(true);
39: setBackground(Color.WHITE);
40:
41: setLayout(new BorderLayout(10, 20));
42: iconLabel = new JLabel();
43: iconLabel.setBackground(Color.WHITE);
44: add(iconLabel, BorderLayout.WEST);
45:
46: JPanel helperPanel = new JPanel(new BorderLayout(0, 10));
47: helperPanel.setBackground(Color.WHITE);
48: helperPanel.setOpaque(true);
49:
50: titleLabel = new JLabel("TitleLabel");//NON-NLS
51: titleLabel.setFont(FontUtils.getDerivedFont(titleLabel
52: .getFont(), Font.BOLD,
53: titleLabel.getFont().getSize() + 2));
54: titleLabel.setBackground(Color.WHITE);
55: helperPanel.add(titleLabel, BorderLayout.NORTH);
56: descriptionLabel = new JLabel("descriptionLabel");//NON-NLS
57: descriptionLabel.setBackground(Color.WHITE);
58: helperPanel.add(descriptionLabel, BorderLayout.CENTER);
59:
60: add(helperPanel, BorderLayout.CENTER);
61:
62: CompoundBorder border = BorderFactory.createCompoundBorder(
63: BorderFactory.createMatteBorder(0, 0, 1, 0,
64: Color.LIGHT_GRAY), BorderFactory
65: .createEmptyBorder(10, 10, 10, 10));
66: setBorder(border);
67: }
68:
69: public void setIcon(@Nullable
70: ImageIcon imageIcon) {
71: iconLabel.setIcon(imageIcon);
72: }
73:
74: public void setTitle(@Nullable
75: String title) {
76: if (title != null && title.length() > 0) {
77: titleLabel.setText(title);
78: } else {
79: titleLabel.setText(" ");
80: }
81: }
82:
83: public void setDescription(@Nullable
84: String description) {
85: if (description != null && description.length() > 0) {
86: descriptionLabel.setText(description);
87: } else {
88: descriptionLabel.setText(" ");
89: }
90: }
91:
92: }
|