1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 package org.openoffice.setup.Panel; 29 30 import org.openoffice.setup.InstallData; 31 import org.openoffice.setup.PanelHelper.PanelLabel; 32 import org.openoffice.setup.PanelHelper.PanelTitle; 33 import org.openoffice.setup.ResourceManager; 34 import java.awt.BorderLayout; 35 import java.awt.ComponentOrientation; 36 import java.awt.Insets; 37 import javax.swing.JPanel; 38 import javax.swing.border.EmptyBorder; 39 40 public class Prologue extends JPanel { 41 42 public Prologue() { 43 44 InstallData data = InstallData.getInstance(); 45 46 setLayout(new java.awt.BorderLayout()); 47 setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); 48 49 String titleText = ResourceManager.getString("String_Prologue1"); 50 PanelTitle titleBox = new PanelTitle(titleText); 51 if ( data.useRtl() ) { titleBox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } 52 add(titleBox, BorderLayout.NORTH); 53 54 JPanel contentPanel = new JPanel(); 55 contentPanel.setLayout(new java.awt.BorderLayout()); 56 57 String text1 = ResourceManager.getString("String_Prologue2"); 58 PanelLabel label1 = new PanelLabel(text1, true); 59 if ( data.useRtl() ) { label1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } 60 String text2 = ResourceManager.getString("String_Prologue3"); 61 PanelLabel label2 = new PanelLabel(text2); 62 if ( data.useRtl() ) { label2.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } 63 64 contentPanel.add(label1, BorderLayout.NORTH); 65 contentPanel.add(label2, BorderLayout.CENTER); 66 67 if ( data.isUserInstallation() ) { 68 String text3 = ResourceManager.getString("String_Prologue4"); 69 PanelLabel label3 = new PanelLabel(text3, true); 70 if ( data.useRtl() ) { label3.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } 71 contentPanel.add(label3, BorderLayout.SOUTH); 72 } 73 74 add(contentPanel, BorderLayout.CENTER); 75 } 76 } 77