forked from GitHub/gf-core
*** empty log message ***
This commit is contained in:
@@ -18,7 +18,7 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
|
|||||||
private String[] envfonts;
|
private String[] envfonts;
|
||||||
private Font font;
|
private Font font;
|
||||||
Font[] fontObjs;
|
Font[] fontObjs;
|
||||||
private static int DEFAULT_FONT_SIZE = 18;
|
private static int DEFAULT_FONT_SIZE = 20;
|
||||||
private JComboBox fontList;
|
private JComboBox fontList;
|
||||||
private JLabel fontLabel = new JLabel(" Font: ");
|
private JLabel fontLabel = new JLabel(" Font: ");
|
||||||
private JComboBox sizeList;
|
private JComboBox sizeList;
|
||||||
@@ -346,12 +346,8 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
|
|||||||
}
|
}
|
||||||
sizeList.addActionListener(this);
|
sizeList.addActionListener(this);
|
||||||
|
|
||||||
sizeList.setFont(font);
|
fontEveryWhere(font);
|
||||||
fontList.setFont(font);
|
|
||||||
menu.setFont(font);
|
|
||||||
filter.setFont(font);
|
|
||||||
modify.setFont(font);
|
|
||||||
|
|
||||||
upPanel.add(sizeLabel);
|
upPanel.add(sizeLabel);
|
||||||
upPanel.add(sizeList);
|
upPanel.add(sizeList);
|
||||||
upPanel.add(fontLabel);
|
upPanel.add(fontLabel);
|
||||||
@@ -733,7 +729,7 @@ System.out.println("encoding "+defaultEncoding);
|
|||||||
|
|
||||||
more = true;
|
more = true;
|
||||||
while (more){
|
while (more){
|
||||||
if ((result.indexOf("/gf")==-1)&&(result.indexOf("lin")==-1)) {
|
if ((result.indexOf("/gfinit")==-1)&&(result.indexOf("lin")==-1)) {
|
||||||
//form lang and Menu menu:
|
//form lang and Menu menu:
|
||||||
cbMenuItem = new JCheckBoxMenuItem(result.substring(4));
|
cbMenuItem = new JCheckBoxMenuItem(result.substring(4));
|
||||||
if (debug) System.out.println ("menu item: "+result.substring(4));
|
if (debug) System.out.println ("menu item: "+result.substring(4));
|
||||||
@@ -772,12 +768,12 @@ System.out.println("encoding "+defaultEncoding);
|
|||||||
// read </language>
|
// read </language>
|
||||||
result = fromProc.readLine();
|
result = fromProc.readLine();
|
||||||
if (debug) System.out.println("2 "+result);
|
if (debug) System.out.println("2 "+result);
|
||||||
// read <language> or </gf...>
|
// read <language> or </gfinit...>
|
||||||
result = fromProc.readLine();
|
result = fromProc.readLine();
|
||||||
if (debug) System.out.println("3 "+result);
|
if (debug) System.out.println("3 "+result);
|
||||||
if ((result.indexOf("/gf")!=-1)||(result.indexOf("lin")!=-1))
|
if ((result.indexOf("/gfinit")!=-1)||(result.indexOf("lin")!=-1))
|
||||||
more = false;
|
more = false;
|
||||||
if (result.indexOf("/gf")!=-1)
|
if (result.indexOf("/gfinit")!=-1)
|
||||||
finished = true;
|
finished = true;
|
||||||
// registering the file name:
|
// registering the file name:
|
||||||
if (result.indexOf("language")!=-1) {
|
if (result.indexOf("language")!=-1) {
|
||||||
@@ -950,32 +946,8 @@ System.out.println("encoding "+defaultEncoding);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void recursion(JMenu subMenu, Font font)
|
public void fontEveryWhere(Font font)
|
||||||
{
|
{
|
||||||
for (int i = 0; i<subMenu.getItemCount(); i++)
|
|
||||||
{
|
|
||||||
JMenuItem item = subMenu.getItem(i);
|
|
||||||
if (item != null)
|
|
||||||
{
|
|
||||||
item.setFont(font);
|
|
||||||
String name = item.getClass().getName();
|
|
||||||
System.out.println(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void actionPerformed(ActionEvent ae)
|
|
||||||
{
|
|
||||||
boolean abs = true;
|
|
||||||
Object obj = ae.getSource();
|
|
||||||
|
|
||||||
if ( obj == fontList ) {
|
|
||||||
font = new Font((String)fontList.getSelectedItem(), Font.PLAIN, ((Integer)sizeList.getSelectedItem()).intValue());
|
|
||||||
output.setFont(font);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( obj == sizeList ) {
|
|
||||||
font = new Font((String)fontList.getSelectedItem(), Font.PLAIN, ((Integer)sizeList.getSelectedItem()).intValue());
|
|
||||||
output.setFont(font);
|
output.setFont(font);
|
||||||
field.setFont(font);
|
field.setFont(font);
|
||||||
tree.tree.setFont(font);
|
tree.tree.setFont(font);
|
||||||
@@ -1022,6 +994,35 @@ System.out.println("encoding "+defaultEncoding);
|
|||||||
viewMenu.setFont(font);
|
viewMenu.setFont(font);
|
||||||
recursion(viewMenu, font);
|
recursion(viewMenu, font);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void recursion(JMenu subMenu, Font font)
|
||||||
|
{
|
||||||
|
for (int i = 0; i<subMenu.getItemCount(); i++)
|
||||||
|
{
|
||||||
|
JMenuItem item = subMenu.getItem(i);
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
item.setFont(font);
|
||||||
|
String name = item.getClass().getName();
|
||||||
|
System.out.println(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent ae)
|
||||||
|
{
|
||||||
|
boolean abs = true;
|
||||||
|
Object obj = ae.getSource();
|
||||||
|
|
||||||
|
if ( obj == fontList ) {
|
||||||
|
font = new Font((String)fontList.getSelectedItem(), Font.PLAIN, ((Integer)sizeList.getSelectedItem()).intValue());
|
||||||
|
output.setFont(font);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( obj == sizeList ) {
|
||||||
|
font = new Font((String)fontList.getSelectedItem(), Font.PLAIN, ((Integer)sizeList.getSelectedItem()).intValue());
|
||||||
|
fontEveryWhere(font);
|
||||||
cbMenuItem.setFont(font);
|
cbMenuItem.setFont(font);
|
||||||
rbMenuItem.setFont(font);
|
rbMenuItem.setFont(font);
|
||||||
fileMenuItem.setFont(font);
|
fileMenuItem.setFont(font);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import javax.swing.filechooser.*;
|
|||||||
|
|
||||||
public class GrammarFilter extends FileFilter {
|
public class GrammarFilter extends FileFilter {
|
||||||
|
|
||||||
// Accept all directories and all gf, gfm files.
|
// Accept all directories and all gf, gfcm files.
|
||||||
public boolean accept(File f) {
|
public boolean accept(File f) {
|
||||||
if (f.isDirectory()) {
|
if (f.isDirectory()) {
|
||||||
return true;
|
return true;
|
||||||
@@ -13,7 +13,7 @@ public class GrammarFilter extends FileFilter {
|
|||||||
String extension = Utils.getExtension(f);
|
String extension = Utils.getExtension(f);
|
||||||
if (extension != null) {
|
if (extension != null) {
|
||||||
if (extension.equals(Utils.gf) ||
|
if (extension.equals(Utils.gf) ||
|
||||||
extension.equals(Utils.gfm)) {
|
extension.equals(Utils.gfcm)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import java.io.File;
|
|||||||
public class Utils {
|
public class Utils {
|
||||||
|
|
||||||
public final static String gf = "gf";
|
public final static String gf = "gf";
|
||||||
public final static String gfm = "gfm";
|
public final static String gfcm = "gfcm";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the extension of a file.
|
* Get the extension of a file.
|
||||||
|
|||||||
Reference in New Issue
Block a user