View Javadoc

1   
2   package org.xrn.gui;
3   
4   import java.awt.Color;
5   import java.awt.Font;
6   import java.awt.event.ActionEvent;
7   import java.awt.event.ActionListener;
8   import java.awt.event.ItemEvent;
9   import java.awt.event.ItemListener;
10  
11  import javax.swing.JButton;
12  import javax.swing.JComponent;
13  import javax.swing.JLabel;
14  import javax.swing.JPanel;
15  import javax.swing.JTextField;
16  import javax.swing.border.TitledBorder;
17  
18  import org.xrn.xsd2java.ReleaseNotesType.ActorsType;
19  import org.xrn.xsd2java.impl.ReleaseNotesTypeImpl.ActorsTypeImpl;
20  
21  public class ActorsPanel extends JPanel implements ActionListener, ItemListener{
22      private Font schriftTyp;
23      
24      private JButton radierenAS;
25      private JLabel hrefLabel = new JLabel( "HREF" );
26      private JTextField hrefField = new JTextField();
27   
28      private JPanel panelOwner = null;
29      
30      private ActorsType actors = null;
31                      
32      /***
33       * Constructor
34       * @param owner
35       */
36      public ActorsPanel( JPanel owner ){
37    	
38          setBorder( new TitledBorder( " Actors " ) );
39          schriftTyp =  new Font( "newFont", Font.BOLD, 14 );
40          setFont( schriftTyp );
41          setLayout( null );
42          
43          panelOwner = owner;
44          
45          hrefField.setEnabled( false );
46          dlgObjHinzufuegen( hrefLabel, 15, 25, 50, 20 );
47          dlgObjHinzufuegen( hrefField, 15, 50, 300, 20 );  	
48      }
49  
50      /***
51       * 
52       * @param c
53       * @param x0
54       * @param y0
55       * @param breite
56       * @param hoehe
57       */
58      public void dlgObjHinzufuegen( JComponent c, int x0, int y0, int breite, int hoehe ){
59          c.setBounds( x0, y0, breite, hoehe );
60          c.setForeground( Color.black );
61          add(c);
62      }
63      
64      /***
65       * 
66       */
67      public void actionPerformed( ActionEvent e ){
68    	
69      }
70  
71      /***
72       * 
73       */
74      public void itemStateChanged( ItemEvent event ){
75    	
76      }
77  
78      /***
79       * Delete the input and set the default value if necessary
80       *
81       */
82      public void resetFields( ){
83          hrefField.setText( "" );
84      }
85      
86      /***
87       * 
88       * @return the actors
89       */
90      public ActorsType getActors(){
91          actors = new ActorsTypeImpl();
92          actors.setHref( hrefField.getText() );
93          return actors;
94      }
95      
96      /***
97       * 
98       * @param actors
99       */
100     public void setActors( ActorsType actors ){
101         this.actors = actors;
102         if( actors != null )
103             hrefField.setText( actors.getHref() );
104     }
105 }