frame = new JInternalFrame();\r
frame.setContentPane(this);\r
if(tp!=null)\r
- Desktop.addInternalFrame(frame, "Change Font (Tree Panel)", 480, 100, false);\r
+ Desktop.addInternalFrame(frame, "Change Font (Tree Panel)", 540, 100, false);\r
else\r
- Desktop.addInternalFrame(frame, "Change Font", 480, 100, false);\r
+ Desktop.addInternalFrame(frame, "Change Font", 540, 100, false);\r
\r
frame.setLayer(JLayeredPane.PALETTE_LAYER);\r
\r
fontSize.setSelectedItem(oldFont.getSize() + "");\r
fontStyle.setSelectedIndex(oldFont.getStyle());\r
\r
+ FontMetrics fm = getGraphics().getFontMetrics(oldFont);\r
+ monospaced.setSelected( fm.getStringBounds("M",getGraphics()).getWidth()\r
+ ==fm.getStringBounds("|",getGraphics()).getWidth());\r
+\r
+\r
init = false;\r
}\r
\r
{\r
tp.setTreeFont(newFont);\r
}\r
+\r
+ FontMetrics fm = getGraphics().getFontMetrics(newFont);\r
+\r
+ monospaced.setSelected( fm.getStringBounds("M",getGraphics()).getWidth()\r
+ ==fm.getStringBounds("|",getGraphics()).getWidth());\r
+\r
}\r
\r
/**\r
BorderLayout borderLayout3 = new BorderLayout();\r
FlowLayout flowLayout1 = new FlowLayout();\r
protected JButton defaultButton = new JButton();\r
+ protected JCheckBox monospaced = new JCheckBox();\r
+ BorderLayout borderLayout4 = new BorderLayout();\r
\r
- /**\r
+ /**\r
* Creates a new GFontChooser object.\r
*/\r
public GFontChooser()\r
jPanel3.setOpaque(false);\r
jPanel3.setLayout(borderLayout2);\r
flowLayout1.setAlignment(FlowLayout.CENTER);\r
- flowLayout1.setVgap(5);\r
- defaultButton.setText("Set as Default");\r
+ flowLayout1.setHgap(1);\r
+ flowLayout1.setVgap(5);\r
+ defaultButton.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ defaultButton.setText("Set as Default");\r
defaultButton.addActionListener(new ActionListener()\r
{\r
public void actionPerformed(ActionEvent e)\r
defaultButton_actionPerformed(e);\r
}\r
});\r
- this.add(jPanel1, null);\r
+ monospaced.setEnabled(false);\r
+ monospaced.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ monospaced.setOpaque(false);\r
+ monospaced.setToolTipText("Monospaced fonts are faster to render");\r
+ monospaced.setText("Monospaced");\r
+ this.add(jPanel1, null);\r
jPanel1.add(jLabel1, BorderLayout.WEST);\r
jPanel1.add(fontName, BorderLayout.CENTER);\r
- this.add(jPanel3, null);\r
+ this.add(monospaced);\r
+ this.add(jPanel3, null);\r
this.add(jPanel2, null);\r
jPanel2.add(jLabel3, BorderLayout.WEST);\r
jPanel2.add(fontStyle, BorderLayout.CENTER);\r
- jPanel3.add(jLabel2, BorderLayout.WEST);\r
+ jPanel3.add(jLabel2, BorderLayout.WEST);\r
jPanel3.add(fontSize, BorderLayout.CENTER);\r
this.add(ok, null);\r
this.add(cancel, null);\r
this.add(defaultButton);\r
- }\r
+ }\r
\r
/**\r
* DOCUMENT ME!\r