Example usage for java.awt Font getSize

List of usage examples for java.awt Font getSize

Introduction

In this page you can find the example usage for java.awt Font getSize.

Prototype

public int getSize() 

Source Link

Document

Returns the point size of this Font , rounded to an integer.

Usage

From source file:cc.pinel.mangue.ui.ChaptersPanel.java

/**
 * Highlights the label./* w  ww . ja  va 2 s .c  o  m*/
 * 
 * @param label the chapter label
 */
private void highlightLabel(KLabel label) {
    Font font = label.getFont();
    label.setFont(new Font(font.getFamily(), Font.BOLD, font.getSize()));
    label.setForeground(new Color(255, 84, 84));
}

From source file:cc.pinel.mangue.ui.ChaptersPanel.java

/**
 * Unhighlights the label./*from w ww  . j  a v  a2  s .c  o m*/
 * 
 * @param label the chapter label
 */
private void unhighlightLabel(KLabel label) {
    Font font = label.getFont();
    label.setFont(new Font(font.getFamily(), Font.PLAIN, font.getSize()));
    label.setForeground(Color.BLACK);
}

From source file:de.codesourcery.eve.skills.ui.components.impl.ItemBrowserComponent.java

public ItemBrowserComponent() {
    super();/* w  w  w  .j  a v  a  2  s  .  c o m*/
    itemTree.setRootVisible(false);

    final Font currFont = itemDetails.getFont();
    itemDetails.setFont(new Font("monospaced", currFont.getStyle(), currFont.getSize()));
}

From source file:ca.sqlpower.wabit.dao.session.FontConverter.java

public String convertToSimpleType(Font convertFrom, Object... additionalInfo) {
    StringBuffer buffer = new StringBuffer();
    buffer.append(convertToStandardFontName(convertFrom.getFontName()));
    buffer.append("-");
    buffer.append(FontStyle.getStyleByValue(convertFrom.getStyle()).getEncodedName());
    buffer.append("-");
    buffer.append(convertFrom.getSize());
    return buffer.toString();
}

From source file:NwFontChooserS.java

private NwFontChooserS(Frame parent, boolean modal, Font font) {
    super(parent, modal);
    initAll();/*from  w ww. ja va 2s  .  c  o  m*/
    setTitle("Font Choosr");
    if (font == null)
        font = Sample.getFont();
    FontList.setSelectedItem(font.getName());
    SizeList.setSelectedItem(font.getSize() + "");
    StyleList.setSelectedItem(styleList[font.getStyle()]);

}

From source file:org.datacleaner.widgets.visualization.JobGraphTransformers.java

private Font font(Font font, float fontFactor) {
    if (fontFactor == 1.0) {
        return font;
    }/*from   www. ja  v  a  2  s .  com*/
    return font.deriveFont(font.getSize() * fontFactor);
}

From source file:piramide.interaction.reasoner.FuzzyReasonerWizardFacade.java

@Override
public void generateMembershipFunctionGraph(boolean isInput, boolean isDevices, String variableName,
        RegionDistributionInfo[] linguisticTerms, OutputStream destination, int width, int height,
        Geolocation geo, DecayFunctions decayFunction, Calendar when) {
    BufferedImage img;/*from   ww  w  .  j  a  va 2 s  .c om*/
    if (variableName == null) {
        img = createErrorMessagesImage("Error generating graph: variableName not provided");
    } else if (linguisticTerms == null) {
        img = createErrorMessagesImage("Error generating graph: linguisticTerms not provided");
    } else if (isInput && isDevices && !isValidDeviceVariableName(variableName)) {
        img = createErrorMessagesImage("Error generating graph: invalid device variable name: " + variableName);
    } else if (isInput && !isDevices && !isValidUserVariableName(variableName)) {
        img = createErrorMessagesImage("Error generating graph: invalid user variable name: " + variableName);
    } else {
        try {
            final WarningStore warningStore = new WarningStore();
            final net.sourceforge.jFuzzyLogic.rule.Variable variable = processVariable(isInput, isDevices,
                    variableName, linguisticTerms, geo, decayFunction, when, warningStore);

            final JFreeChart theChart = variable.chart(false);

            final String[] messages = warningStore.getMessages();
            if (messages.length > 0) {
                final Font font = TextTitle.DEFAULT_FONT;
                final Font bigBold = new Font(font.getName(), Font.BOLD, font.getSize() + 2);
                final Font bold = new Font(font.getName(), Font.BOLD, font.getSize());

                theChart.addSubtitle(new TextTitle("WARNINGS:", bigBold, Color.RED, Title.DEFAULT_POSITION,
                        Title.DEFAULT_HORIZONTAL_ALIGNMENT, Title.DEFAULT_VERTICAL_ALIGNMENT,
                        Title.DEFAULT_PADDING));
                for (String message : messages)
                    theChart.addSubtitle(new TextTitle(message, bold, Color.RED, Title.DEFAULT_POSITION,
                            Title.DEFAULT_HORIZONTAL_ALIGNMENT, Title.DEFAULT_VERTICAL_ALIGNMENT,
                            Title.DEFAULT_PADDING));
            }
            img = theChart.createBufferedImage(width, height);

        } catch (FuzzyReasonerException e) {
            e.printStackTrace();
            img = createErrorMessagesImage("Error generating graph: " + e.getMessage());
        }
    }

    try {
        final ImageEncoder myEncoder = ImageEncoderFactory.newInstance("png");
        myEncoder.encode(img, destination);
        destination.flush();
        destination.close();
    } catch (IOException e) {
        // Cry
        e.printStackTrace();
        return;
    }
}

From source file:net.sf.jasperreports.customizers.marker.CategoryMarkerCustomizer.java

protected CategoryMarker createMarker(JRChart jrc) {
    Comparable<?> value = getProperty(PROPERTY_CATEGORY);

    if (value == null) {
        return null;
    }/*from  w  w w  . j a  va 2 s.  com*/

    CategoryMarker marker = new CategoryMarker(value);

    configureMarker(marker);

    configureStroke(marker);

    Boolean drawAsLine = getBooleanProperty(PROPERTY_DRAW_AS_LINE);
    if (drawAsLine != null) {
        marker.setDrawAsLine(drawAsLine);
    }

    //Setup the font
    Font font = marker.getLabelFont();

    String fontName = getProperty(PROPERTY_FONT_NAME);
    if (fontName == null) {
        fontName = font.getName();
    }

    Float fontSize = getFloatProperty(PROPERTY_FONT_SIZE);
    if (fontSize == null) {
        fontSize = Float.valueOf(font.getSize());
    }

    int fontStyle = Font.PLAIN;
    Boolean isBold = getBooleanProperty(PROPERTY_FONT_BOLD);
    if (isBold != null) {
        fontStyle = fontStyle | Font.BOLD;
    }
    Boolean isItalic = getBooleanProperty(PROPERTY_FONT_ITALIC);
    if (isItalic != null) {
        fontStyle = fontStyle | Font.ITALIC;
    }

    marker.setLabelFont(FontUtil.getInstance(filler.getJasperReportsContext()).getAwtFontFromBundles(fontName,
            fontStyle, fontSize, filler.getFillContext().getMasterLocale(), true));

    return marker;
}

From source file:org.freeplane.main.application.UserPropertiesUpdater.java

private void updateNoteStyle(final NodeStyleController nodeStyleController, MapModel defaultStyleMap) {
    if (ResourceController.getResourceController()
            .getBooleanProperty((MNoteController.RESOURCES_USE_DEFAULT_FONT_FOR_NOTES_TOO)))
        return;//w  w  w  . j a v a 2s  . co  m
    final NodeModel styleNode = MapStyleModel.getExtension(defaultStyleMap)
            .getStyleNode(MapStyleModel.NOTE_STYLE);
    if (styleNode == null)
        return;
    styleNode.removeExtension(NodeStyleModel.class);
    final Font defaultFont = new JLabel().getFont();
    final NodeStyleModel nodeStyleModel = new NodeStyleModel();
    nodeStyleModel.setFontFamilyName(defaultFont.getFamily());
    nodeStyleModel.setFontSize(defaultFont.getSize());
    styleNode.addExtension(nodeStyleModel);
}

From source file:com.petersoft.advancedswing.enhancedtextarea.EnhancedTextArea.java

private void jFontSmallerButtonActionPerformed(ActionEvent evt) {
    Font f = jTextArea.getFont();
    Font newFont = new Font(f.getFontName(), f.getStyle(), f.getSize() - 1);
    jTextArea.setFont(newFont);//w ww. j av  a2  s.  c  om
    lines.setFont(newFont);
}