/* * ConfigBorderPanel.java * * Copyright (c) 2003-2004 Digi International * This program and the information contained in it is confidential and * proprietary to Digi International and may not be used, copied, or re- * produced without the prior written permission of Digi International. * */ package com.digi.config.ui; import com.digi.config.util.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.border.*; import javax.swing.colorchooser.*; import javax.swing.filechooser.*; import javax.accessibility.*; import javax.swing.plaf.metal.DefaultMetalTheme; import javax.swing.plaf.metal.MetalLookAndFeel; import java.lang.reflect.*; import java.awt.*; import java.awt.event.*; import java.beans.*; import java.util.*; import java.io.*; import java.applet.*; import java.net.*; /** * This class represents the top level of the configuration user interface. This class is * a JPanel that can be imbedded in other constructs such as a JFrame or an Applet. * This panel utilizes a border layout and the content of outer edges of the border are defined in * a resource file and are loaded on startup. This allows these items to be customized by the user * if desired. The center area of this panel contains the main configuration interface. */ public class ConfigBorderPanel extends JPanel { JPanel northPanel = null; JPanel southPanel = null; JPanel eastPanel = null; JPanel westPanel = null; ConfigAppPanel configAppPanel = null; // The preferred size of the demo private static final int PREFERRED_WIDTH = 800; private static final int PREFERRED_HEIGHT = 720; // Resource bundle for internationalized and accessible text private ResourceBundle bundle = null; /** * ConfigBorderPanel Constructor */ public ConfigBorderPanel() throws Exception { SplashScreenPanel.currentScreen().updateProgress(); // setLayout(new BorderLayout()); setLayout(new BorderLayout()); // set the preferred size of the demo // setPreferredSize(new Dimension(PREFERRED_WIDTH,PREFERRED_HEIGHT)); initializeContent(); } // ******************************************************* // *************** Demo Loading Methods ****************** // ******************************************************* public void initializeContent() throws Exception { if (northPanel==null) { northPanel = getUserPanel("NorthBorder"); add(northPanel, BorderLayout.NORTH); SplashScreenPanel.currentScreen().updateProgress(); } if (southPanel==null) { southPanel = getUserPanel("SouthBorder"); add(southPanel, BorderLayout.SOUTH); SplashScreenPanel.currentScreen().updateProgress(); } if (eastPanel==null) { eastPanel = getUserPanel("EastBorder"); add(eastPanel, BorderLayout.EAST); SplashScreenPanel.currentScreen().updateProgress(); } if (westPanel==null) { westPanel = getUserPanel("WestBorder"); add(westPanel, BorderLayout.WEST); SplashScreenPanel.currentScreen().updateProgress(); } add(getConfigAppPanel(), BorderLayout.CENTER); SplashScreenPanel.currentScreen().updateProgress(); } public JPanel getUserPanel(String panelName) { JPanel panel = new JPanel() { ImageIcon backgroundIcon = ConfigResource.getImageRbIcon("BorderBackgroundImage"); Image backgroundImage; boolean tileImage = true; // finish this... get from resource bundle boolean stretchImage = false; // finish this... get from resource bundle { setOpaque(false); if (backgroundIcon!=null) { backgroundImage = backgroundIcon.getImage(); } } public void paint (Graphics g) { if (backgroundImage!=null) { // paint the background image if (tileImage) { for (int x=0;x