Font bug fixes - default font was too big (may be platform specific to linux, but Helvetica-plain-12 is a safe bet for any system).

This commit is contained in:
talisman%anamorphic.com 1999-06-16 05:13:53 +00:00
Родитель b87fd97a8d
Коммит b723a0ed6d
8 изменённых файлов: 134 добавлений и 128 удалений

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

@ -26,6 +26,7 @@ package grendel.ui;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
@ -366,6 +367,7 @@ public class FolderPanel extends GeneralPanel {
fSelectionListener = new MessageSelectionListener();
fMessageTree.getSelectionManager().addSelectionListener(fSelectionListener);
fMessageTree.setFont(new Font("Helvetica", Font.PLAIN, 12));
}
public void dispose() {
@ -555,6 +557,7 @@ public class FolderPanel extends GeneralPanel {
item = new JMenuItem(strings.getString("msgDeletePopupLabel"));
item.addActionListener(new DeleteMessageAction());
item.setFont(new Font("Helvetica", Font.PLAIN, 12));
popup.add(item);
JMenu copyMenu = new JMenu(strings.getString("msgCopyPopupLabel"));

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

@ -282,7 +282,8 @@ public class GeneralFrame extends JFrame
} catch (Throwable t) {
t.printStackTrace();
}
menubar.setFont(new Font("Helvetica", Font.PLAIN, 12));
return menubar;
}

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

@ -59,6 +59,7 @@ public class GeneralPanel extends JPanel {
public GeneralPanel() {
setLayout(new BorderLayout());
setFont(new Font("Helvetica", Font.PLAIN, 12));
}
public UIAction[] getActions() {

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

@ -210,6 +210,7 @@ public class MasterPanel extends GeneralPanel {
StoreFactory.Instance().addChangeListener(fStoreChangeListener);
ActionFactory.SetComposeMessageThread(new ComposeMessageThread());
fPanel.setFont(new Font("Helvetica", Font.PLAIN, 12));
}
public void dispose() {
@ -848,8 +849,10 @@ class FolderCellRenderer extends DefaultCellRenderer {
Font fBold;
public FolderCellRenderer() {
fPlain = Font.decode("SansSerif-12");
fBold = Font.decode("SansSerif-bold-12");
// fPlain = Font.decode("SansSerif-12");
// fBold = Font.decode("SansSerif-bold-12");
fPlain = new Font("Helvetica", Font.PLAIN, 12);
fBold = new Font("Helvetica", Font.BOLD, 12);
}
public void paint(Graphics g) {

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

@ -26,6 +26,7 @@ package grendel.ui;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.io.FileOutputStream;
import java.io.InputStream;
@ -118,6 +119,7 @@ public class MessagePanel extends GeneralPanel {
fTextArea = new JEditorPane();
fTextArea.setEditable(false);
fTextArea.setContentType("text/html");
fTextArea.setFont(new Font("Helvetica", Font.PLAIN, 12));
fTextArea.setBorder(BorderFactory.createLoweredBevelBorder());
add(new JScrollPane(fTextArea));
}

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

@ -30,118 +30,118 @@ import grendel.widgets.Spring;
public class ToolBarLayout extends GridBagLayout {
static GridBagConstraints gbc = new GridBagConstraints();
public static final int HORIZONTAL = GridBagConstraints.HORIZONTAL;
public static final int VERTICAL = GridBagConstraints.VERTICAL;
static int orientation = GridBagConstraints.HORIZONTAL;
Insets myInsets = new Insets(5,5,5,5);
static GridBagConstraints gbc = new GridBagConstraints();
public static final int HORIZONTAL = GridBagConstraints.HORIZONTAL;
public static final int VERTICAL = GridBagConstraints.VERTICAL;
static int orientation = GridBagConstraints.HORIZONTAL;
Insets myInsets = new Insets(0,3,0,3);
public ToolBarLayout() {
super();
defaultConstraints.insets = myInsets;
}
public ToolBarLayout() {
super();
defaultConstraints.insets = myInsets;
}
public ToolBarLayout(int anOrientation) {
super();
orientation = anOrientation;
defaultConstraints.insets = myInsets;
}
public ToolBarLayout(int anOrientation) {
super();
orientation = anOrientation;
defaultConstraints.insets = myInsets;
}
public int getGridX() {
return defaultConstraints.gridx;
}
public int getGridX() {
return defaultConstraints.gridx;
}
public void setGridX(int x) {
defaultConstraints.gridx = x;
}
public void setGridX(int x) {
defaultConstraints.gridx = x;
}
public int getGridY() {
return defaultConstraints.gridy;
}
public int getGridY() {
return defaultConstraints.gridy;
}
public void setGridY(int y) {
defaultConstraints.gridy = y;
}
public void setGridY(int y) {
defaultConstraints.gridy = y;
}
public double getWeightX() {
return defaultConstraints.weightx;
}
public double getWeightX() {
return defaultConstraints.weightx;
}
public void setWeightX(double x) {
defaultConstraints.weightx = x;
}
public void setWeightX(double x) {
defaultConstraints.weightx = x;
}
public double getWeightY() {
return defaultConstraints.weighty;
}
public double getWeightY() {
return defaultConstraints.weighty;
}
public void setWeightY(double y) {
defaultConstraints.weighty = y;
}
public void setWeightY(double y) {
defaultConstraints.weighty = y;
}
public int getAnchor() {
return defaultConstraints.anchor;
}
public int getAnchor() {
return defaultConstraints.anchor;
}
public void setAnchor(int anAnchor) {
defaultConstraints.anchor = anAnchor;
}
public void setAnchor(int anAnchor) {
defaultConstraints.anchor = anAnchor;
}
public Insets getInsets() {
return defaultConstraints.insets;
}
public Insets getInsets() {
return defaultConstraints.insets;
}
public void setInsets(Insets anInsets) {
defaultConstraints.insets = anInsets;
}
public void setInsets(Insets anInsets) {
defaultConstraints.insets = anInsets;
}
public int getIPadX() {
return defaultConstraints.ipadx;
}
public int getIPadX() {
return defaultConstraints.ipadx;
}
public void setIPadX(int x) {
defaultConstraints.ipadx = x;
}
public void setIPadX(int x) {
defaultConstraints.ipadx = x;
}
public int getIPadY() {
return defaultConstraints.ipady;
}
public int getIPadY() {
return defaultConstraints.ipady;
}
public void setIPadY(int y) {
defaultConstraints.ipady = y;
}
public void setIPadY(int y) {
defaultConstraints.ipady = y;
}
public int getGridWidth() {
return defaultConstraints.gridwidth;
}
public int getGridWidth() {
return defaultConstraints.gridwidth;
}
public void setGridWidth(int aGridWidth) {
defaultConstraints.gridwidth = aGridWidth;
}
public void setGridWidth(int aGridWidth) {
defaultConstraints.gridwidth = aGridWidth;
}
public int getGridHeight() {
return defaultConstraints.gridheight;
}
public int getGridHeight() {
return defaultConstraints.gridheight;
}
public void setGridHeight(int aGridHeight) {
defaultConstraints.gridheight = aGridHeight;
}
public void setGridHeight(int aGridHeight) {
defaultConstraints.gridheight = aGridHeight;
}
public int getFill() {
return defaultConstraints.fill;
}
public int getFill() {
return defaultConstraints.fill;
}
public void setFill(int aFill) {
defaultConstraints.fill = aFill;
}
public void setFill(int aFill) {
defaultConstraints.fill = aFill;
}
public Spring createSpring() {
setFill(orientation);
setWeightX(10.0);
Spring res = new Spring();
public Spring createSpring() {
setFill(orientation);
setWeightX(10.0);
Spring res = new Spring();
return res;
}
return res;
}
}

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

@ -41,11 +41,8 @@ import javax.swing.JToolBar;
import javax.swing.JSplitPane;
import javax.swing.event.ChangeEvent;
//import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.toolbars.ToolbarFactory;
//import netscape.orion.toolbars.ToolBarLayout;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.IUICmd;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;
import javax.mail.Store;
import javax.mail.Folder;
@ -199,18 +196,16 @@ class UnifiedMessageFrame extends GeneralFrame {
Util.MergeToolBars(folderToolBar,
messageToolBar));
fToolBarPanelConstraints.fill = GridBagConstraints.HORIZONTAL;
fToolBarPanelConstraints.anchor = GridBagConstraints.WEST;
// fToolBarPanelConstraints.weightx = 10.0;
fToolBarPanel.add(fToolBar, fToolBarPanelConstraints);
// fToolBarPanelConstraints.weightx = 10.0;
fToolBar.add(fToolBar.makeNewSpring());
fToolBarPanelConstraints.weightx = 1.0;
fToolBarPanelConstraints.fill = GridBagConstraints.NONE;
fToolBarPanelConstraints.gridwidth = GridBagConstraints.REMAINDER;
fToolBarPanelConstraints.anchor = GridBagConstraints.EAST;
fToolBarPanelConstraints.fill = GridBagConstraints.HORIZONTAL;
fToolBarPanelConstraints.anchor = GridBagConstraints.WEST;
fToolBarPanel.add(fToolBar, fToolBarPanelConstraints);
fToolBar.add(fToolBar.makeNewSpring());
fToolBarPanelConstraints.weightx = 1.0;
fToolBarPanelConstraints.fill = GridBagConstraints.NONE;
fToolBarPanelConstraints.gridwidth = GridBagConstraints.REMAINDER;
fToolBarPanelConstraints.anchor = GridBagConstraints.EAST;
fToolBarPanel.add(fAnimation, fToolBarPanelConstraints);
fToolBarPanel.add(fAnimation, fToolBarPanelConstraints);
fStatusBar = buildStatusBar();
fPanel.add(BorderLayout.SOUTH, fStatusBar);
@ -300,7 +295,6 @@ class UnifiedMessageFrame extends GeneralFrame {
splitter2.setTopComponent(fThreads);
splitter2.setBottomComponent(fMessage);
// fStackedLayoutAction.setSelected(IUICmd.kSelected);
} else if (layout.equals(UnifiedMessageDisplayManager.SPLIT_LEFT)) {
splitter1.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
splitter2.setOrientation(JSplitPane.VERTICAL_SPLIT);
@ -311,7 +305,6 @@ class UnifiedMessageFrame extends GeneralFrame {
splitter1.setTopComponent(splitter2);
splitter1.setBottomComponent(fMessage);
// fSplitLeftLayoutAction.setSelected(IUICmd.kSelected);
} else if (layout.equals(UnifiedMessageDisplayManager.SPLIT_RIGHT)) {
splitter2.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitter1.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
@ -321,7 +314,6 @@ class UnifiedMessageFrame extends GeneralFrame {
splitter1.setTopComponent(fFolders);
splitter1.setBottomComponent(splitter2);
// fSplitRightLayoutAction.setSelected(IUICmd.kSelected);
} else { // Default: SPLIT_TOP
splitter2.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
splitter1.setOrientation(JSplitPane.VERTICAL_SPLIT);
@ -331,7 +323,6 @@ class UnifiedMessageFrame extends GeneralFrame {
splitter1.setTopComponent(splitter2);
splitter1.setBottomComponent(fMessage);
// fSplitTopLayoutAction.setSelected(IUICmd.kSelected);
}
fFolders.setPreferredSize(new Dimension(folderX, folderY));

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

@ -29,6 +29,7 @@ import java.util.Hashtable;
import java.util.Properties;
import java.awt.Container;
import java.awt.Font;
import javax.swing.JComponent;
import javax.swing.JFrame;
@ -205,16 +206,16 @@ public class XMLMenuBuilder extends XMLWidgetBuilder {
if (item != null) {
Element current = (Element)node;
if (item instanceof JSeparator) {
parent.add(item);
parent.add(item);
} else if (parent instanceof MenuCtrl) {
((MenuCtrl)parent).addItemByName(current.getAttribute(id_attr),
(JMenuItem)item);
System.out.println("adding " + current.getAttribute(id_attr));
((MenuCtrl)parent).addItemByName(current.getAttribute(id_attr),
(JMenuItem)item);
System.out.println("adding " + current.getAttribute(id_attr));
} else if (parent instanceof MenuBarCtrl) {
((MenuBarCtrl)parent).addItemByName(current.getAttribute(id_attr),
(JMenuItem)item);
System.out.println("adding " + current.getAttribute(id_attr));
((MenuBarCtrl)parent).addItemByName(current.getAttribute(id_attr),
(JMenuItem)item);
System.out.println("adding " + current.getAttribute(id_attr));
}
}
}
@ -242,8 +243,8 @@ public class XMLMenuBuilder extends XMLWidgetBuilder {
// loop through all its children
while (node != null) {
processNode(node, menu);
node = node.getNextSibling();
processNode(node, menu);
node = node.getNextSibling();
}
} else if (tag.equals(menuitem_tag)) { // menuitem tag
String type = current.getAttribute(type_attr);
@ -252,16 +253,17 @@ public class XMLMenuBuilder extends XMLWidgetBuilder {
// which type of menuitem?
if (type == null || type.equals("")) {
// no type ? it's a regular menuitem
comp = buildMenuItem(current);
comp = buildMenuItem(current);
} else if (type.equals(separator_attr)) { // separator
comp = buildSeparator(current);
comp = buildSeparator(current);
} else if (type.equals(checkbox_attr)) { // checkboxes
comp = buildCheckBoxMenuItem(current);
comp = buildCheckBoxMenuItem(current);
} else if (type.equals(radio_attr)) { // radio
comp = buildRadioMenuItem(current);
comp = buildRadioMenuItem(current);
}
}
comp.setFont(new Font("Helvetica", Font.PLAIN, 12));
return comp;
}
@ -279,14 +281,15 @@ public class XMLMenuBuilder extends XMLWidgetBuilder {
// do we add to a button group?
if (group != null) {
if (button_group.containsKey(group)) {
bg = (ButtonGroup)button_group.get(group);
bg = (ButtonGroup)button_group.get(group);
} else {
bg = new ButtonGroup();
button_group.put(group, bg);
bg = new ButtonGroup();
button_group.put(group, bg);
}
bg.add((JRadioButtonMenuItem)comp);
}
comp.setFont(new Font("Helvetica", Font.PLAIN, 12));
return comp;
}
@ -298,6 +301,7 @@ public class XMLMenuBuilder extends XMLWidgetBuilder {
protected JCheckBoxMenuItem buildCheckBoxMenuItem(Element current) {
JCheckBoxMenuItem item = new JCheckBoxMenuItem();
finishComponent(item, current);
item.setFont(new Font("Helvetica", Font.PLAIN, 12));
return item;
}
@ -318,6 +322,7 @@ public class XMLMenuBuilder extends XMLWidgetBuilder {
protected JMenuItem buildMenuItem(Element current) {
JMenuItem item = new JMenuItem();
finishComponent(item, current);
item.setFont(new Font("Helvetica", Font.PLAIN, 12));
return item;
}