Bug 294142 - Reading mail produces exception :: Changing Grendel toolbar button look to be more compliant with the Java look and feel and a bit nicer looking :: Adding some new javadoc info to the code that is badly needed.

This commit is contained in:
rj.keller%beonex.com 2005-05-25 02:01:35 +00:00
Родитель 060a5a06b3
Коммит 048625ef37
6 изменённых файлов: 49 добавлений и 15 удалений

Просмотреть файл

@ -59,6 +59,9 @@ import grendel.filters.FilterMaster;
import grendel.composition.Composition;
import com.trfenv.parsers.Event;
/**
*Generates a list of common Grendel events for use across the application.
*/
public class ActionFactory {
static ExitAction fExitAction = new ExitAction();
static NewMailAction fNewMailAction = new NewMailAction();

Просмотреть файл

@ -78,6 +78,14 @@ import javax.swing.BoxLayout;
import grendel.prefs.base.InvisiblePrefs;
import grendel.widgets.*;
/**
*This class provides a JFrame containing the default GUI for Grendel windows,
*such as the menubar, toolbar, etc.
*
*<p>Also manages Frame references so that frames are not required to be
*reinitialized. This is done through frame IDs and the static method
*FindFrameById.</p>
*/
public class GeneralFrame extends JFrame
{
GeneralFrame fThis;

Просмотреть файл

@ -276,15 +276,11 @@ public class MessagePanel extends GeneralPanel {
if (makeRealHTML) {
stream = new MakeItHTML(stream).getHTMLInputStream();
}
// Okay, let's try to read from the stream and set the
// text from the InputStream. We may need to put this
// stuff back later. (talisman)
//InputStreamReader reader = new InputStreamReader(stream);
// char buff[] = new char[4096];
// int count;
// while ((count = reader.read(buff, 0, 4096)) != -1) {
// fTextArea.append(new String(buff, 0, count));
fTextArea.read(stream, "Message");
// text from the InputStream.
fTextArea.getDocument().putProperty("IgnoreCharsetDirective", Boolean.TRUE);
fTextArea.read(stream, fTextArea.getDocument());
// }
} catch (MessagingException me) {
fTextArea.setText(me.toString());

Просмотреть файл

@ -30,6 +30,10 @@ import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
/**
*Default screen to be shown while application is initializing. Run the
*dispose method on this class when you're ready to close the splash screen.
*/
public class Splash extends JWindow {
public Splash() {

Просмотреть файл

@ -32,6 +32,12 @@ import java.text.MessageFormat;
import javax.swing.Icon;
import javax.swing.ImageIcon;
/**
*A image animation component that runs animations by flipping through a
*number of images using a image template. Runs by taking in a image name via
*setImageTemplate and runs from 0 to iFrames. Each image will then be a single
*frame in the animation.
*/
public class Animation extends Component implements Runnable
{
Thread fThread;
@ -99,6 +105,16 @@ public class Animation extends Component implements Runnable
return this;
}
/**
*Sets the name of all the image names in the animation plus how many frames
*to use in the animation.
*
*<p>Each frame will be called template[x].gif where x == the frame number.
*Frames then go from 0 to iFrames.</p>
*
* @param template The image name for each of the frames.
* @param iFrames The number of frames in the animation.
*/
public void setImageTemplate( String template, int iFrames )
{
fGlyphs = new Icon[iFrames];
@ -110,6 +126,11 @@ public class Animation extends Component implements Runnable
}
}
/**
*Starts flipping through the frame in the animation and keeps repeating
*until the stop() method is called. Images are set through setImageTemplate()
*method.
*/
public synchronized void start()
{
if (fThread != null) {
@ -125,6 +146,9 @@ public class Animation extends Component implements Runnable
fThread.start();
}
/**
*Stops flipping through the frames in the animation.
*/
public synchronized void stop()
{
if (fThread != null) {

Просмотреть файл

@ -33,6 +33,7 @@ import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JToolBar;
import javax.swing.JButton;
import javax.swing.Icon;
import grendel.widgets.Spring;
@ -44,7 +45,7 @@ public class GrendelToolBar extends JToolBar {
super();
setFloatable(false);
setBackground(new java.awt.Color(238,238,238));
// setBackground(new java.awt.Color(238,238,238));
}
public Spring makeNewSpring() {
@ -56,20 +57,18 @@ public class GrendelToolBar extends JToolBar {
String aText,
String aToolTip) {
JButton b = new JButton();
/*
b.setHorizontalTextPosition(JButton.CENTER);
b.setVerticalTextPosition(JButton.BOTTOM);
Font f=b.getFont();
Font nf=new Font(f.getName(), Font.PLAIN, f.getSize()-2);
b.setFont(nf);
b.setFont(nf);*/
b.setText(aText);
b.setRolloverEnabled(true);
b.setBorder(BorderFactory.createEmptyBorder());
b.setToolTipText(aToolTip);
b.setIcon(new ImageIcon("widgets/toolbar/mozilla/" + aImageName + ".gif"));
/*
Dimension d=b.getPreferredSize();
double w=d.getWidth();
if (w > 52) {
@ -80,7 +79,7 @@ public class GrendelToolBar extends JToolBar {
b.setMinimumSize(d);
b.setMaximumSize(d);
b.setPreferredSize(d);
*/
if (aActionListener != null) {
b.addActionListener(aActionListener);
} else {