diff options
| -rw-r--r-- | grammars/health/ExtraSwe.gf | 1 | ||||
| -rw-r--r-- | grammars/health/HealthFre.gf | 1 | ||||
| -rw-r--r-- | grammars/health/HealthResourceIta.gf | 5 | ||||
| -rw-r--r-- | grammars/health/HealthRus.gf | 10 | ||||
| -rw-r--r-- | grammars/health/HealthSwe.gf | 10 | ||||
| -rw-r--r-- | src/JavaGUI/GFEditor2.java | 60 |
6 files changed, 67 insertions, 20 deletions
diff --git a/grammars/health/ExtraSwe.gf b/grammars/health/ExtraSwe.gf index af1a829ba..0f6f4e4fb 100644 --- a/grammars/health/ExtraSwe.gf +++ b/grammars/health/ExtraSwe.gf @@ -60,6 +60,7 @@ oper } ;
verbTa = {s = table {VPres Infinit _ => "ta" ; VPres Indicat _ => "tar" ; VPres Imperat _ => "ta"}; s1 =""} ;
+ verbHa = {s = table {VPres Infinit _ => "ha" ; VPres Indicat _ => "har" ; VPres Imperat _ => "ha"}; s1 =""} ;
verbBehova = {s = table {VPres Infinit _ => "behöva" ; VPres Indicat _ => "behöver" ; VPres Imperat _ =>
"behöv"}; s1 =""} ;
diff --git a/grammars/health/HealthFre.gf b/grammars/health/HealthFre.gf index 677daaee8..5d8818108 100644 --- a/grammars/health/HealthFre.gf +++ b/grammars/health/HealthFre.gf @@ -9,7 +9,6 @@ concrete HealthFre of Health = open PredicationFre, ResourceFre, Prelude, Syntax -- because of the UTF8 problem with non-utf8 resource grammars!
flags
- coding=utf8 ;
startcat=Phr ; lexer=text ; parser=chart ; unlexer=text ;
lincat
diff --git a/grammars/health/HealthResourceIta.gf b/grammars/health/HealthResourceIta.gf index 208af4a20..25003dcf7 100644 --- a/grammars/health/HealthResourceIta.gf +++ b/grammars/health/HealthResourceIta.gf @@ -1,6 +1,7 @@ -- use this path to read the grammar from the same directory
---# -path=.:../abstract:../../prelude:../italian:../romance
-concrete HealthResourceIta of HealthResource = open ResourceIta, Prelude, SyntaxIta, ExtraIta, MorphoIta in {
+--# -path=.:../newresource/abstract:../prelude:../newresource/italian:../newresource/romance
+
+concrete HealthIta of Health = open ResourceIta, Prelude, SyntaxIta, ExtraIta, MorphoIta in {
flags
startcat=Phr ; lexer=text ; parser=chart ; unlexer=text ;
diff --git a/grammars/health/HealthRus.gf b/grammars/health/HealthRus.gf index 749cbcc90..869d83e31 100644 --- a/grammars/health/HealthRus.gf +++ b/grammars/health/HealthRus.gf @@ -1,7 +1,7 @@ -- use this path to read the grammar from the same directory
+--# -path=.:../newresource/abstract:../prelude:../newresource/russian
concrete HealthRus of Health = open PredicationRus, ResourceRus, Prelude, SyntaxRus, ExtraRus in {
---# -path=.:../newresource/abstract:../prelude:../newresource/russian
flags
coding=utf8 ;
@@ -50,17 +50,17 @@ lin (extVerb verbSlomat Act Past)**{lock_TV = <>}) patient (mkNounPhrase patient.n painkiller ** {lock_NP = <>}) ;
HaveIllness patient symptom = U_predTransVerb True tvHave
- patient (mkNounPhrase Sg symptom) ;
+ patient (mkNounPhrase Sg symptom ** {lock_NP = <>}) ;
Complain = U_predTransVerb True tvHave ;
NeedDoctor = predNeedShortAdjective True ;
NeedMedicine = predNeedShortAdjective True ;
PainIn patient head = U_predTransVerb True (mkDirectVerb
- (extVerb verbBolet_2 Act Present )) patient (mkNounPhrase patient.n head) ;
+ (extVerb verbBolet_2 Act Present ) ** {lock_TV =<>}) patient (mkNounPhrase patient.n head ** {lock_NP =<>}) ;
PainInMod patient head degree = U_predTransVerb True (mkDirectVerb
- (extVerb have Act Present)) patient (mkNounPhrase Sg (ModAdj degree
- (AppFun (mkFun bol "в" Prepos ** {lock_Fun = <>}) (mkNounPhrase patient.n head** {lock_NP = <>}))));
+ (extVerb have Act Present) ** {lock_TV =<>}) patient (mkNounPhrase Sg (ModAdj degree
+ (AppFun (mkFun bol "в" Prepos ** {lock_Fun = <>}) (mkNounPhrase patient.n head** {lock_NP = <>}))) ** {lock_NP =<>});
};
diff --git a/grammars/health/HealthSwe.gf b/grammars/health/HealthSwe.gf index 406d8d975..3c4b1d1af 100644 --- a/grammars/health/HealthSwe.gf +++ b/grammars/health/HealthSwe.gf @@ -44,7 +44,7 @@ lin Terrible = AdjP1 (extAdjective (aFin "hemsk")** {lock_Adj1 = <>}) ;
BeInCondition = PredVP ;
- HaveIllness patient illness = predV2 (mkDirectVerb verbHava** {lock_TV =<>}) patient
+ HaveIllness patient illness = predV2 (mkDirectVerb verbHa** {lock_TV =<>}) patient
(DetNP (nullDet ** {lock_Det = <>}) illness) ;
NeedMedicine patient illness = predV2 (mkDirectVerb verbBehova** {lock_TV =<>}) patient
(DetNP (nullDet ** {lock_Det = <>}) illness) ;
@@ -55,11 +55,11 @@ lin Fever = DetNP (nullDet ** {lock_Det = <>}) (n2n (extCommNoun NoMasc (sFeber "feb")) ** {lock_CN = <>}) ;
FeverMod degree = DetNP (nullDet ** {lock_Det = <>}) (ModAdj degree (n2n (extCommNoun NoMasc (sFeber "feb")) ** {lock_CN = <>})) ;
- Complain = predV2 (mkDirectVerb verbHava ** {lock_TV =<>}) ;
- Broken patient head = predV2 (mkTransVerb verbHava "brutit" ** {lock_TV =<>} ) patient
+ Complain = predV2 (mkDirectVerb verbHa ** {lock_TV =<>}) ;
+ Broken patient head = predV2 (mkTransVerb verbHa "brutit" ** {lock_TV =<>} ) patient
(defNounPhrase patient.n head ** {lock_NP =<>}) ;
- PainIn patient head = predV2 (mkDirectVerb verbHava** {lock_TV =<>}) patient
+ PainIn patient head = predV2 (mkDirectVerb verbHa** {lock_TV =<>}) patient
(
DetNP (nullDet ** {lock_Det = <>})
( AppFun
@@ -67,7 +67,7 @@ lin ((defNounPhrase patient.n head)** {lock_NP = <>})
)
) ;
- PainInMod patient head degree = predV2 (mkDirectVerb verbHava** {lock_TV =<>}) patient
+ PainInMod patient head degree = predV2 (mkDirectVerb verbHa** {lock_TV =<>}) patient
(
DetNP (nullDet ** {lock_Det = <>})
( modCommNounPhrase degree
diff --git a/src/JavaGUI/GFEditor2.java b/src/JavaGUI/GFEditor2.java index 2ad3e7f05..f8c1e1fd1 100644 --- a/src/JavaGUI/GFEditor2.java +++ b/src/JavaGUI/GFEditor2.java @@ -14,6 +14,15 @@ import java.util.*; public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
KeyListener, FocusListener {
+ private int[] sizes = {10,12,16,20,25,30,36};
+ private String[] envfonts;
+ private Font[] fontObjs;
+ private static int DEFAULT_FONT_SIZE = 12;
+ private JComboBox fontList;
+ private JLabel fontLabel = new JLabel(" Font: ");
+ private JComboBox sizeList;
+ private JLabel sizeLabel = new JLabel(" Size: ");
+
public JPopupMenu popup2 = new JPopupMenu();
public JMenuItem menuItem2;
public static JTextField field = new JTextField("textField!");
@@ -22,8 +31,8 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, public static String selectedText="";
public static boolean debug = false;
- public static boolean debug3 = false;
- public static boolean debug2 = true;
+ public static boolean debug3 = true;
+ public static boolean debug2 = false;
public static boolean selectionCheck = false;
public static String focusPosition = "";
public static String stringToAppend = "";
@@ -153,6 +162,7 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, }
});
+
//Add listener to components that can bring up popup menus.
MouseListener popupListener2 = new PopupListener();
output.addMouseListener(popupListener2);
@@ -311,14 +321,34 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, upPanel.add(open);
upPanel.add(save);
upPanel.add(newTopic);
+ upPanel.add(filter);
filter.setToolTipText("Choosing the linearization representation format");
modeMenu.setToolTipText("Choosing the refinement options' representation");
statusLabel.setToolTipText("The current focus type");
list.setToolTipText("The list of current refinment options");
+
+ GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ envfonts = gEnv.getAvailableFontFamilyNames();
+ fontObjs = new Font[envfonts.length];
+ for (int fi = 0; fi < envfonts.length; fi++) {
+ fontObjs[fi] = new Font(envfonts[fi], Font.PLAIN, DEFAULT_FONT_SIZE);
+ }
+ fontList = new JComboBox(envfonts);
+ fontList.addActionListener(this);
+ sizeList = new JComboBox();
+ for (int i = 0; i<sizes.length; i++)
+ {
+ sizeList.addItem(new Integer(sizes[i]));
+ }
+ sizeList.addActionListener(this);
+
+ upPanel.add(fontLabel);
+ upPanel.add(fontList);
+ upPanel.add(sizeLabel);
+ upPanel.add(sizeList);
+
tree.setToolTipText("The abstract syntax tree representation of the current editing object");
- upPanel.add(filter);
- //upPanel.add(mode);
populateTree(tree);
outputPanelUp.setLayout(new BorderLayout());
outputPanelUp.add(outputPanelCenter, BorderLayout.CENTER);
@@ -457,6 +487,7 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, inputPanel2.add(browse);
dialog.setSize(350,135);
+
try {
result = fromProc.readLine();
while(result != null) {
@@ -909,6 +940,21 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, {
boolean abs = true;
Object obj = ae.getSource();
+ Font font;
+
+ 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);
+ field.setFont(font);
+ tree.tree.setFont(font);
+ list.setFont(font);
+ }
+
if ( obj == menu ) {
if (!menu.getSelectedItem().equals("New"))
{
@@ -1962,14 +2008,14 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, // middle click
if (e.getButton() == MouseEvent.BUTTON2)
{
- if (debug3) System.out.println("MIDDLE BUTTON!");
// selection Exists:
if (!selectedText.equals(""))
{
+ if (debug3) System.out.println(e.getX() + " " + e.getY());
if (selectedText.length()<5)
- field.setBounds(e.getX()+200, e.getY()+80, 140, 30);
+ field.setBounds(e.getX()+(int)Math.round(tree.getBounds().getWidth()), e.getY()+80, 400, 40);
else
- field.setBounds(e.getX()+200, e.getY()+80, selectedText.length()*10, 30);
+ field.setBounds(e.getX()+(int)Math.round(tree.getBounds().getWidth()), e.getY()+80, selectedText.length()*20, 40);
getLayeredPane().add(field, new Integer(1), 0);
field.setText(selectedText);
field.requestFocusInWindow();
|
