Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.FontData



    public Font getFont(Object element, int columnIndex) {
        Font font = Display.getCurrent().getFocusControl().getFont();
        if (columnIndex == 1) {
            font = new Font(Display.getCurrent(), new FontData("Arial", 10, SWT.NORMAL));
        }
        return font;
    }
View Full Code Here


    final Composite composite = new Composite(viewComposite,SWT.BORDER);
    composite.setBackgroundMode(SWT.INHERIT_DEFAULT);
    composite.setBackground(ColorCache.getColor(composite.getDisplay(), "#F1F9F8"));
   
    Font font = composite.getFont();
    FontData fDatas[] = font.getFontData();
    for(int i = 0 ; i < fDatas.length ; i++) {
      fDatas[i].setHeight(150 * fDatas[i].getHeight() / 100);
      if(Constants.isWindows) {
        fDatas[i].setStyle(SWT.BOLD);
      }
View Full Code Here

    layout = new GridLayout(1,false);
    layout.marginWidth = 15;
    container1.setLayout(layout);
   
    Label jmule_version = new Label(container1,SWT.LEFT);
    FontData data = skin.getLabelFont().getFontData()[0];
   
    Font bold_font = new Font(display,data.getName(),data.getHeight(),SWT.BOLD);
    jmule_version.setText(JMConstants.JMULE_FULL_NAME);
    jmule_version.setFont(bold_font);
   
    Label copyright = new Label(container1,SWT.LEFT);
    copyright.setText("Copyright (C) 2007-2010 JMule Team");
    copyright.setFont(bold_font);
   
    new Label(container1,SWT.NONE);
   
    StyledText about_text = new StyledText(container1,SWT.LEFT | SWT.READ_ONLY);
    about_text.setText(_._("aboutwindow.tab.general.label.about"));
    about_text.setWordWrap(true);
    about_text.setBackground(shell.getBackground());
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    about_text.setLayoutData(layout_data);
   
    Composite links_container = new Composite(content,SWT.NONE);
    links_container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    layout = new GridLayout(2,false);
    layout.marginWidth = 15;
    links_container.setLayout(layout);
   
    FontData link_font_data = skin.getLabelFont().getFontData()[0];
    Font link_font = new Font(SWTThread.getDisplay(),link_font_data.getName(), link_font_data.getHeight(), SWT.UNDERLINE_SINGLE);
   
    CLabel link;
   
    link = new CLabel(links_container,SWT.NONE);
    link.setText(_._("aboutwindow.tab.general.label.home_page") + " : ");
View Full Code Here

    label.setForeground(skin.getDefaultColor());
    label.setText(JMConstants.JMULE_NAME + " " + _._("updaterwindow.label.jmule_version") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    user_version = new Label(window_content,SWT.NONE);
    FontData data = skin.getDefaultFont().getFontData()[0];
    Font font = new Font(SWTThread.getDisplay(),data.getName(),data.getHeight(),SWT.BOLD );
    user_version.setFont(font);
    user_version.setText(JMConstants.CURRENT_JMULE_VERSION);
    user_version.setForeground(green_color);
   
    label = new Label(window_content,SWT.NONE);
View Full Code Here

  }

  private void initResources(Shell splash) {

    /* Font */
    FontData fontData = splash.getDisplay().getSystemFont().getFontData()[0];
    fVersionFont = new Font(splash.getDisplay(), fontData.getName(), 8, SWT.BOLD);

    /* Color */
    fVersionColor = new Color(splash.getDisplay(), new RGB(53, 53, 53));
  }
View Full Code Here

    FontData[] oldFontDatas = registry.getFontData(NEWS_TEXT_FONT_ID);
    FontData[] newFontDatas = new FontData[oldFontDatas.length];

    /* Set Height */
    for (int i = 0; i < oldFontDatas.length; i++) {
      FontData oldFontData = oldFontDatas[i];
      int oldHeight = oldFontData.getHeight();

      if (reset)
        newFontDatas[i] = new FontData(oldFontData.getName(), DEFAULT_NEWS_TEXT_FONT_HEIGHT, oldFontData.getStyle());
      else
        newFontDatas[i] = new FontData(oldFontData.getName(), zoomIn ? oldHeight + 1 : Math.max(oldHeight - 1, 0), oldFontData.getStyle());
    }

    registry.put(NEWS_TEXT_FONT_ID, newFontDatas);

    /* Store in Preferences */
 
View Full Code Here

  }

  private void initResources(Shell splash) {

    /* Font */
    FontData fontData = splash.getDisplay().getSystemFont().getFontData()[0];
    fVersionFont = new Font(splash.getDisplay(), fontData.getName(), 8, SWT.BOLD);

    /* Color */
    fVersionColor = new Color(splash.getDisplay(), new RGB(53, 53, 53));
  }
View Full Code Here

 
 
 
  public void updateFont(TreeItem item) {

    FontData fontDatas[] = item.getFont().getFontData();
    FontData data = fontDatas[0];
    boolean isBold = false;

    TreeData data_ = (TreeData) item.getData();
   
    if(data_ == null || data_.getElement() == null)
      return;     
     
    int type = data_.getType();
    Element elem = data_.getElement();
   
    if (type == Editor.EVERYDAY) {     
      if(!elem.getChildren("period").isEmpty() || !elem.getChildren("at").isEmpty())
        isBold = true;
     
    } else if(type == Editor.DAYS) {     
      if(!elem.getChildren("date").isEmpty())
        isBold = true;
     
    } else if(type == Editor.WEEKDAYS) {
      if(item.getData("key") != null && item.getData("key").equals("holidays_@_weekdays")) {
        if(elem.getChild("holidays") != null && !elem.getChild("holidays").getChildren("weekdays").isEmpty()) {
          isBold = true;
        }         
      } else {
        if(!elem.getChildren("weekdays").isEmpty())
          isBold = true;
      }

    } else if(type == Editor.MONTHDAYS) {     
      if(!elem.getChildren("monthdays").isEmpty() && !elem.getChild("monthdays").getChildren("day").isEmpty())
        isBold = true;         

    } else if(type == Editor.ULTIMOS) {
      if(!elem.getChildren("ultimos").isEmpty())
        isBold = true;         

    } else if(type == Editor.SPECIFIC_WEEKDAYS) {
      if(!elem.getChildren("monthdays").isEmpty() && !elem.getChild("monthdays").getChildren("weekday").isEmpty())
        isBold = true;
    } else if(type == Editor.SPECIFIC_MONTHS) {
      if(!elem.getChildren("month").isEmpty())
        isBold = true;
    } else if(type == Editor.RUNTIME) {
      elem = elem.getChild("run_time");
      if(elem != null) {
        /*int hasAttribute = Utils.getAttributeValue("begin", elem).length() + Utils.getAttributeValue("end", elem).length() +
        (Utils.getAttributeValue("let_run", elem).equals("yes") ? 1 : 0) +
        (Utils.getAttributeValue("once", elem).equals("yes") ? 1 : 0);
       
        if(hasAttribute > 0)
        */
        if(elem.getAttributes().size()>0)
          isBold = true;
      }
    }

    Font font = null;
    if(isBold){
      font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);           
    } else {     
      font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.NONE);

    }
    item.setFont(font);

  }
View Full Code Here

      String _currOrderId = orderId != null && orderId.length()>0? "," + orderId : "";
      xmlDetailsConfigFilename = new File(xmlPaths, cJobchain.getText()+ _currOrderId + ".config.xml").getCanonicalPath();

      if(xmlDetailsConfigFilename != null && xmlDetailsConfigFilename.trim().length() > 0 && new File(xmlDetailsConfigFilename).exists() ) {
        FontData fontDatas[] = this.getFont().getFontData();
        FontData fdata = fontDatas[0];
        Font font = new Font(Display.getCurrent(), fdata.getName(), fdata.getHeight(), SWT.BOLD);
        butDetails.setFont(font);
        butRemove.setEnabled(true);
      } else {

        FontData fontDatas[] = this.getFont().getFontData();
        FontData fdata = fontDatas[0];
        Font font = new Font(Display.getCurrent(), fdata.getName(), fdata.getHeight(), SWT.NORMAL);
        butDetails.setFont(font);
        butRemove.setEnabled(false);
      }

View Full Code Here

    butTemp.setVisible(false);

    butApply = new Button(parameterGroup, SWT.NONE);   
    butApply.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butApply.setEnabled(isEditable);
    FontData fontDatas[] = butApply.getFont().getFontData();
    FontData data = fontDatas[0];
    butApply.setFont(new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD));
    butApply.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
       
        save();
      }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.FontData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.