01: /*
02: * Project: AMODA - Abstract Modeled Application
03: * Class: de.gulden.framework.amoda.environment.gui.component.PresentationPanel
04: * Version: snapshot-beautyj-1.1
05: *
06: * Date: 2004-09-29
07: *
08: * This is a snapshot version of the AMODA 0.2 development branch,
09: * it is not released as a seperate version.
10: * For AMODA, see http://amoda.berlios.de/.
11: *
12: * This is licensed under the GNU Lesser General Public License (LGPL)
13: * and comes with NO WARRANTY.
14: *
15: * Author: Jens Gulden
16: * Email: amoda@jensgulden.de
17: */
18:
19: package de.gulden.framework.amoda.environment.gui.component;
20:
21: import java.awt.*;
22: import javax.swing.*;
23:
24: /**
25: * Class PresentationPanel.
26: *
27: * @author Jens Gulden
28: * @version snapshot-beautyj-1.1
29: */
30: public class PresentationPanel extends JPanel {
31:
32: // ------------------------------------------------------------------------
33: // --- field ---
34: // ------------------------------------------------------------------------
35:
36: private JLabel imageLabel;
37:
38: // ------------------------------------------------------------------------
39: // --- constructors ---
40: // ------------------------------------------------------------------------
41:
42: public PresentationPanel() {
43: initComponents();
44: }
45:
46: public PresentationPanel(ImageIcon image) {
47: this ();
48: if (image != null) {
49: imageLabel.setIcon(image);
50: }
51: }
52:
53: public PresentationPanel(ImageIcon image, JComponent component) {
54: this (image);
55: add(component, java.awt.BorderLayout.CENTER);
56: //this.doLayout()
57: this .validate();
58: }
59:
60: public PresentationPanel(ImageIcon image, String html) {
61: this (image);
62: JEditorPane editorPane = new JEditorPane();
63: editorPane.setEditable(false);
64: editorPane.setContentType("text/html");
65: editorPane.setText(html);
66: JScrollPane scrollPane = new JScrollPane();
67: scrollPane.setViewportView(editorPane);
68: add(scrollPane, java.awt.BorderLayout.CENTER);
69: editorPane.setCaretPosition(0);
70: this .validate();
71:
72: }
73:
74: // ------------------------------------------------------------------------
75: // --- method ---
76: // ------------------------------------------------------------------------
77:
78: private void initComponents() {
79: //GEN-BEGIN:initComponents
80: imageLabel = new javax.swing.JLabel();
81:
82: setLayout(new java.awt.BorderLayout());
83:
84: add(imageLabel, java.awt.BorderLayout.WEST);
85: }
86:
87: } // end PresentationPanel
|