Example usage for java.awt Font ITALIC

List of usage examples for java.awt Font ITALIC

Introduction

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

Prototype

int ITALIC

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

Click Source Link

Document

The italicized style constant.

Usage

From source file:greenfoot.gui.export.ExportPublishPane.java

/**
 * Build the component.//  w  ww  .  ja va2 s . c  om
 */
private void makePane() {
    font = (new JLabel()).getFont().deriveFont(Font.ITALIC, 11.0f);

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    setBorder(BorderFactory.createEmptyBorder(12, 12, 0, 12));
    setBackground(backgroundColor);

    add(getHelpBox());
    add(Box.createVerticalStrut(12));

    infoPanel = new JPanel(new BorderLayout(22, 18));
    {
        infoPanel.setAlignmentX(LEFT_ALIGNMENT);
        infoPanel.setBackground(background);

        Border border = BorderFactory.createCompoundBorder(BorderFactory.createLoweredBevelBorder(),
                BorderFactory.createEmptyBorder(12, 22, 12, 22));
        infoPanel.setBorder(border);

        JLabel text = new JLabel(Config.getString("export.publish.info") + " " + serverName,
                SwingConstants.CENTER);
        text.setForeground(headingColor);
        infoPanel.add(text, BorderLayout.NORTH);

        createScenarioDisplay();
        infoPanel.add(leftPanel, BorderLayout.CENTER);
        infoPanel.add(getTagDisplay(), BorderLayout.EAST);
    }

    add(infoPanel);
    add(Box.createVerticalStrut(16));
    add(getLoginPanel());
    add(Box.createVerticalStrut(10));
}

From source file:net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.java

@Override
public boolean start(JRStyledText styledText) {
    if (!measureSimpleTexts) {
        return false;
    }/*  w  w  w .j  av a 2  s. c om*/

    List<Run> runs = styledText.getRuns();
    if (runs.size() != 1) {
        // multiple styles
        return false;
    }

    wholeText = styledText.getText();
    if (wholeText.indexOf('\t') >= 0) {
        // supporting tabs is more difficult because we'd need
        // measureParagraphFragment to include the white space advance.
        return false;
    }

    Run run = styledText.getRuns().get(0);
    if (run.attributes.get(TextAttribute.SUPERSCRIPT) != null) {
        // not handling this case, see JRStyledText.getAwtAttributedString
        return false;
    }

    AwtFontAttribute fontAttribute = AwtFontAttribute.fromAttributes(run.attributes);
    Number size = (Number) run.attributes.get(TextAttribute.SIZE);
    if (!fontAttribute.hasAttribute() || size == null) {
        // this should not happen, but still checking
        return false;
    }

    int style = 0;
    Number posture = (Number) run.attributes.get(TextAttribute.POSTURE);
    if (posture != null && !TextAttribute.POSTURE_REGULAR.equals(posture)) {
        if (TextAttribute.POSTURE_OBLIQUE.equals(posture)) {
            style |= Font.ITALIC;
        } else {
            // non standard posture
            return false;
        }
    }

    Number weight = (Number) run.attributes.get(TextAttribute.WEIGHT);
    if (weight != null && !TextAttribute.WEIGHT_REGULAR.equals(weight)) {
        if (TextAttribute.WEIGHT_BOLD.equals(weight)) {
            style |= Font.BOLD;
        } else {
            // non standard weight
            return false;
        }
    }

    fontKey = new FontKey(fontAttribute, size.floatValue(), style, styledText.getLocale());
    createFontInfo(run.attributes);

    return true;
}

From source file:org.jfree.chart.demo.ThermometerDemo.java

/**
 * Initialises the class./*w ww. j a  v  a 2  s  . co m*/
 *
 * @throws Exception for any exception.
 */
void jbInit() throws Exception {

    //data.setRange(new Double(-20), new Double(20));
    this.thermo[0] = this.thermo1;
    this.thermo[1] = this.thermo2;
    this.thermo[2] = this.thermo3;

    this.thermo[0].setValue(0.0);
    this.thermo[1].setValue(0.2);
    this.thermo[2].setValue(0.3);

    this.thermo[0].setBackground(Color.white);
    this.thermo[2].setBackground(Color.white);

    this.thermo[0].setOutlinePaint(null);
    this.thermo[1].setOutlinePaint(null);
    this.thermo[2].setOutlinePaint(null);

    this.thermo[0].setUnits(0);
    this.thermo[1].setUnits(1);
    this.thermo[2].setUnits(2);

    //thermo[0].setFont(new Font("SansSerif", Font.BOLD, 20));
    this.thermo[0].setShowValueLines(true);
    this.thermo[0].setFollowDataInSubranges(true);
    this.thermo[1].setValueLocation(1);

    this.thermo[1].setForeground(Color.blue);
    this.thermo[2].setForeground(Color.pink);

    this.thermo[0].setRange(-10.0, 40.0);
    this.thermo[0].setSubrangeInfo(0, -50.0, 20.0, -10.0, 22.0);
    this.thermo[0].setSubrangeInfo(1, 20.0, 24.0, 18.0, 26.0);
    this.thermo[0].setSubrangeInfo(2, 24.0, 100.0, 22.0, 40.0);

    this.thermo[0].addSubtitle("Sea Water Temp");
    this.thermo[1].addSubtitle("Air Temp", new Font("SansSerif", Font.PLAIN, 16));
    this.thermo[2].addSubtitle("Ship Temp", new Font("SansSerif", Font.ITALIC + Font.BOLD, 20));

    this.thermo[1].setValueFormat(new DecimalFormat("#0.0"));
    this.thermo[2].setValueFormat(new DecimalFormat("#0.00"));

    this.pickShow[0] = this.pickShow0;
    this.pickShow[1] = this.pickShow1;
    this.pickShow[2] = this.pickShow2;

    this.pickAxis[0] = this.pickAxis0;
    this.pickAxis[1] = this.pickAxis1;
    this.pickAxis[2] = this.pickAxis2;

    this.pickAxis[0].setSelectedIndex(2);
    this.pickAxis[1].setSelectedIndex(2);
    this.pickAxis[2].setSelectedIndex(2);

    setLayout(this.gridLayout1);
    this.butDown3.setText("<");
    this.butDown3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(2, -1);
        }
    });
    this.butUp3.setText(">");
    this.butUp3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(2, 1);
        }
    });
    this.jPanel1.setLayout(this.borderLayout2);
    this.jPanel3.setLayout(this.borderLayout3);
    this.butDown2.setText("<");
    this.butDown2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(1, -1);
        }
    });
    this.butUp2.setText(">");
    this.butUp2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(1, 1);
        }
    });
    this.butUp1.setText(">");
    this.butUp1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(0, 1);
        }
    });
    this.butDown1.setText("<");
    this.butDown1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(0, -1);
        }
    });
    this.jPanel5.setLayout(this.borderLayout1);
    this.pickShow0.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowValue(0);
        }
    });
    this.pickShow1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowValue(1);
        }
    });
    this.pickShow2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowValue(2);
        }
    });

    this.pickAxis0.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowAxis(0);
        }
    });
    this.pickAxis1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowAxis(1);
        }
    });
    this.pickAxis2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowAxis(2);
        }
    });

    this.jPanel9.setLayout(this.gridLayout2);
    this.gridLayout2.setColumns(1);
    this.jPanel8.setLayout(this.gridLayout3);
    this.jPanel7.setLayout(this.gridLayout4);
    this.jPanel5.setBorder(BorderFactory.createEtchedBorder());
    this.jPanel3.setBorder(BorderFactory.createEtchedBorder());
    this.jPanel1.setBorder(BorderFactory.createEtchedBorder());
    this.jPanel6.setBackground(Color.white);
    this.jPanel2.setBackground(Color.white);
    this.jPanel9.setBackground(Color.white);
    this.jPanel10.setLayout(this.borderLayout4);
    this.butDown4.setText("<");
    this.butDown4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setMeterValue(-1.1);
        }
    });
    this.butUp4.setText(">");
    this.butUp4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setMeterValue(1.1);
        }
    });
    this.jPanel1.add(this.thermo3, BorderLayout.CENTER);
    this.jPanel1.add(this.jPanel2, BorderLayout.SOUTH);
    this.jPanel2.add(this.butDown3, null);
    this.jPanel2.add(this.butUp3, null);
    this.jPanel1.add(this.jPanel9, BorderLayout.NORTH);
    this.jPanel9.add(this.pickShow2, null);
    this.jPanel9.add(this.pickAxis2, null);
    add(this.jPanel10, null);
    this.jPanel10.add(this.jPanel11, BorderLayout.SOUTH);
    this.jPanel11.add(this.butDown4, null);
    this.jPanel11.add(this.butUp4, null);
    this.jPanel4.add(this.butDown2, null);
    this.jPanel4.add(this.butUp2, null);
    this.jPanel3.add(this.jPanel8, BorderLayout.NORTH);
    this.jPanel8.add(this.pickShow1, null);
    this.jPanel8.add(this.pickAxis1, null);
    this.jPanel3.add(this.thermo2, BorderLayout.CENTER);
    this.jPanel3.add(this.jPanel4, BorderLayout.SOUTH);
    add(this.jPanel5, null);
    this.jPanel5.add(this.thermo1, BorderLayout.CENTER);
    this.jPanel5.add(this.jPanel6, BorderLayout.SOUTH);
    this.jPanel6.add(this.butDown1, null);
    this.jPanel6.add(this.butUp1, null);
    this.jPanel5.add(this.jPanel7, BorderLayout.NORTH);
    this.jPanel7.add(this.pickShow0, null);
    this.jPanel7.add(this.pickAxis0, null);
    add(this.jPanel3, null);
    add(this.jPanel1, null);
    this.jPanel10.add(this.panelMeter, BorderLayout.CENTER);
}

From source file:org.piraso.ui.base.PreferencePanel.java

private void initPreferenceComponentsHorizontalChildLayout() {
    handlers = new ArrayList<ParentChildHandler>();
    CellConstraints c = new CellConstraints();

    int size = CollectionUtils.size(provider.getPreferences());

    int l = 0, r = 2;
    chkPreferences = new JCheckBox[size];
    preferenceKeys = new PreferenceProperty[size];

    JLabel lblHeader = new JLabel(provider.getName());
    Font of = lblHeader.getFont();
    lblHeader.setFont(of.deriveFont(Font.BOLD));

    pnlPreferences.add(lblHeader, c.xyw(2, r, 5));
    r += 2;//  ww w.ja  va2s .  c  o m

    JButton parentToggle = null;
    JPanel childrenPanel = null;
    ParentChildHandler parentChildHandler = null;

    Iterator<? extends PreferenceProperty> itrp = provider.getPreferences().iterator();
    for (int j = 0; j < provider.getPreferences().size(); j++, l++) {
        PreferenceProperty prop = itrp.next();

        preferenceKeys[l] = prop;
        chkPreferences[l] = new JCheckBox();
        chkPreferences[l].setText(provider.getMessage(prop.getName()));
        chkPreferences[l].setSelected(prop.isDefaultValue());

        if (prop.isChild()) {
            if (childrenPanel == null) {
                childrenPanel = new JPanel();
                childrenPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 1, 1));
                childrenPanel.setOpaque(false);
                childrenPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 1));
                childrenPanel.setVisible(false);

                if (parentChildHandler != null) {
                    parentChildHandler.setChildrenPanel(childrenPanel);
                }

                pnlPreferences.add(childrenPanel, c.xy(6, r));

                r += 2;
            }

            if (parentChildHandler != null) {
                parentChildHandler.addPreference(chkPreferences[l]);
            }

            childrenPanel.add(chkPreferences[l]);
            parentToggle = null;
        } else {
            if (parentToggle != null) {
                parentChildHandler.hide();
            }

            JPanel parentPanel = new JPanel();
            parentPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 1, 1));
            parentPanel.setOpaque(false);

            parentToggle = new JButton(expandImage);

            JLabel previewLabel = new JLabel();
            previewLabel.setForeground(new Color(0, 128, 0));
            previewLabel.setFont(previewLabel.getFont().deriveFont(Font.ITALIC));

            parentChildHandler = new ParentChildHandler(parentToggle, previewLabel);
            parentChildHandler.addPreference(chkPreferences[l]);
            handlers.add(parentChildHandler);

            parentToggle.setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));

            parentPanel.add(parentToggle);
            parentPanel.add(chkPreferences[l]);
            parentPanel.add(previewLabel);

            pnlPreferences.add(parentPanel, c.xyw(4, r, 3));

            childrenPanel = null;
            r += 2;
        }

        chkPreferences[l].addActionListener(new CheckBoxClickHandler(l, parentChildHandler));
    }
}

From source file:Classes.MainForm.java

private void initMainForm() throws IOException {//create sally form
    switch (getPrayerTimesHandler().getActualPrayerTime()) {//set background
    case 0://from  w w  w.j ava2s .  c  o m
        this.backgroundImage = new ImageIcon(getClass().getResource(duhrBackground)).getImage();
        break;
    case 1:
        this.backgroundImage = new ImageIcon(getClass().getResource(shorou9Background)).getImage();
        break;
    case 2:
        this.backgroundImage = new ImageIcon(getClass().getResource(fajrBackground)).getImage();
        break;
    case 3:
        this.backgroundImage = new ImageIcon(getClass().getResource(ishaaBackground)).getImage();
        break;
    case 4:
        this.backgroundImage = new ImageIcon(getClass().getResource(maghribBackground)).getImage();
        break;
    case 5:
        this.backgroundImage = new ImageIcon(getClass().getResource(asrBackground)).getImage();
        break;
    default:
        this.backgroundImage = new ImageIcon(getClass().getResource(shorou9Background)).getImage();
        break;
    }
    this.mainFrame = new JFrame();
    this.mainPanel = new MainImagePanel(getBackgroundImage(), prayerTimesHandler.getActualPrayerTime());
    this.mainPanel.setLayout(null);
    this.font = new Font("TimesRoman", Font.ITALIC, 15);
    this.locationFont = new Font("TimesRoman", Font.ITALIC, 22);
    this.digitalClockfont = new Font("TimesRoman", Font.ROMAN_BASELINE, 20);
    this.fontMiladiHijriTimes = new Font("TimesRoman", Font.ROMAN_BASELINE, 13);
    this.fontNextPrayer = new Font("TimesRoman", Font.ROMAN_BASELINE, 20);
    this.exitLabel = new JLabel();
    this.hijriTime = new JLabel("", SwingConstants.RIGHT);
    this.miladiTime = new JLabel();
    this.location = new JLabel(locationValue);
    this.location.setHorizontalAlignment(SwingConstants.CENTER);
    this.locationFromInternet = new JLabel();

    //get all translated salat names
    this.fajrName = new JLabel(PropertiesHandler.getSingleton().getValue(1020));
    this.fajrName.setHorizontalAlignment(SwingConstants.CENTER);
    this.fajrTime = new JLabel();
    this.fajrTime.setHorizontalAlignment(SwingConstants.CENTER);
    this.shorou9Name = new JLabel(PropertiesHandler.getSingleton().getValue(1021));
    this.shorou9Name.setHorizontalAlignment(SwingConstants.CENTER);
    this.shorou9Time = new JLabel();
    this.shorou9Time.setHorizontalAlignment(SwingConstants.CENTER);
    this.duhrName = new JLabel(PropertiesHandler.getSingleton().getValue(1022));
    this.duhrName.setHorizontalAlignment(SwingConstants.CENTER);
    this.duhrTime = new JLabel();
    this.duhrTime.setHorizontalAlignment(SwingConstants.CENTER);
    this.asrName = new JLabel(PropertiesHandler.getSingleton().getValue(1023));
    this.asrName.setHorizontalAlignment(SwingConstants.CENTER);
    this.asrTime = new JLabel();
    this.asrTime.setHorizontalAlignment(SwingConstants.CENTER);
    this.maghribName = new JLabel(PropertiesHandler.getSingleton().getValue(1024));
    this.maghribName.setHorizontalAlignment(SwingConstants.CENTER);
    this.maghribTime = new JLabel();
    this.maghribTime.setHorizontalAlignment(SwingConstants.CENTER);
    this.ishaaName = new JLabel(PropertiesHandler.getSingleton().getValue(1025));
    this.ishaaName.setHorizontalAlignment(SwingConstants.CENTER);
    this.ishaaTime = new JLabel();
    this.ishaaTime.setHorizontalAlignment(SwingConstants.CENTER);

    this.digitalClock = new JLabel();
    this.nextPrayer = new JLabel();

    this.settings = new JLabel();

    this.exitLabel.setIcon(exitIcon);
    this.settings.setIcon(settingsIcon);
    this.locationFromInternet.setIcon(locationfromInternetIconMain);

    this.nextDayPrayerTimes = new JLabel(new ImageIcon(getClass().getResource(nextDayPrayerTimesIcon)));
    this.previousDayPrayerTimes = new JLabel(new ImageIcon(getClass().getResource(previousDayPrayerTimesIcon)));
    this.actualDayPrayerTimes = new JLabel(new ImageIcon(getClass().getResource(actualDayPrayerTimesIcon)));

    this.previousDayPrayerTimes.setBounds(480, 275, 15, 15);
    this.actualDayPrayerTimes.setBounds(500, 275, 15, 15);
    this.nextDayPrayerTimes.setBounds(520, 275, 15, 15);

    this.nextDayPrayerTimes.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            nextPreviousDay++;
            Calendar cal = Calendar.getInstance();
            cal.add(Calendar.DATE, nextPreviousDay);
            try {
                PrayersTimes prayerTimes = new PrayersTimes(cal);
                MiladiTime miladiTime = new MiladiTime(cal);
                HijriTime hijriTime = new HijriTime(cal);
                setAllLabelsTimesHijriMiladiValues2(prayerTimes, hijriTime, miladiTime);
            } catch (IOException e1) {
            }
        }
    });
    this.previousDayPrayerTimes.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            nextPreviousDay--;
            Calendar cal = Calendar.getInstance();
            cal.add(Calendar.DATE, nextPreviousDay);
            try {
                PrayersTimes prayerTimes = new PrayersTimes(cal);
                MiladiTime miladiTime = new MiladiTime(cal);
                HijriTime hijriTime = new HijriTime(cal);
                setAllLabelsTimesHijriMiladiValues2(prayerTimes, hijriTime, miladiTime);
            } catch (IOException e1) {
            }
        }
    });
    this.actualDayPrayerTimes.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            try {
                nextPreviousDay = 0;
                setAllLabelsTimesHijriMiladiValues(prayersTimes, hijriTimeObj, miladiTimeObj);
            } catch (IOException e1) {
            } //set all values to all labels
        }
    });

    //set foreground color to all salat names and times
    this.duhrName.setForeground(Color.WHITE);
    this.shorou9Name.setForeground(Color.WHITE);
    this.fajrName.setForeground(Color.WHITE);
    this.ishaaName.setForeground(Color.WHITE);
    this.maghribName.setForeground(Color.WHITE);
    this.asrName.setForeground(Color.WHITE);

    this.duhrTime.setForeground(Color.WHITE);
    this.shorou9Time.setForeground(Color.WHITE);
    this.fajrTime.setForeground(Color.WHITE);
    this.ishaaTime.setForeground(Color.WHITE);
    this.maghribTime.setForeground(Color.WHITE);
    this.asrTime.setForeground(Color.WHITE);
    this.miladiTime.setForeground(Color.WHITE);
    this.hijriTime.setForeground(Color.WHITE);
    this.location.setForeground(Color.WHITE);
    this.digitalClock.setForeground(Color.WHITE);
    this.nextPrayer.setForeground(Color.WHITE);

    //set font to all salat names and times
    this.duhrName.setFont(font);
    this.shorou9Name.setFont(font);
    this.fajrName.setFont(font);
    this.ishaaName.setFont(font);
    this.maghribName.setFont(font);
    this.asrName.setFont(font);
    this.duhrTime.setFont(font);
    this.shorou9Time.setFont(font);
    this.fajrTime.setFont(font);
    this.ishaaTime.setFont(font);
    this.maghribTime.setFont(font);
    this.asrTime.setFont(font);
    this.digitalClock.setFont(digitalClockfont);
    this.nextPrayer.setFont(fontNextPrayer);
    this.miladiTime.setFont(fontMiladiHijriTimes);
    this.hijriTime.setFont(fontMiladiHijriTimes);
    this.location.setFont(locationFont);

    //set position color to all salat names and times
    this.exitLabel.setBounds(510, 0, 40, 40);
    if (UserConfig.getSingleton().getLanguage().equalsIgnoreCase(ar)) {
        this.hijriTime.setBounds(100, 3, 250, 20);
        this.miladiTime.setBounds(20, 3, 250, 20);
    } else {
        this.hijriTime.setBounds(150, 3, 250, 20);
        this.miladiTime.setBounds(5, 3, 250, 20);
    }
    this.location.setBounds(0, 40, 550, 30);

    this.donateLabel = new JLabel(PropertiesHandler.getSingleton().getValue(1106));
    this.donateLabel.setFont(fontMiladiHijriTimes);
    this.donateLabel.setBounds(420, 3, 50, 20);
    this.donateLabel.setForeground(Color.WHITE);
    this.donateLabel.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            String url = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FJDAFTPKN2S2W";
            String os = System.getProperty("os.name").toLowerCase();
            Runtime rt = Runtime.getRuntime();

            try {

                if (os.indexOf("win") >= 0) {

                    // this doesn't support showing urls in the form of "page.html#nameLink" 
                    rt.exec("rundll32 url.dll,FileProtocolHandler " + url);

                } else if (os.indexOf("mac") >= 0) {

                    rt.exec("open " + url);

                } else if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0) {

                    // Do a best guess on unix until we get a platform independent way
                    // Build a list of browsers to try, in this order.
                    String[] browsers = { "epiphany", "firefox", "mozilla", "konqueror", "netscape", "opera",
                            "links", "lynx" };

                    // Build a command string which looks like "browser1 "url" || browser2 "url" ||..."
                    StringBuffer cmd = new StringBuffer();
                    for (int i = 0; i < browsers.length; i++)
                        cmd.append((i == 0 ? "" : " || ") + browsers[i] + " \"" + url + "\" ");

                    rt.exec(new String[] { "sh", "-c", cmd.toString() });

                } else {
                }
            } catch (Exception ex) {
            }
        }
    });

    this.locationFromInternet.setBounds(260, 70, 20, 20);
    this.locationFromInternet.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(final MouseEvent e) {
            new Thread(new Runnable() {

                @Override
                public void run() {
                    if (locationFromInternet.isEnabled()) {
                        locationFromInternet.setEnabled(false);
                        locationFromInternet.setIcon(loaderMain);
                        locationFromInternetLabelMouseClicked(e);
                    }
                }
            }).start();
        }
    });

    this.fajrAthan = new JLabel();
    this.fajrAthan.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            try {
                allAthanClickHandler(0);
            } catch (Exception e1) {
            }
        }
    });
    this.shorou9Athan = new JLabel();
    this.shorou9Athan.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            try {
                allAthanClickHandler(1);
            } catch (Exception e1) {
            }
        }
    });
    this.duhrAthan = new JLabel();
    this.duhrAthan.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            try {
                allAthanClickHandler(2);
            } catch (Exception e1) {
            }
        }
    });
    this.asrAthan = new JLabel();
    this.asrAthan.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            try {
                allAthanClickHandler(3);
            } catch (Exception e1) {
            }
        }
    });
    this.maghribAthan = new JLabel();
    this.maghribAthan.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            try {
                allAthanClickHandler(4);
            } catch (Exception e1) {
            }
        }
    });
    this.ishaaAthan = new JLabel();
    this.ishaaAthan.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            try {
                allAthanClickHandler(5);
            } catch (Exception e1) {
            }
        }
    });

    this.duhrAthan.setBounds(152, 132, 28, 28);
    this.shorou9Athan.setBounds(322, 132, 28, 28);
    this.fajrAthan.setBounds(492, 132, 28, 28);
    this.ishaaAthan.setBounds(152, 212, 28, 28);
    this.maghribAthan.setBounds(322, 212, 28, 28);
    this.asrAthan.setBounds(492, 212, 28, 28);

    setAllAthanIcons();

    this.duhrName.setBounds(30, 100, 150, 30);
    this.duhrTime.setBounds(30, 130, 150, 30);
    this.shorou9Name.setBounds(200, 100, 150, 30);
    this.shorou9Time.setBounds(200, 130, 150, 30);
    this.fajrName.setBounds(370, 100, 150, 30);
    this.fajrTime.setBounds(370, 130, 150, 30);

    this.ishaaName.setBounds(30, 180, 150, 30);
    this.ishaaTime.setBounds(30, 210, 150, 30);
    this.maghribName.setBounds(200, 180, 150, 30);
    this.maghribTime.setBounds(200, 210, 150, 30);
    this.asrName.setBounds(370, 180, 150, 30);
    this.asrTime.setBounds(370, 210, 150, 30);

    this.digitalClock.setBounds(10, 250, 200, 50);
    this.nextPrayer.setBounds(150, 262, 350, 30);

    this.settings.setBounds(470, 0, 40, 40);
    this.settings.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            settingsLabelMouseClicked(e);
        }
    });

    this.exitLabel.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            exitLabelMouseClicked(e);
        }
    });
    this.mainFrame.addMouseMotionListener(new MouseAdapter() {
        @Override
        public void mouseDragged(MouseEvent e) {
            mainFrameMouseDragged(e);
        }
    });
    this.mainFrame.addMouseListener(new MouseAdapter() {
        @Override
        public void mousePressed(MouseEvent e) {
            mainFrameMousePressed(e);
        }
    });
    this.mainFrame.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseReleased(MouseEvent e) {
            mainFrameMouseReleased(e);
        }
    });

    this.mainFrame.setSize(550, 300);
    this.mainFrame.setLocationRelativeTo(null);
    this.mainFrame.setUndecorated(true);
    this.mainFrame.setResizable(false);

    //adding all labels objects to main panel
    this.mainPanel.add(exitLabel);
    this.mainPanel.add(hijriTime);
    this.mainPanel.add(miladiTime);
    this.mainPanel.add(location);
    this.mainPanel.add(locationFromInternet);

    this.mainPanel.add(duhrName);
    this.mainPanel.add(duhrTime);
    this.mainPanel.add(shorou9Name);
    this.mainPanel.add(shorou9Time);
    this.mainPanel.add(fajrName);
    this.mainPanel.add(fajrTime);
    this.mainPanel.add(ishaaName);
    this.mainPanel.add(ishaaTime);
    this.mainPanel.add(maghribName);
    this.mainPanel.add(maghribTime);
    this.mainPanel.add(asrName);
    this.mainPanel.add(asrTime);
    this.mainPanel.add(digitalClock);
    this.mainPanel.add(nextPrayer);
    this.mainPanel.add(settings);
    this.mainPanel.add(donateLabel);

    this.mainPanel.add(fajrAthan);
    this.mainPanel.add(shorou9Athan);
    this.mainPanel.add(duhrAthan);
    this.mainPanel.add(asrAthan);
    this.mainPanel.add(maghribAthan);
    this.mainPanel.add(ishaaAthan);

    this.mainPanel.add(nextDayPrayerTimes);
    this.mainPanel.add(previousDayPrayerTimes);
    this.mainPanel.add(actualDayPrayerTimes);

    this.mainFrame.add(mainPanel);
    this.pack();

    trayConfig();//create try icon

    this.setAllLabelsTimesHijriMiladiValues(prayersTimes, hijriTimeObj, miladiTimeObj);//set all values to all labels
    this.prayerTimesHandler.start();//start prayer times handler thread
}

From source file:net.nikr.eve.jeveasset.gui.tabs.tracker.TrackerTab.java

public TrackerTab(Program program) {
    super(program, TabsTracker.get().title(), Images.TOOL_TRACKER.getIcon(), true);

    filterDialog = new TrackerFilterDialog(program);

    jPopupMenu = new JPopupMenu();
    jPopupMenu.addPopupMenuListener(listener);

    JMenuItem jMenuItem;//  ww w .  ja v  a  2s.  co  m
    jMenuItem = new JMenuItem(TabsTracker.get().edit(), Images.EDIT_EDIT.getIcon());
    jMenuItem.setActionCommand(TrackerAction.EDIT.name());
    jMenuItem.addActionListener(listener);
    jPopupMenu.add(jMenuItem);

    jMenuItem = new JMenuItem(TabsTracker.get().delete(), Images.EDIT_DELETE.getIcon());
    jMenuItem.setActionCommand(TrackerAction.DELETE.name());
    jMenuItem.addActionListener(listener);
    jPopupMenu.add(jMenuItem);

    JMenuInfo.createDefault(jPopupMenu);

    jIskValue = new JMenuItem();
    jIskValue.setEnabled(false);
    jIskValue.setForeground(Color.BLACK);
    jIskValue.setHorizontalAlignment(SwingConstants.RIGHT);
    jIskValue.setDisabledIcon(Images.TOOL_VALUES.getIcon());
    jPopupMenu.add(jIskValue);

    jDateValue = new JMenuItem();
    jDateValue.setEnabled(false);
    jDateValue.setForeground(Color.BLACK);
    jDateValue.setHorizontalAlignment(SwingConstants.RIGHT);
    jPopupMenu.add(jDateValue);

    jEditDialog = new JTrackerEditDialog(program);

    jSelectionDialog = new JSelectionDialog(program);

    JSeparator jDateSeparator = new JSeparator();

    jQuickDate = new JComboBox<QuickDate>(QuickDate.values());
    jQuickDate.setActionCommand(TrackerAction.QUICK_DATE.name());
    jQuickDate.addActionListener(listener);

    JLabel jFromLabel = new JLabel(TabsTracker.get().from());
    jFrom = createDateChooser();

    JLabel jToLabel = new JLabel(TabsTracker.get().to());
    jTo = createDateChooser();

    jAll = new JCheckBox(General.get().all());
    jAll.setSelected(true);
    jAll.setActionCommand(TrackerAction.ALL.name());
    jAll.addActionListener(listener);
    jAll.setFont(new Font(jAll.getFont().getName(), Font.ITALIC, jAll.getFont().getSize()));

    jTotal = new JCheckBox(TabsTracker.get().total());
    jTotal.setSelected(true);
    jTotal.setActionCommand(TrackerAction.UPDATE_SHOWN.name());
    jTotal.addActionListener(listener);

    jWalletBalance = new JCheckBox(TabsTracker.get().walletBalance());
    jWalletBalance.setSelected(true);
    jWalletBalance.setActionCommand(TrackerAction.UPDATE_SHOWN.name());
    jWalletBalance.addActionListener(listener);

    jWalletBalanceFilters = new JButton(Images.LOC_INCLUDE.getIcon());
    jWalletBalanceFilters.setActionCommand(TrackerAction.FILTER_WALLET_BALANCE.name());
    jWalletBalanceFilters.addActionListener(listener);

    jAssets = new JCheckBox(TabsTracker.get().assets());
    jAssets.setSelected(true);
    jAssets.setActionCommand(TrackerAction.UPDATE_SHOWN.name());
    jAssets.addActionListener(listener);

    jAssetsFilters = new JButton(Images.LOC_INCLUDE.getIcon());
    jAssetsFilters.setActionCommand(TrackerAction.FILTER_ASSETS.name());
    jAssetsFilters.addActionListener(listener);

    jSellOrders = new JCheckBox(TabsTracker.get().sellOrders());
    jSellOrders.setSelected(true);
    jSellOrders.setActionCommand(TrackerAction.UPDATE_SHOWN.name());
    jSellOrders.addActionListener(listener);

    jEscrows = new JCheckBox(TabsTracker.get().escrows());
    jEscrows.setSelected(true);
    jEscrows.setActionCommand(TrackerAction.UPDATE_SHOWN.name());
    jEscrows.addActionListener(listener);

    jEscrowsToCover = new JCheckBox(TabsTracker.get().escrowsToCover());
    jEscrowsToCover.setSelected(true);
    jEscrowsToCover.setActionCommand(TrackerAction.UPDATE_SHOWN.name());
    jEscrowsToCover.addActionListener(listener);

    jManufacturing = new JCheckBox(TabsTracker.get().manufacturing());
    jManufacturing.setSelected(true);
    jManufacturing.setActionCommand(TrackerAction.UPDATE_SHOWN.name());
    jManufacturing.addActionListener(listener);

    jContractCollateral = new JCheckBox(TabsTracker.get().contractCollateral());
    jContractCollateral.setSelected(true);
    jContractCollateral.setActionCommand(TrackerAction.UPDATE_SHOWN.name());
    jContractCollateral.addActionListener(listener);

    jContractValue = new JCheckBox(TabsTracker.get().contractValue());
    jContractValue.setSelected(true);
    jContractValue.setActionCommand(TrackerAction.UPDATE_SHOWN.name());
    jContractValue.addActionListener(listener);

    JSeparator jOwnersSeparator = new JSeparator();

    jAllProfiles = new JCheckBox(TabsTracker.get().allProfiles());
    jAllProfiles.setActionCommand(TrackerAction.PROFILE.name());
    jAllProfiles.addActionListener(listener);

    jOwners = new JMultiSelectionList<String>();
    jOwners.getSelectionModel().addListSelectionListener(listener);
    JScrollPane jOwnersScroll = new JScrollPane(jOwners);

    JLabel jHelp = new JLabel(TabsTracker.get().help());
    jHelp.setIcon(Images.MISC_HELP.getIcon());

    JLabel jNoFilter = new JLabel(TabsTracker.get().helpLegacyData());
    jNoFilter.setIcon(new ShapeIcon(NO_FILTER));

    JLabel jFilter = new JLabel(TabsTracker.get().helpNewData());
    jFilter.setIcon(new ShapeIcon(FILTER_AND_DEFAULT));

    JDropDownButton jSettings = new JDropDownButton(Images.DIALOG_SETTINGS.getIcon());

    jIncludeZero = new JCheckBoxMenuItem(TabsTracker.get().includeZero());
    jIncludeZero.setSelected(true);
    jIncludeZero.setActionCommand(TrackerAction.INCLUDE_ZERO.name());
    jIncludeZero.addActionListener(listener);
    jSettings.add(jIncludeZero);

    DateAxis domainAxis = new DateAxis();
    domainAxis.setDateFormatOverride(dateFormat);
    domainAxis.setVerticalTickLabels(true);
    domainAxis.setAutoTickUnitSelection(true);
    domainAxis.setAutoRange(true);
    domainAxis.setTickLabelFont(jFromLabel.getFont());

    NumberAxis rangeAxis = new NumberAxis();
    rangeAxis.setAutoRange(true);
    rangeAxis.setStandardTickUnits(NumberAxis.createStandardTickUnits());
    rangeAxis.setTickLabelFont(jFromLabel.getFont());

    //XYPlot plot = new XYPlot(dataset, domainAxis, rangeAxis, new XYLineAndShapeRenderer(true, true));
    render = new MyRender();
    XYPlot plot = new XYPlot(dataset, domainAxis, rangeAxis, render);
    plot.setBackgroundPaint(Color.WHITE);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    plot.getRenderer()
            .setBaseToolTipGenerator(new StandardXYToolTipGenerator("{0}: {2} ({1})", dateFormat, iskFormat));
    plot.setDomainCrosshairLockedOnData(true);
    plot.setDomainCrosshairStroke(new BasicStroke(1));
    plot.setDomainCrosshairPaint(Color.BLACK);
    plot.setDomainCrosshairVisible(false);
    plot.setRangeCrosshairLockedOnData(true);
    plot.setRangeCrosshairVisible(false);

    jNextChart = new JFreeChart(plot);
    jNextChart.setAntiAlias(true);
    jNextChart.setBackgroundPaint(jPanel.getBackground());
    jNextChart.addProgressListener(null);
    jNextChart.getLegend().setItemFont(jFrom.getFont());

    jChartPanel = new ChartPanel(jNextChart);
    jChartPanel.addMouseListener(listener);
    jChartPanel.setDomainZoomable(false);
    jChartPanel.setRangeZoomable(false);
    jChartPanel.setPopupMenu(null);
    jChartPanel.addChartMouseListener(listener);
    jChartPanel.setMaximumDrawHeight(Integer.MAX_VALUE);
    jChartPanel.setMaximumDrawWidth(Integer.MAX_VALUE);
    jChartPanel.setMinimumDrawWidth(10);
    jChartPanel.setMinimumDrawHeight(10);

    int AssetsGapWidth = PANEL_WIDTH - jAssets.getPreferredSize().width
            - jAssetsFilters.getPreferredSize().width;
    if (AssetsGapWidth < 0) {
        AssetsGapWidth = 0;
    }
    int WalletGapWidth = PANEL_WIDTH - jWalletBalance.getPreferredSize().width
            - jWalletBalanceFilters.getPreferredSize().width;
    if (WalletGapWidth < 0) {
        WalletGapWidth = 0;
    }

    layout.setHorizontalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup()
            .addGroup(layout.createSequentialGroup().addComponent(jHelp).addGap(20).addComponent(jNoFilter)
                    .addGap(20).addComponent(jFilter).addGap(20, 20, Integer.MAX_VALUE).addComponent(jSettings)
                    .addGap(6))
            .addComponent(jChartPanel)).addGroup(
                    layout.createParallelGroup().addComponent(jQuickDate, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup()
                                            .addComponent(jFromLabel, LABEL_WIDTH, LABEL_WIDTH, LABEL_WIDTH)
                                            .addComponent(jToLabel, LABEL_WIDTH, LABEL_WIDTH, LABEL_WIDTH))
                                    .addGap(0)
                                    .addGroup(layout.createParallelGroup()
                                            .addComponent(jFrom, PANEL_WIDTH - LABEL_WIDTH,
                                                    PANEL_WIDTH - LABEL_WIDTH, PANEL_WIDTH - LABEL_WIDTH)
                                            .addComponent(jTo, PANEL_WIDTH - LABEL_WIDTH,
                                                    PANEL_WIDTH - LABEL_WIDTH, PANEL_WIDTH - LABEL_WIDTH)))
                            .addComponent(jDateSeparator, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jAll, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jTotal, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addGroup(layout.createSequentialGroup().addComponent(jWalletBalance)
                                    .addGap(0, 0, WalletGapWidth).addComponent(jWalletBalanceFilters))
                            .addGroup(layout.createSequentialGroup().addComponent(jAssets)
                                    .addGap(0, 0, AssetsGapWidth).addComponent(jAssetsFilters))
                            .addComponent(jSellOrders, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jEscrows, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jEscrowsToCover, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jManufacturing, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jContractCollateral, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jContractValue, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jOwnersSeparator, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jAllProfiles, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)
                            .addComponent(jOwnersScroll, PANEL_WIDTH, PANEL_WIDTH, PANEL_WIDTH)));
    layout.setVerticalGroup(layout.createParallelGroup()
            .addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup()
                    .addComponent(jHelp, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jNoFilter, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jFilter, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jSettings, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight()))
                    .addComponent(jChartPanel))
            .addGroup(layout.createSequentialGroup()
                    .addComponent(jQuickDate, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addGroup(layout.createParallelGroup()
                            .addComponent(jFromLabel, Program.getButtonsHeight(), Program.getButtonsHeight(),
                                    Program.getButtonsHeight())
                            .addComponent(jFrom, Program.getButtonsHeight(), Program.getButtonsHeight(),
                                    Program.getButtonsHeight()))
                    .addGroup(layout.createParallelGroup()
                            .addComponent(jToLabel, Program.getButtonsHeight(), Program.getButtonsHeight(),
                                    Program.getButtonsHeight())
                            .addComponent(jTo, Program.getButtonsHeight(), Program.getButtonsHeight(),
                                    Program.getButtonsHeight()))
                    .addComponent(jDateSeparator, 3, 3, 3)
                    .addComponent(jAll, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jTotal, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addGroup(layout.createParallelGroup()
                            .addComponent(jWalletBalance, Program.getButtonsHeight(),
                                    Program.getButtonsHeight(), Program.getButtonsHeight())
                            .addComponent(jWalletBalanceFilters, Program.getButtonsHeight(),
                                    Program.getButtonsHeight(), Program.getButtonsHeight()))
                    .addGroup(layout.createParallelGroup()
                            .addComponent(jAssets, Program.getButtonsHeight(), Program.getButtonsHeight(),
                                    Program.getButtonsHeight())
                            .addComponent(jAssetsFilters, Program.getButtonsHeight(),
                                    Program.getButtonsHeight(), Program.getButtonsHeight()))
                    .addComponent(jSellOrders, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jEscrows, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jEscrowsToCover, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jManufacturing, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jContractCollateral, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jContractValue, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jOwnersSeparator, 3, 3, 3)
                    .addComponent(jAllProfiles, Program.getButtonsHeight(), Program.getButtonsHeight(),
                            Program.getButtonsHeight())
                    .addComponent(jOwnersScroll, 70, 70, Integer.MAX_VALUE)));
}

From source file:skoa.helpers.Graficos.java

private void evolucionDual() {
    TimeSeries serie;/*from  ww w .  ja va2 s .c o  m*/
    XYDataset dataset = null;
    ui = 0;
    nombreFichero = nombresFicheros.elementAt(0);
    unidad = buscarUnidad(nombreFichero);
    serie = obtenerSerieEvolucion();
    dataset = new TimeSeriesCollection(serie);
    //Para generar el grfico se usa createTimeSeriesChart para ver la evolucin de las fechas.
    JFreeChart grafica = ChartFactory.createTimeSeriesChart("Valores medidos de las direcciones de grupo", //titulo
            "Fechas", //titulo eje x
            "Mediciones (" + unidad + ")", //titulo eje y
            dataset, //dataset
            true, //leyenda
            true, //tooltips
            false); //configure chart to generate URLs?
    //Dar color a cada categoria
    grafica.setBackgroundPaint(Color.WHITE); //Color del fondo del grfico
    //CREACIN DEL SEGUNDO EJE CON SU CORRESPONDIENTE DATASET.
    XYDataset dataset2 = null;
    ui = 0;
    nombreFichero = nombresFicheros.elementAt(1);
    unidad = buscarUnidad(nombreFichero);
    final XYPlot plot = grafica.getXYPlot();
    final NumberAxis axis2 = new NumberAxis("Mediciones (" + unidad + ")");
    axis2.setAutoRangeIncludesZero(false);
    plot.setRangeAxis(1, axis2);
    serie = obtenerSerieEvolucion();
    dataset2 = new TimeSeriesCollection(serie);
    plot.setDataset(1, dataset2);
    plot.mapDatasetToRangeAxis(1, 1);
    final StandardXYItemRenderer renderer2 = new StandardXYItemRenderer();
    renderer2.setSeriesPaint(0, Color.blue);
    plot.setRenderer(1, renderer2);
    plot.setBackgroundPaint(new Color(0xEE, 0xEE, 0xFF));//igual color de fondo que el de barrasDual
    plot.setDomainGridlinesVisible(true); //Ver lineas divisorias.
    plot.setRangeGridlinePaint(Color.BLACK);//Color de las lineas divisorias.
    //---------------------------------------------------------------------
    if (fechaInicial.equals("") & fechaFinal.equals("")) { //Si estn vacas es porque no hay resultados para ese intervalo.
        fechaInicial = " ? ";
        fechaFinal = " ? ";
    }
    TextTitle t = new TextTitle("desde " + fechaInicial + " hasta " + fechaFinal,
            new Font("SanSerif", Font.ITALIC, 12));
    grafica.addSubtitle(t);
    try {
        ChartUtilities.saveChartAsJPEG(new File(ruta + "EvolucionSmall.jpg"), grafica, 400, 300);
        ChartUtilities.saveChartAsJPEG(new File(ruta + "EvolucionBig.jpg"), grafica, 900, 600);
    } catch (IOException e1) {
        System.err.println("Problem occurred creating chart." + e1);
    }
}

From source file:edu.ku.brc.specify.plugins.TaxonLabelFormatting.java

@Override
public void initialize(Properties propertiesArg, boolean isViewModeArg) {
    super.initialize(propertiesArg, isViewModeArg);

    String plName = "TaxonLabelFormatter";
    PickListDBAdapterIFace adapter = PickListDBAdapterFactory.getInstance().create(plName, false);
    if (adapter == null || adapter.getPickList() == null) {
        throw new RuntimeException("PickList Adapter [" + plName + "] cannot be null!");
    }/*from   w w  w  . j av  a 2 s .  c om*/
    formatCBX = new ValComboBox(adapter);
    formatCBX.getComboBox().addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            doFormatting();
        }
    });
    formatCBX.getComboBox().addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            doFormatting();
        }
    });

    newAgentBtn = createButton(""); // Label set when new Resource Bundle is installed (below)
    searchPanel = new DBObjSearchPanel("Search", "AgentNameSearch", "AgentNameSearch",
            "edu.ku.brc.specify.datamodel.Agent", "agentId", SwingConstants.BOTTOM);
    searchPanel.getScrollPane().setMinimumSize(new Dimension(100, 200));
    searchPanel.getScrollPane().setPreferredSize(new Dimension(100, 150));
    ((FormViewObj) searchPanel.getForm()).getPanel().setBorder(null);

    try {
        UIRegistry.loadAndPushResourceBundle("specify_plugins");

        newAgentBtn.setText(getResourceString("NewAgent"));

        authorsList = new JList(new DefaultListModel());
        authorsList.setVisibleRowCount(10);
        authorsList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                if (!e.getValueIsAdjusting()) {
                    Object selObj = authorsList.getSelectedValue();
                    if (selObj != null) {

                    }
                    updateEnabledState();
                }
            }
        });
        JScrollPane scrollPane = new JScrollPane(authorsList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

        mapToBtn = createIconBtn("Map", "ADD_AUTHOR_NAME_TT", new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                Object agent = searchPanel.getSelectedObject();
                ((DefaultListModel) authorsList.getModel()).addElement(agent);
                doFormatting();
            }
        });
        unmapBtn = createIconBtn("Unmap", "REMOVE_AUTHOR_NAME_TT", new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                int index = authorsList.getSelectedIndex();
                if (index > -1) {
                    DefaultListModel model = (DefaultListModel) authorsList.getModel();
                    model.remove(index);
                    updateEnabledState();
                    doFormatting();
                }
            }
        });

        upBtn = createIconBtn("ReorderUp", "MOVE_AUTHOR_NAME_UP", new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                DefaultListModel model = (DefaultListModel) authorsList.getModel();
                int index = authorsList.getSelectedIndex();
                Object item = authorsList.getSelectedValue();
                model.remove(index);
                model.insertElementAt(item, index - 1);
                authorsList.setSelectedIndex(index - 1);
                updateEnabledState();
            }
        });
        downBtn = createIconBtn("ReorderDown", "MOVE_AUTHOR_NAME_DOWN", new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                DefaultListModel model = (DefaultListModel) authorsList.getModel();
                int index = authorsList.getSelectedIndex();
                Object item = authorsList.getSelectedValue();
                model.remove(index);
                model.insertElementAt(item, index + 1);
                authorsList.setSelectedIndex(index + 1);
                updateEnabledState();
            }
        });

        PanelBuilder bldr = new PanelBuilder(new FormLayout("p, 5px, p, 5px, f:p:g, 2px, p",
                "p, 4px, p, 2px, f:p:g, 4px, p, 4px, p, 2px, p, 2px, p, 2px, p"), this);
        CellConstraints cc = new CellConstraints();

        PanelBuilder upDownPanel = new PanelBuilder(new FormLayout("p", "p, 2px, p, f:p:g"));
        upDownPanel.add(upBtn, cc.xy(1, 1));
        upDownPanel.add(downBtn, cc.xy(1, 3));

        PanelBuilder middlePanel = new PanelBuilder(new FormLayout("c:p:g", "f:p:g, p, 2px, p, f:p:g"));
        middlePanel.add(mapToBtn, cc.xy(1, 2));
        middlePanel.add(unmapBtn, cc.xy(1, 4));

        PanelBuilder rwPanel = new PanelBuilder(new FormLayout("p, 2px, f:p:g", "p"));
        refWorkLabel = createLabel(getResourceString("NONE"));
        rwPanel.add(createI18NFormLabel("REFERENCEWORK"), cc.xy(1, 1));
        rwPanel.add(refWorkLabel, cc.xy(3, 1));

        int y = 1;

        bldr.add(rwPanel.getPanel(), cc.xywh(1, y, 7, 1));
        y += 2;

        bldr.add(searchPanel, cc.xywh(1, y, 1, 3));
        bldr.addSeparator(getResourceString("Authors"), cc.xy(5, y));
        y += 2;

        bldr.add(middlePanel.getPanel(), cc.xy(3, y));
        bldr.add(scrollPane, cc.xywh(5, y, 1, 3));
        bldr.add(upDownPanel.getPanel(), cc.xy(7, y));
        y += 2;

        PanelBuilder newAgentPanel = new PanelBuilder(new FormLayout("f:p:g,p", "p"));
        newAgentPanel.add(newAgentBtn, cc.xy(2, 1));

        bldr.add(newAgentPanel.getPanel(), cc.xy(1, y));
        y += 2;

        JLabel fmtLabel = createLabel(getResourceString("LABELFORMAT"));
        bldr.add(fmtLabel, cc.xy(1, y));
        y += 2;
        bldr.add(formatCBX, cc.xywh(1, y, 7, 1));
        y += 2;

        Font plain = fmtLabel.getFont();
        specialLabel = new SpecialLabel(plain, new Font(plain.getName(), Font.ITALIC, plain.getSize()));
        specialLabel.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
        bldr.add(createLabel(getResourceString("SAMPLEOUTPUT") + ":"), cc.xywh(1, y, 7, 1));
        y += 2;
        bldr.add(specialLabel, cc.xywh(1, y, 7, 1));

        searchPanel.setOKBtn(mapToBtn);
    } catch (Exception ex) {
        edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
        edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(TaxonLabelFormatting.class, ex);
        log.error(ex);
        ex.printStackTrace();
    }
    UIRegistry.popResourceBundle();
}

From source file:io.github.karols.hocr4j.PageRenderer.java

/**
 * Sets all fonts as belonging to the same family.
 * Default family is Arial size 15./*w w w. j  a  v a  2s .co m*/
 *
 * @param fontFamilyName family name, e.g. "Arial"
 * @param size           size, e.g. 16
 */
public void setFontFamily(String fontFamilyName, int size) {
    plainFont = new Font(fontFamilyName, Font.PLAIN, size);
    boldFont = new Font(fontFamilyName, Font.BOLD, size);
    italicFont = new Font(fontFamilyName, Font.ITALIC, size);
    boldItalicFont = new Font(fontFamilyName, Font.BOLD | Font.ITALIC, size);
}

From source file:com.sshtools.appframework.api.ui.SshToolsApplicationPanel.java

/**
 * Display something other that the normal blank screen so our component
 * looks pretty./*from www. j  a  va  2  s  .co m*/
 */
protected void showWelcomeScreen() {
    synchronized (getTreeLock()) {
        removeAll();
        setLayout(new BorderLayout());
        //         GradientPanel p = new GradientPanel(new BorderLayout());
        //         p.setBackground(Color.white);
        //         p.setBackground2(new Color(164, 228, 244));
        //         p.setForeground(Color.black);
        JPanel p = new JPanel(new BorderLayout());
        JLabel welcomeLabel = new JLabel("", JLabel.CENTER);
        welcomeLabel.setForeground(Color.white);
        welcomeLabel.setFont(welcomeLabel.getFont().deriveFont(72f).deriveFont(Font.BOLD + Font.ITALIC));
        welcomeLabel.setHorizontalAlignment(JLabel.RIGHT);
        p.add(welcomeLabel, BorderLayout.SOUTH);
        add(p, BorderLayout.CENTER);
        validate();
    }
}