1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package org.openoffice.setup.Panel;
25 
26 import org.openoffice.setup.InstallData;
27 import org.openoffice.setup.PanelHelper.PanelLabel;
28 import org.openoffice.setup.PanelHelper.PanelTitle;
29 import org.openoffice.setup.ResourceManager;
30 import java.awt.BorderLayout;
31 import java.awt.ComponentOrientation;
32 import java.awt.Insets;
33 import javax.swing.JPanel;
34 import javax.swing.border.EmptyBorder;
35 
36 public class Prologue extends JPanel {
37 
Prologue()38     public Prologue() {
39 
40         InstallData data = InstallData.getInstance();
41 
42         setLayout(new java.awt.BorderLayout());
43         setBorder(new EmptyBorder(new Insets(10, 10, 10, 10)));
44 
45         String titleText = ResourceManager.getString("String_Prologue1");
46         PanelTitle titleBox = new PanelTitle(titleText);
47         if ( data.useRtl() ) { titleBox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
48         add(titleBox, BorderLayout.NORTH);
49 
50         JPanel contentPanel = new JPanel();
51         contentPanel.setLayout(new java.awt.BorderLayout());
52 
53         String text1 = ResourceManager.getString("String_Prologue2");
54         PanelLabel label1 = new PanelLabel(text1, true);
55         if ( data.useRtl() ) { label1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
56         String text2 = ResourceManager.getString("String_Prologue3");
57         PanelLabel label2 = new PanelLabel(text2);
58         if ( data.useRtl() ) { label2.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
59 
60         contentPanel.add(label1, BorderLayout.NORTH);
61         contentPanel.add(label2, BorderLayout.CENTER);
62 
63         if ( data.isUserInstallation() ) {
64             String text3 = ResourceManager.getString("String_Prologue4");
65             PanelLabel label3 = new PanelLabel(text3, true);
66             if ( data.useRtl() ) { label3.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
67             contentPanel.add(label3, BorderLayout.SOUTH);
68         }
69 
70         add(contentPanel, BorderLayout.CENTER);
71     }
72 }
73