001: /**********************************************************************************
002:
003: Feedzeo!
004: A free and open source RSS/Atom/RDF feed aggregator
005:
006: Copyright (C) 2005-2006 Anand Rao (anandrao@users.sourceforge.net)
007:
008: This library is free software; you can redistribute it and/or
009: modify it under the terms of the GNU Lesser General Public
010: License as published by the Free Software Foundation; either
011: version 2.1 of the License, or (at your option) any later version.
012:
013: This library is distributed in the hope that it will be useful,
014: but WITHOUT ANY WARRANTY; without even the implied warranty of
015: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
016: Lesser General Public License for more details.
017:
018: You should have received a copy of the GNU Lesser General Public
019: License along with this library; if not, write to the Free Software
020: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
021:
022: ************************************************************************************/package app;
023:
024: import javax.swing.*;
025: import java.awt.event.*;
026: import java.awt.*;
027:
028: /*
029: class ScrollingAbout extends JComponent implements ActionListener{
030:
031: private int x,y;
032: private String scrollText[];
033: private Timer t;
034:
035: public ScrollingAbout(String text[]) {
036:
037: x = 20;
038: y = getHeight();
039: scrollText = text;
040: }
041:
042: public void startTimer() {
043: t = new Timer(20,this);
044: t.start();
045: }
046:
047: public void actionPerformed(ActionEvent a) {
048: repaint();
049: }
050:
051: public void paintComponent(Graphics g) {
052:
053: super.paintComponent(g);
054:
055: for(int i = 0;i < scrollText.length;i++) {
056: g.drawString(scrollText[i],x,y);
057: y += 15;
058: }
059: y = y - scrollText.length * 15 - 1;
060: if( (y + scrollText.length*15) <= 0) y = getHeight(); //200;
061: }
062: }
063: */
064:
065: public class AboutWindow extends JFrame {
066:
067: private final String FEEDZEO_ICON = "Feedzeo_16.gif";
068:
069: /*
070: public AboutWindow() {
071:
072: super("About");
073: String text[] = {"Feedzeo v 1.0 Beta!", "", "RSS/Atom/RDF feed aggregator"};
074:
075: ScrollingAbout scrollingAbout = new ScrollingAbout(text);
076: //ImageIcon bgrdImage = new ImageIcon("bgrdimg.jpg");
077: getContentPane().add(scrollingAbout);
078: //JLabel bk = new JLabel(bgrdImage);
079: ((JPanel)getContentPane()).setOpaque(false);
080: //getLayeredPane().add(bk,new Integer(Integer.MIN_VALUE));
081: getLayeredPane().add( new JLabel(""),new Integer(Integer.MIN_VALUE));
082: //bk.setBounds(0,0,bgrdImage.getIconWidth(),
083: // bgrdImage.getIconHeight());
084: //setSize(bgrdImage.getIconWidth(),bgrdImage.getIconHeight());
085: setSize(250, 150);
086: setResizable(false);
087: setLocation(250,150);
088: addWindowListener( new WindowAdapter() {
089: public void windowClosing(WindowEvent w) {
090: dispose();
091: }
092: });
093: setVisible(true);
094: scrollingAbout.startTimer();
095: }
096: */
097:
098: public AboutWindow() {
099:
100: super ("About");
101: String text[] = { "Feedzeo Server v 1.1 Beta!",
102: "RSS/Atom/RDF feed aggregator" };
103: JPanel p = new JPanel();
104: JLabel l1 = new JLabel(text[0]);
105: JLabel l2 = new JLabel(text[1]);
106: p.add(l1);
107: p.add(l2);
108: getContentPane().add(p);
109: setSize(250, 100);
110: setIconImage(new ImageIcon(FEEDZEO_ICON).getImage());
111: setResizable(false);
112: setLocation(250, 150);
113: addWindowListener(new WindowAdapter() {
114: public void windowClosing(WindowEvent w) {
115: dispose();
116: }
117: });
118: setVisible(true);
119: }
120:
121: /*
122: public static void main (String args[]) {
123:
124: AboutWindow f = new AboutWindow();
125:
126:
127: }
128: */
129:
130: }
|