Example usage for java.awt Font SANS_SERIF

List of usage examples for java.awt Font SANS_SERIF

Introduction

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

Prototype

String SANS_SERIF

To view the source code for java.awt Font SANS_SERIF.

Click Source Link

Document

A String constant for the canonical family name of the logical font "SansSerif".

Usage

From source file:org.apache.hadoop.chukwa.analysis.salsa.visualization.Heatmap.java

protected void addHostLabels(HeatmapData hd) {
    Table legend_labels_table = new Table();
    legend_labels_table.addColumn("label", String.class);
    legend_labels_table.addRows(hd.hostnames.length);
    for (int i = 0; i < hd.hostnames.length; i++) {
        legend_labels_table.setString(i, "label", hd.hostnames[i]);
    }//from w w w  .  j  av  a  2  s  .c  om
    float start_x = LEGEND_X_OFFSET;
    float start_y = LEGEND_Y_OFFSET + BORDER[1] + (BOXWIDTH / 2);
    float incr = this.BOXWIDTH;
    VisualTable legend_labels_table_viz = this.viz.addTable(legendgroup, legend_labels_table);
    for (int i = 0; i < hd.hostnames.length; i++) {
        legend_labels_table_viz.setFloat(i, VisualItem.X, start_x + LEGEND_TEXT_OFFSET);
        legend_labels_table_viz.setFloat(i, VisualItem.Y, start_y + (i * incr));
        legend_labels_table_viz.setTextColor(i, ColorLib.color(java.awt.Color.BLACK));
        legend_labels_table_viz.setFont(i, new Font(Font.SANS_SERIF, Font.PLAIN, LEGEND_FONT_SIZE));
    }
}

From source file:org.apache.hadoop.chukwa.analysis.salsa.visualization.Heatmap.java

protected void addAddlInfo(HeatmapData hd) {
    Table legend_labels_table = new Table();
    legend_labels_table.addColumn("label", String.class);
    legend_labels_table.addRows(3);//from   w  ww.  ja  v  a2  s  .  c om

    String hostnumstring = "Number of hosts: " + hd.num_hosts;
    if (sort_nodes) {
        hostnumstring += " (nodes sorted)";
    } else {
        hostnumstring += " (nodes not sorted)";
    }
    if (add_info_extra != null)
        hostnumstring += add_info_extra;
    legend_labels_table.setString(0, "label", hostnumstring);
    legend_labels_table.setString(1, "label", "Src. Hosts");
    legend_labels_table.setString(2, "label", "Dest. Hosts");

    float start_x = LEGEND_X_OFFSET;
    float start_y = LEGEND_Y_OFFSET + BORDER[1] + (BOXWIDTH / 2);
    float incr = this.BOXWIDTH;
    VisualTable legend_labels_table_viz = this.viz.addTable(addinfogroup, legend_labels_table);

    legend_labels_table_viz.setFloat(0, VisualItem.X, this.SIZE_X / 2);
    legend_labels_table_viz.setFloat(0, VisualItem.Y, BORDER[1] / 2);
    legend_labels_table_viz.setTextColor(0, ColorLib.color(java.awt.Color.BLACK));
    legend_labels_table_viz.setFont(0, new Font(Font.SANS_SERIF, Font.PLAIN, LEGEND_FONT_SIZE));

    legend_labels_table_viz.setFloat(1, VisualItem.X, this.SIZE_X / 2);
    legend_labels_table_viz.setFloat(1, VisualItem.Y, BORDER[1] + (BOXWIDTH * hd.num_hosts) + BORDER[3] / 2);
    legend_labels_table_viz.setTextColor(1, ColorLib.color(java.awt.Color.BLACK));
    legend_labels_table_viz.setFont(1, new Font(Font.SANS_SERIF, Font.PLAIN, LEGEND_FONT_SIZE));

    legend_labels_table_viz.setFloat(2, VisualItem.X, BORDER[0] + (BOXWIDTH * hd.num_hosts) + BORDER[2] / 2);
    legend_labels_table_viz.setFloat(2, VisualItem.Y, this.SIZE_Y / 2);
    legend_labels_table_viz.setTextColor(2, ColorLib.color(java.awt.Color.BLACK));
    legend_labels_table_viz.setFont(2, new Font(Font.SANS_SERIF, Font.PLAIN, LEGEND_FONT_SIZE));

}

From source file:org.apache.hadoop.chukwa.analysis.salsa.visualization.Swimlanes.java

protected void addAxisNames() {
    Table textlabels_table = new Table();
    textlabels_table.addColumn("label", String.class);
    textlabels_table.addColumn("type", String.class);
    textlabels_table.addRow();//from  w  w  w.  ja  v  a 2s .  c  o  m
    textlabels_table.setString(0, "label", new String("Time/s"));
    textlabels_table.setString(0, "type", new String("xaxisname"));

    VisualTable textlabelsviz = this.viz.addTable(labelgroup, textlabels_table);
    textlabelsviz.setX(0, SIZE_X / 2);
    textlabelsviz.setY(0, SIZE_Y - BORDER[2] + (BORDER[2] * 0.1));
    textlabelsviz.setTextColor(0, ColorLib.color(java.awt.Color.GRAY));
    textlabelsviz.setFont(0, new Font(Font.SANS_SERIF, Font.PLAIN, AXIS_NAME_FONT_SIZE));
}

From source file:org.apache.hadoop.chukwa.analysis.salsa.visualization.Swimlanes.java

protected void addLegend() {
    SwimlanesStatePalette ssp = new SwimlanesStatePalette();

    Table shapes_table = new Table();
    shapes_table.addColumn(VisualItem.X, float.class);
    shapes_table.addColumn(VisualItem.Y, float.class);

    Table legend_labels_table = new Table();
    Table legend_squares_table = new Table();
    legend_labels_table.addColumn("label", String.class);

    // add labels
    int num_states = ssp.getNumStates();
    String[] state_names = ssp.getStates();
    legend_labels_table.addRows(num_states);
    shapes_table.addRows(num_states);//from   w  w w .  ja  va 2s.co m
    for (int i = 0; i < num_states; i++) {
        legend_labels_table.setString(i, "label", state_names[i]);
    }

    // add legend shapes, manipulate visualitems to set colours
    VisualTable shapes_table_viz = viz.addTable(legendshapegroup, shapes_table);
    float start_x = BORDER[0] + LEGEND_X_OFFSET;
    float start_y = BORDER[1] + LEGEND_Y_OFFSET;
    float incr = (float) 30.0;
    for (int i = 0; i < num_states; i++) {
        shapes_table_viz.setFillColor(i, ssp.getColour(state_names[i]));
        shapes_table_viz.setFloat(i, VisualItem.X, start_x);
        shapes_table_viz.setFloat(i, VisualItem.Y, start_y + (i * incr));
    }

    // add legend labels, manipulate visualitems to set font
    VisualTable legend_labels_table_viz = this.viz.addTable(legendgroup, legend_labels_table);
    for (int i = 0; i < num_states; i++) {
        legend_labels_table_viz.setFloat(i, VisualItem.X, start_x + LEGEND_TEXT_OFFSET);
        legend_labels_table_viz.setFloat(i, VisualItem.Y, start_y + (i * incr));
        legend_labels_table_viz.setTextColor(i, ColorLib.color(java.awt.Color.BLACK));
        legend_labels_table_viz.setFont(i, new Font(Font.SANS_SERIF, Font.PLAIN, LEGEND_FONT_SIZE));
    }

}

From source file:org.tros.torgo.Main.java

/**
 * Initialize the splash graphic./*from  w  ww. jav  a  2 s .  c  o m*/
 */
private static void splashInit() {
    mySplash = SplashScreen.getSplashScreen();
    if (mySplash != null) {
        try {
            // if there are any problems displaying the splash this will be null
            splashDimension = mySplash.getSize();
            splashImage = ImageIO.read(mySplash.getImageURL());

            // create the Graphics environment for drawing status info
            splashGraphics = mySplash.createGraphics();
            font = new Font(Font.SANS_SERIF, Font.PLAIN, 16);
            splashGraphics.setFont(font);
            splashGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                    RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);

            // initialize the status info
            splashText("Starting");
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

From source file:qic.ui.AboutPanel.java

public AboutPanel() {
    BoxLayout boxLayout = new BoxLayout(this, BoxLayout.PAGE_AXIS);
    setLayout(boxLayout);//from w  w  w .  j  av  a2  s.c o  m

    JLabel aboutLbl = new JLabel("<html>" + "<p>Durian Copyright (C) 2015 thirdy</p>"
            + "<p>This program is free software: you can redistribute it and/or modify</p>"
            + "<p>it under the terms of the GNU General Public License as published by</p>"
            + "<p>the Free Software Foundation, either version 3 of the License, or</p>"
            + "<p>(at your option) any later version.</p>"
            + "<p>This program comes with ABSOLUTELY NO WARRANTY.</p>"
            + "<p>A copy of the GNU General Public License can be found at https://github.com/thirdy/durian/blob/master/LICENSE</p>"
            + "<br/>" + "<br/>"
            + "<p>Thank you for using Durian. Durian is a fan-made software and is not affiliated with Grinding Gear Games in any way.</p>"
            + "<p>This software is 100% free and open source.</p>"
            + "<p>Durian is a fan-made software and is not affiliated with Grinding Gear Games in any way.</p>"
            + "<br/>" + "<br/>" + "<p>IGN: ManicCompression</p>" + "<p>Reddit: /u/ProFalseIdol</p>"
            + "</html>");

    String websiteUrl = "http://thirdy.github.io/durian/";
    JButton website = new JButtonLink("Website: " + websiteUrl, websiteUrl);

    String forumUrl = "https://www.pathofexile.com/forum/view-thread/1507190";
    JButton forum = new JButtonLink("Forum Thread: " + forumUrl, forumUrl);

    String helpUrl = "http://thirdy.github.io/durian/help/help.htm";
    JButton help = new JButtonLink("Search Term Helper: " + helpUrl, helpUrl);

    add(Box.createRigidArea(new Dimension(5, 10)));
    add(aboutLbl);
    add(Box.createRigidArea(new Dimension(5, 10)));
    add(website);
    add(Box.createRigidArea(new Dimension(5, 10)));
    add(forum);
    add(Box.createRigidArea(new Dimension(5, 10)));
    add(help);

    JPanel helpPanel = new JPanel(new BorderLayout());
    helpPanel.setBorder(BorderFactory.createTitledBorder("Help"));
    JTextArea textArea = new JTextArea();
    textArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 12));
    try {
        InputStream input = this.getClass().getResource("/help.txt").openStream();
        String str = IOUtils.toString(input);
        textArea.setText(str);
        textArea.setCaretPosition(0);
        input.close();
    } catch (Exception e) {
        logger.error("Error while reading help file", e);
    }
    helpPanel.add(new JScrollPane(textArea), BorderLayout.CENTER);
    add(Box.createRigidArea(new Dimension(5, 10)));
    add(helpPanel);
}

From source file:smlm.util.SRutil.java

public static Polygon[] getCellContours(ImagePlus rebuilt, int rebuiltScale, String rootDirName,
        boolean getNewIfNone) {

    Polygon[] cells = new Polygon[20];
    int cell = 0;

    if (new File(rootDirName + File.separator + "0_Cell1-Contour.txt").isFile()
            || new File(rootDirName.substring(0, rootDirName.lastIndexOf(File.separator)).substring(0,
                    rootDirName.substring(0, rootDirName.lastIndexOf(File.separator))
                            .substring(0, rootDirName.lastIndexOf(File.separator)).lastIndexOf(File.separator))
                    + File.separator + "0_Cell1-Contour.txt").isFile()) {
        String rootDirNameTemp;/*w ww. j a  va  2 s  . c  o m*/
        if (new File(rootDirName + File.separator + "0_Cell1-Contour.txt").isFile())
            rootDirNameTemp = rootDirName;
        else
            rootDirNameTemp = rootDirName.substring(0, rootDirName.lastIndexOf(File.separator)).substring(0,
                    rootDirName.substring(0, rootDirName.lastIndexOf(File.separator))
                            .substring(0, rootDirName.lastIndexOf(File.separator)).lastIndexOf(File.separator));
        while (new File(rootDirNameTemp + File.separator + "0_Cell" + (cell + 1) + "-Contour.txt").isFile()) {
            ResultsTableMt saveCell = ResultsTableMt
                    .open2(rootDirNameTemp + File.separator + "0_Cell" + (cell + 1) + "-Contour.txt");

            if (getSum(saveCell.getColumnAsDoubles(saveCell.getColumnIndex("Xi")))
                    + getSum(saveCell.getColumnAsDoubles(saveCell.getColumnIndex("Yi"))) % 1 == 0) {
                cells[cell] = new Polygon(
                        doubleToInt(saveCell.getColumnAsDoubles(saveCell.getColumnIndex("Xi"))),
                        doubleToInt(saveCell.getColumnAsDoubles(saveCell.getColumnIndex("Yi"))),
                        saveCell.getCounter());
            } else {
                int[] xPol = new int[saveCell.getCounter()];
                int[] yPol = new int[xPol.length];
                for (int pol = 0; pol < xPol.length; pol++) {
                    xPol[pol] = (int) Math.floor(saveCell.getValue("Xi", pol) + 0.5);
                    yPol[pol] = (int) Math.floor(saveCell.getValue("Yi", pol) + 0.5);
                }
                cells[cell] = new Polygon(xPol, yPol, xPol.length);
            }

            cell++;
        }
    } else if (getNewIfNone) {

        ij.gui.WaitForUserDialog waitingGUI = new ij.gui.WaitForUserDialog("Roi selector",
                "Please select a roi in the new window and press 'OK'.");
        waitingGUI.show();
        int cellNumber = 0;
        while (!waitingGUI.escPressed() && cellNumber < cells.length) {
            cells[cellNumber] = rebuilt.getRoi().getPolygon();
            cellNumber++;

            // ImageProcessor cell = Rebuilt.getRoi().getMask();
            // cell.add(Rebuilt.getStatistics().mean);
            Overlay ol = rebuilt.getOverlay();
            if (ol == null)
                ol = new Overlay();

            Roi roiTemp = rebuilt.getRoi();
            roiTemp.setFillColor(new Color(cellNumber * 10, cellNumber * 10, cellNumber * 10));
            roiTemp.setStrokeColor(new Color(cellNumber * 10, cellNumber * 10, cellNumber * 10));
            ol.add(roiTemp);

            TextRoi label1 = new TextRoi(
                    rebuilt.getRoi().getBounds().x + (int) ((double) rebuilt.getRoi().getBounds().width / 2.0),
                    rebuilt.getRoi().getBounds().y + (int) ((double) rebuilt.getRoi().getBounds().height / 2.0),
                    "" + cellNumber, new Font(Font.SANS_SERIF, Font.PLAIN, 8));
            label1.setStrokeColor(Color.BLACK);
            label1.setNonScalable(false);
            ol.add(label1);

            rebuilt.setOverlay(ol);
            rebuilt.setHideOverlay(false);
            rebuilt.updateAndDraw();
            rebuilt.show();

            // rebuilt.setOverlay(Rebuilt.getRoi(), Color.WHITE, 0,
            // Color.GRAY);
            // rebuilt.updateImage();
            rebuilt.deleteRoi();

            waitingGUI = new ij.gui.WaitForUserDialog("Roi selector",
                    "Please select a roi in the new window and press 'OK'.");
            waitingGUI.show();
        }

        for (cell = 0; cell < cells.length && cells[cell] != null; cell++) {
            Polygon polygon = cells[cell];

            ResultsTableMt saveCell = new ResultsTableMt();
            for (int i = 0; i < polygon.npoints; i++) {
                saveCell.incrementCounter();
                saveCell.addValue("Xi", (int) (((double) polygon.xpoints[i]) / ((double) rebuiltScale) + 0.5));
                saveCell.addValue("Yi", (int) (((double) polygon.ypoints[i]) / ((double) rebuiltScale) + 0.5));
            }

            try {
                saveCell.saveAs(rootDirName + File.separator + "0_Cell" + (cell + 1) + "-Contour.txt");
            } catch (IOException e) {
                e.printStackTrace();
            }

            cells[cell] = new Polygon(doubleToInt(saveCell.getColumnAsDoubles(saveCell.getColumnIndex("Xi"))),
                    doubleToInt(saveCell.getColumnAsDoubles(saveCell.getColumnIndex("Yi"))),
                    saveCell.getCounter());
        }
    }

    Polygon[] retour = new Polygon[cell];
    for (int i = 0; i < cell; i++)
        retour[i] = cells[i];

    return retour;
}

From source file:wsattacker.sso.openid.attacker.gui.MainGui.java

/**
 * Creates new form MainGui//from ww  w  .j  a  v  a 2s .com
 */
public MainGui() {
    initComponents();

    analyzerIdpServerConfigurationGui.setIdp(IdpType.ANALYZER);
    analyzerIdpHtmlConfigurationGui.setIdp(IdpType.ANALYZER);
    analyzerIdpXrdsConfigurationGui.setIdp(IdpType.ANALYZER);
    analyzerIdpValidDataGui.setIdp(IdpType.ANALYZER);
    analyzerIdpAttackDataGui.setIdp(IdpType.ANALYZER);
    //analyzerIdpAttackOverviewGui.setIdp(IdpType.ANALYZER);

    Map<TextAttribute, Integer> fontAttributes = new HashMap<>();
    fontAttributes.put(TextAttribute.UNDERLINE, TextAttribute.LIGATURES_ON);
    boldUnderline = new Font(Font.SANS_SERIF, Font.BOLD, defaultFont.getSize()).deriveFont(fontAttributes);

    splitPane.setRightComponent(attackerIdpServerConfigurationGui);
    attackerIdpServerConfigurationButton.setFont(boldUnderline);

    // ========== Attacker IdP Task Pane ==========
    removeBackgroundFromButton(attackerIdpServerConfigurationButton);
    attackerIdpServerConfigurationButton.addActionListener(this);
    attackerIdpTaskPane.add(attackerIdpServerConfigurationButton);

    removeBackgroundFromButton(attackerIdpHtmlDiscoveryButton);
    attackerIdpHtmlDiscoveryButton.addActionListener(this);
    attackerIdpTaskPane.add(attackerIdpHtmlDiscoveryButton);

    removeBackgroundFromButton(attackerIdpXrdsDiscoveryButton);
    attackerIdpXrdsDiscoveryButton.addActionListener(this);
    attackerIdpTaskPane.add(attackerIdpXrdsDiscoveryButton);

    removeBackgroundFromButton(attackerIdpValidDataButton);
    attackerIdpValidDataButton.addActionListener(this);
    attackerIdpTaskPane.add(attackerIdpValidDataButton);

    removeBackgroundFromButton(attackerIdpAttackDataButton);
    attackerIdpAttackDataButton.addActionListener(this);
    attackerIdpTaskPane.add(attackerIdpAttackDataButton);

    removeBackgroundFromButton(attackerIdpAttackOverviewButton);
    attackerIdpAttackOverviewButton.addActionListener(this);
    attackerIdpTaskPane.add(attackerIdpAttackOverviewButton);

    // ========== Analyzer IdP Task Pane ==========
    removeBackgroundFromButton(analyzerIdpServerConfigurationButton);
    analyzerIdpServerConfigurationButton.addActionListener(this);
    analyzerIdpTaskPane.add(analyzerIdpServerConfigurationButton);

    removeBackgroundFromButton(analyzerIdpHtmlDiscoveryButton);
    analyzerIdpHtmlDiscoveryButton.addActionListener(this);
    analyzerIdpTaskPane.add(analyzerIdpHtmlDiscoveryButton);

    removeBackgroundFromButton(analyzerIdpXrdsDiscoveryButton);
    analyzerIdpXrdsDiscoveryButton.addActionListener(this);
    analyzerIdpTaskPane.add(analyzerIdpXrdsDiscoveryButton);

    removeBackgroundFromButton(analyzerIdpValidDataButton);
    analyzerIdpValidDataButton.addActionListener(this);
    analyzerIdpTaskPane.add(analyzerIdpValidDataButton);

    removeBackgroundFromButton(analyzerIdpAttackDataButton);
    analyzerIdpAttackDataButton.addActionListener(this);
    analyzerIdpTaskPane.add(analyzerIdpAttackDataButton);
    analyzerIdpAttackDataButton.setEnabled(false); // disable

    removeBackgroundFromButton(analyzerIdpAttackOverviewButton);
    analyzerIdpAttackOverviewButton.addActionListener(this);
    analyzerIdpTaskPane.add(analyzerIdpAttackOverviewButton);

    // ========== Evaluation Task Pane ==========
    removeBackgroundFromButton(evaluationButton);
    evaluationButton.addActionListener(this);
    evaluationTaskPane.add(evaluationButton);

    removeBackgroundFromButton(reportButton);
    reportButton.addActionListener(this);
    evaluationTaskPane.add(reportButton);

    // ========== Log Task Pane ==========
    removeBackgroundFromButton(logButton);
    logButton.addActionListener(this);
    logTaskPane.add(logButton);
}