Changeset 614

Show
Ignore:
Timestamp:
01/31/10 18:10:55 (3 years ago)
Author:
stefan
Message:

font name and size are preselected in font window

Location:
trunk/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/gproperties/GProperties.java

    r613 r614  
    145145  public static void setEditorFont(Font editorFont) { 
    146146    GProperties.editorFont = editorFont; 
    147     properties.setProperty(EDITOR_FONT_NAME, editorFont.getFontName()); 
     147    properties.setProperty(EDITOR_FONT_NAME, editorFont.getFamily()); 
    148148    properties.setProperty(EDITOR_FONT_SIZE, "" + editorFont.getSize()); 
    149149    save(); 
  • trunk/src/jlatexeditor/JLatexEditorJFrame.java

    r612 r614  
    813813*/ 
    814814    if(action.equals("font")){ 
    815       SCEFontWindow fontDialog = new SCEFontWindow(GProperties.getEditorFont().getFontName(), GProperties.getEditorFont().getSize(), this); 
     815      SCEFontWindow fontDialog = new SCEFontWindow(GProperties.getEditorFont().getFamily(), GProperties.getEditorFont().getSize(), this); 
    816816      fontDialog.setVisible(true); 
    817817    } else 
  • trunk/src/sce/component/SCEFontWindow.java

    r610 r614  
    2121  private int fontSize; 
    2222  private int prevFontSize; 
     23  private boolean init = true; 
    2324 
    2425  private ActionListener actionListener; 
     
    123124    pack(); 
    124125    setVisible(true); 
     126 
     127    // select the current font and size 
     128    int nr = 0; 
     129    fontList.setSelectedValue(fontName, true); 
     130    /* 
     131    for (String aFontName : GProperties.getMonospaceFonts()) { 
     132      if (((String) aFontName).equals(fontName)) { 
     133        fontList.setSelectedIndex(nr); 
     134        System.out.println(nr); 
     135      } 
     136      nr++; 
     137    } 
     138    */ 
     139    sizeList.setSelectedIndex(GProperties.getEditorFont().getSize() - 6); 
     140     
     141    init = false; 
    125142  } 
    126143 
    127144  public void valueChanged(ListSelectionEvent e) { 
     145    if (init) return; 
     146 
    128147    if(e.getSource() == fontList.getSelectionModel()) { 
    129148      fontName = fontList.getSelectedValue().toString();