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:scheduler.benchmarker.manager.CreateSimpleSplineChart.java

public ChartPanel createChartPanel() {
    XYDataset dataset = createDataset();
    NumberAxis numberaxis = new NumberAxis("EMAILS");
    numberaxis.setAutoRangeIncludesZero(true);
    numberaxis.setRange(0, dataset.getItemCount(1));
    numberaxis.setVisible(false);/*  ww  w .j a v  a 2s . c o m*/
    NumberAxis numberaxis1 = new NumberAxis("TIME CONSUMED");
    numberaxis1.setAutoRangeIncludesZero(false);
    XYSplineRenderer xysplinerenderer = new XYSplineRenderer();
    XYPlot xyplot = new XYPlot(dataset, numberaxis, numberaxis1, xysplinerenderer);
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    //xyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));
    JFreeChart jfreechart = new JFreeChart("PLAN VALUES FOR '" + sName + "' SCHEDULER",
            new Font(Font.SANS_SERIF, Font.PLAIN, 11), xyplot, true);
    chartPanel = new ChartPanel(jfreechart, true);

    //Creating listener
    chartPanel.addChartMouseListener(new ChartMouseListener() {
        @Override
        public void chartMouseClicked(ChartMouseEvent e) {
            ChartEntity entity = e.getEntity();
            if (entity != null && (entity instanceof XYItemEntity)) {
                XYItemEntity item = (XYItemEntity) entity;
                String chartTitle = "RULE ARRANGEMENT INFORMATION FOR EMAIL \""
                        + dataSource.get(item.getItem()).getEmailName() + "\"";
                createSubChart(
                        new CreateStackedBarChart3D(dataSource.get(item.getItem()), pluginColor, chartTitle)
                                .createChartPanel());
            }
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent e) {
            //DO NOTHING
        }

    });
    return chartPanel;
}

From source file:scheduler.benchmarker.manager.CreateCombinedSplineChart.java

public ChartPanel createChartPanel() {
    XYDataset dataset = createDataset();
    NumberAxis numberaxis = new NumberAxis("EMAILS");
    numberaxis.setAutoRangeIncludesZero(true);
    numberaxis.setRange(0, dataset.getItemCount(1));
    numberaxis.setVisible(false);//from  w w w . j a  v  a2 s .c  o m
    NumberAxis numberaxis1 = new NumberAxis("TIME CONSUMED");
    numberaxis.setAutoRangeIncludesZero(false);
    XYSplineRenderer xysplinerenderer = new XYSplineRenderer();
    XYPlot xyplot = new XYPlot(dataset, numberaxis, numberaxis1, xysplinerenderer);
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    xyplot.setFixedLegendItems(null);
    JFreeChart jfreechart = new JFreeChart(
            "PLAN VALUES FOR '" + sName[0] + "' AND '" + sName[1] + "' SCHEDULERS",
            new Font(Font.SANS_SERIF, Font.PLAIN, 11), xyplot, true);
    chartPanel = new ChartPanel(jfreechart, true);

    //Creating listener
    chartPanel.addChartMouseListener(new ChartMouseListener() {
        @Override
        public void chartMouseClicked(ChartMouseEvent e) {
            ChartEntity entity = e.getEntity();
            if (entity != null && (entity instanceof XYItemEntity)) {
                XYItemEntity item = (XYItemEntity) entity;

                String chartTitle = "COMPARISON OF '" + sName[0] + "' AND '" + sName[1]
                        + "' BEHAVIOUR FOR EMAIL '"
                        + dataSource.get(0).getPlanningResult().get(item.getItem()).getEmailName() + "'";
                createSubChart(new CreateCombinedCategoryPlot(
                        new PlanningResult[] { dataSource.get(0).getPlanningResult().get(item.getItem()),
                                dataSource.get(1).getPlanningResult().get(item.getItem()) },
                        pluginColor, chartTitle, new String[] { dataSource.get(0).getSchedulerUsed(),
                                dataSource.get(1).getSchedulerUsed() }).createChartPanel());
            }
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent e) {
            //DO NOTHING
        }

    });
    return chartPanel;
}

From source file:edu.stanford.epadd.launcher.Splash.java

void setSplashText(String text) {
    if (splash == null)
        return;/* www  .j a va  2s.  com*/

    int SPLASH_SCREEN_WIDTH = ((int) splash.getBounds().getWidth());
    int MARGIN = 10; // margin for text on each side

    // clear the previous text
    g.setColor(new Color(1, 117, 188)); // epadd color, #0175bc
    g.fillRect(0, 175, SPLASH_SCREEN_WIDTH, 40);
    g.setPaintMode();

    // write the new text
    g.setColor(Color.WHITE); // #0175bc
    g.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 14));

    // compute the startX so as to center align the string,
    int stringWidth = g.getFontMetrics().stringWidth(text);
    int startX = (stringWidth > (SPLASH_SCREEN_WIDTH - MARGIN * 2)) ? MARGIN
            : MARGIN + (SPLASH_SCREEN_WIDTH - stringWidth) / 2;
    g.drawString(text, startX, 200);

    splash.update();
}

From source file:com.willwinder.universalgcodesender.uielements.helpers.Overlay.java

/** Creates a new Overlay with the given font size. An OpenGL
    context must be current at the time the constructor is called.
        //w w w. ja  va 2  s .c o  m
    @param drawable the drawable to render the text to
    @param textSize the point size of the font to use
    @throws GLException if an OpenGL context is not current when the constructor is called
*/
public Overlay(GLDrawable drawable, int textSize) throws GLException {
    this(drawable, new Font(Font.SANS_SERIF, Font.BOLD, textSize));
}

From source file:eulermind.Style.java

private static void initDefaultStyle() {
    if (getStyle(DEFAULT_STYLE_NAME) == null) {
        sm_defaultStyle = new Style(DEFAULT_STYLE_NAME);
        addStyle(sm_defaultStyle);//from  w w  w  . j  a  va  2 s  .co m
    } else {
        sm_defaultStyle = getStyle(DEFAULT_STYLE_NAME);
    }

    if (sm_defaultStyle.m_fontFamily == null || !getFontFamilies().contains(sm_defaultStyle.m_fontFamily)) {
        sm_defaultStyle.m_fontFamily = Font.SANS_SERIF;
    }

    if (sm_defaultStyle.m_fontSize == null || !getFontSizes().contains(sm_defaultStyle.m_fontSize)) {
        sm_defaultStyle.m_fontSize = 16;
    }

    if (sm_defaultStyle.m_bold == null) {
        sm_defaultStyle.m_bold = false;
    }

    if (sm_defaultStyle.m_italic == null) {
        sm_defaultStyle.m_italic = false;
    }

    if (sm_defaultStyle.m_textColor == null) {
        sm_defaultStyle.m_textColor = ColorLib.rgb(0, 0, 0);
    }

    if (sm_defaultStyle.m_nodeColor == null) {
        sm_defaultStyle.m_nodeColor = ColorLib.rgb(255, 255, 255);
    }
}

From source file:com.quinsoft.zeidon.objectbrowser.EntitySquare.java

EntitySquare(OiDisplay display, BrowserEnvironment environment, EntityDefLayout layout) {
    super();//from w  w  w . j a  va 2s  .  co  m
    this.env = environment;
    oiDisplay = display;
    entityDefLayout = layout;
    size = new Dimension(SMALLEST_WIDTH * env.getPainterScaleFactor(),
            SMALLEST_HEIGHT * env.getPainterScaleFactor());
    paddedSize = new Dimension((SMALLEST_WIDTH + HORIZONTAL_PAD * 2) * env.getPainterScaleFactor(),
            (SMALLEST_HEIGHT + VERTICAL_PAD * 2) * env.getPainterScaleFactor());
    setSize(size);
    font = new Font(Font.SANS_SERIF, Font.PLAIN, env.getPainterScaleFactor());
    setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    addMouseListener(this);

    getInputMap().put(KeyStroke.getKeyStroke("HOME"), "setFirst");
    getActionMap().put("setFirst", new SetCursorAction(CursorPosition.FIRST));
    getInputMap().put(KeyStroke.getKeyStroke("PAGE_UP"), "setPrev");
    getActionMap().put("setPrev", new SetCursorAction(CursorPosition.PREV));
    getInputMap().put(KeyStroke.getKeyStroke("PAGE_DOWN"), "setNext");
    getActionMap().put("setNext", new SetCursorAction(CursorPosition.NEXT));
    getInputMap().put(KeyStroke.getKeyStroke("END"), "setLast");
    getActionMap().put("setLast", new SetCursorAction(CursorPosition.LAST));

    getInputMap().put(KeyStroke.getKeyStroke("UP"), "moveUp");
    getActionMap().put("moveUp", new ChangeSelectedEntityDefAction(1));
    getInputMap().put(KeyStroke.getKeyStroke("DOWN"), "moveDown");
    getActionMap().put("moveDown", new ChangeSelectedEntityDefAction(2));
    getInputMap().put(KeyStroke.getKeyStroke("LEFT"), "moveLeft");
    getActionMap().put("moveLeft", new ChangeSelectedEntityDefAction(3));
    getInputMap().put(KeyStroke.getKeyStroke("RIGHT"), "moveRight");
    getActionMap().put("moveRight", new ChangeSelectedEntityDefAction(4));

    getInputMap().put(KeyStroke.getKeyStroke("ctrl DOWN"), "resetParent");
    getActionMap().put("resetParent", new ChangeSelectedEntityDefAction(5));
    getInputMap().put(KeyStroke.getKeyStroke("ctrl UP"), "setSubobject");
    getActionMap().put("setSubobject", new ChangeSelectedEntityDefAction(6));
}

From source file:edu.scripps.fl.pubchem.xmltool.gui.GUIComponent.java

public JButton createJButton(String text, String toolTip, String type) {
    JButton jbn = null;//from  w  ww.ja  va  2  s. com
    if (type.equals("icon")) {
        jbn = new JButton(createGeneralIcon(text));
    } else if (type.equals("text")) {
        Font jbnFont = new Font(Font.SANS_SERIF, Font.BOLD, 10);
        jbn = new JButton(text);
        jbn.setFont(jbnFont);
    }
    jbn.setOpaque(true);
    jbn.setToolTipText(toolTip);
    return jbn;
}

From source file:edu.scripps.fl.pubchem.xmltool.gui.GUIComponent.java

public JTextPane createJTextPane(String text) {
    JTextPane jtp = new JTextPane();
    jtp.setText(text);//from   w ww. j a v a 2 s.com
    SimpleAttributeSet underline = new SimpleAttributeSet();
    StyleConstants.setUnderline(underline, true);
    jtp.getStyledDocument().setCharacterAttributes(0, text.length(), underline, true);
    jtp.setEditable(false);
    jtp.setOpaque(false);
    jtp.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 10));
    jtp.setBorder(BorderFactory.createEmptyBorder());
    jtp.setForeground(Color.blue);
    jtp.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

    return jtp;
}

From source file:edu.scripps.fl.pubchem.xmltool.gui.GUIComponent.java

public JLabel createJLabel(String name) {
    Font jlbFont = new Font(Font.SANS_SERIF, Font.BOLD, 12);
    JLabel jlb = new JLabel(name);
    jlb.setFont(jlbFont);/*from w w  w .j  a  va  2 s  .c  o m*/
    return jlb;
}

From source file:edu.scripps.fl.pubchem.xmltool.gui.GUIComponent.java

public JTextField createJTextField(String content) {
    Font jtfFont = new Font(Font.SANS_SERIF, Font.PLAIN, 11);
    JTextField jtf = new JTextField(content);
    jtf.setColumns(50);/*from w  w w . j  av a 2 s.co  m*/
    jtf.setFont(jtfFont);
    return jtf;
}