Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2550 - in development/main/metro/composition/unit/src/main/net/dpml/composition/unit: . images

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2550 - in development/main/metro/composition/unit/src/main/net/dpml/composition/unit: . images
  • Date: Fri, 13 May 2005 21:08:09 +0000

Author: mcconnell AT dpml.net
Date: Fri May 13 21:08:07 2005
New Revision: 2550

Added:

development/main/metro/composition/unit/src/main/net/dpml/composition/unit/IconHelper.java

development/main/metro/composition/unit/src/main/net/dpml/composition/unit/images/

development/main/metro/composition/unit/src/main/net/dpml/composition/unit/images/setup.png
(contents, props changed)
Modified:

development/main/metro/composition/unit/src/main/net/dpml/composition/unit/CompositionContentHandlerControlPanel.java
Log:


Modified:
development/main/metro/composition/unit/src/main/net/dpml/composition/unit/CompositionContentHandlerControlPanel.java
==============================================================================
---
development/main/metro/composition/unit/src/main/net/dpml/composition/unit/CompositionContentHandlerControlPanel.java
(original)
+++
development/main/metro/composition/unit/src/main/net/dpml/composition/unit/CompositionContentHandlerControlPanel.java
Fri May 13 21:08:07 2005
@@ -22,12 +22,18 @@
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
import javax.swing.JDialog;
import javax.swing.border.EmptyBorder;
import javax.swing.JPanel;
-
-import net.dpml.depot.prefs.IconHelper;
-
+import javax.swing.Action;
+import javax.swing.AbstractAction;
+import javax.swing.JLabel;
+import javax.swing.JTabbedPane;
+import javax.swing.JButton;
+import javax.swing.BoxLayout;
+import javax.swing.Box;

/**
* A registry of descriptions of plugable content handlers. This
implementation
@@ -38,14 +44,13 @@
/**
* The DPML icon.
*/
- private static String METRO_ICON_FILENAME =
"net/dpml/composition/images/metro.gif";
+ private static String METRO_ICON_FILENAME =
"net/dpml/composition/unit/images/setup.gif";

public CompositionContentHandlerControlPanel( Dialog parent )
{
super( parent );
setTitle( "Metro FT Content Controller" );
setModal( true );
- setSize( new Dimension( 400,400 ) );
JPanel frame = new JPanel();
frame.setLayout( new BorderLayout() );
frame.setBackground( Color.white );
@@ -56,5 +61,70 @@
IconHelper.createImageIconJLabel(
getClass().getClassLoader(), METRO_ICON_FILENAME, "", "DPML
Metro" );
label.setBorder( new EmptyBorder( 5, 0, 0, 0 ) );
+
+ JTabbedPane tabs = new JTabbedPane();
+ tabs.setBorder( new EmptyBorder( 0, 10, 10, 10 ) );
+ tabs.addTab( "System", new JPanel() );
+ tabs.addTab( "Metro", new JPanel() );
+
+ ButtonPanel buttons = new ButtonPanel( this );
+ buttons.setBorder( new EmptyBorder( 0, 7, 7, 7 ) );
+
+ //
+ // package
+ //
+
+ JPanel holder = new JPanel( new BorderLayout() );
+ holder.add( label, BorderLayout.NORTH );
+ holder.add( tabs, BorderLayout.CENTER );
+ holder.add( buttons, BorderLayout.SOUTH );
+
+ setContentPane( holder );
+ setSize( new Dimension( 400,400 ) );
+ getRootPane().setDefaultButton( buttons.getDefaultButton() );
+
}
+
+ private static class ButtonPanel extends Box
+ {
+ private JButton m_close;
+
+ ButtonPanel( JDialog dialog )
+ {
+ super( BoxLayout.Y_AXIS );
+
+ m_close = new JButton( );
+ Action closeAction = new CancelAction( "Close", dialog );
+ m_close.setAction( closeAction );
+ JPanel buttonPanel = new JPanel( new FlowLayout(
FlowLayout.RIGHT ) );
+ buttonPanel.add( m_close );
+ add( buttonPanel );
+ }
+
+ JButton getDefaultButton()
+ {
+ return m_close;
+ }
+ }
+
+ private static class CancelAction extends AbstractAction
+ {
+ private JDialog m_dialog;
+
+ public CancelAction( String label, JDialog dialog )
+ {
+ super( label );
+ m_dialog = dialog;
+ }
+
+ /**
+ * Called when the cancel button is trigged.
+ * @param event the action event
+ */
+ public void actionPerformed( ActionEvent event )
+ {
+ m_dialog.hide();
+ }
+ }
+
}

Added:
development/main/metro/composition/unit/src/main/net/dpml/composition/unit/IconHelper.java
==============================================================================
--- (empty file)
+++
development/main/metro/composition/unit/src/main/net/dpml/composition/unit/IconHelper.java
Fri May 13 21:08:07 2005
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.composition.unit;
+
+import java.net.URL;
+
+import javax.swing.JLabel;
+import javax.swing.ImageIcon;
+
+/**
+ */
+public class IconHelper
+{
+ public static JLabel createImageIconJLabel( ClassLoader classloader,
String path, String description, String text )
+ {
+ ImageIcon icon = createImageIcon( classloader, path, description );
+ JLabel label = new JLabel( text, icon, JLabel.LEFT );
+ return label;
+ }
+
+ public static ImageIcon createImageIcon( ClassLoader classloader, String
path, String description )
+ {
+ URL url = classloader.getResource( path );
+ if( null != url )
+ {
+ return new ImageIcon( url );
+ }
+ else
+ {
+ final String error =
+ "Supplied image icon resource path is unknown ["
+ + path
+ + "].";
+ throw new IllegalArgumentException( error );
+ }
+ }
+}

Added:
development/main/metro/composition/unit/src/main/net/dpml/composition/unit/images/setup.png
==============================================================================
Binary file. No diff available.



  • svn commit: r2550 - in development/main/metro/composition/unit/src/main/net/dpml/composition/unit: . images, mcconnell, 05/13/2005

Archive powered by MHonArc 2.6.24.

Top of Page