Search in sources :

Example 91 with ImageIcon

use of javax.swing.ImageIcon in project ACS by ACS-Community.

the class LogFrame method initialize.

/**
	 * Initialize the content of the frame
	 *
	 * @param discardLevel The discard level
	 * @param unlimited If <code>true</code> the number of logs in memory is unlimited, 
	 *                  otherwise the default is used
	 * @param aInfo The audience
	 */
private void initialize(LogTypeHelper discardLevel, boolean unlimited, AudienceInfo aInfo) {
    setTitle("LoggingClient");
    addWindowListener(this);
    // Set the icon
    ImageIcon image = new ImageIcon(LogFrame.class.getResource("/alma.png"));
    setIconImage(image.getImage());
    // build the LoggingClient
    loggingClient = new LoggingClient(this, LoggingClient.DEFAULT_LOGLEVEL, discardLevel, unlimited, aInfo);
    if (loggingClient == null) {
        throw new NullPointerException("The logging client is null");
    }
    this.setRootPane(loggingClient);
    // Enable the exit menu
    loggingClient.hideExitMenu(false);
    // Move the window to the center of the screen 
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension windowSize = getSize();
    setLocation(Math.max(0, (screenSize.width - windowSize.width) / 2), Math.max(0, (screenSize.height - windowSize.height) / 2));
    pack();
    setVisible(true);
}
Also used : ImageIcon(javax.swing.ImageIcon) LoggingClient(com.cosylab.logging.LoggingClient) Dimension(java.awt.Dimension)

Example 92 with ImageIcon

use of javax.swing.ImageIcon in project ACS by ACS-Community.

the class LogMenuBar method getSaveFileMenuItem.

/**
	 * Returns the SaveFileMenuItem property value.
	 * @return javax.swing.JMenuItem
	 */
public JMenuItem getSaveFileMenuItem() {
    if (saveFileMenuItem == null) {
        ImageIcon icon = new ImageIcon(LogTypeHelper.class.getResource("/disk.png"));
        saveFileMenuItem = new JMenuItem("Save File As", icon);
        saveFileMenuItem.setName("SaveFileMenuItem");
    }
    return saveFileMenuItem;
}
Also used : ImageIcon(javax.swing.ImageIcon) LogTypeHelper(com.cosylab.logging.engine.log.LogTypeHelper) JMenuItem(javax.swing.JMenuItem)

Example 93 with ImageIcon

use of javax.swing.ImageIcon in project ACS by ACS-Community.

the class LogMenuBar method getLoadDBMenuItem.

/**
	 * Returns the LoadDB menu item
	 * 
	 * @return The LoadDB menu item
	 */
public JMenuItem getLoadDBMenuItem() {
    if (loadDBMenuItem == null) {
        ImageIcon icon = new ImageIcon(LogTypeHelper.class.getResource("/database.png"));
        loadDBMenuItem = new JMenuItem("Load from database", icon);
        loadDBMenuItem.setName("LoadDBMenuItem");
    }
    return loadDBMenuItem;
}
Also used : ImageIcon(javax.swing.ImageIcon) LogTypeHelper(com.cosylab.logging.engine.log.LogTypeHelper) JMenuItem(javax.swing.JMenuItem)

Example 94 with ImageIcon

use of javax.swing.ImageIcon in project ACS by ACS-Community.

the class LogMenuBar method getFiltersMenuItem.

/**
	 * Return the editFiltersMenuItem
	 * @return
	 */
public JMenuItem getFiltersMenuItem() {
    if (filtersMenuItem == null) {
        ImageIcon filterIcon = new ImageIcon(LogTypeHelper.class.getResource("/filters.png"));
        filtersMenuItem = new JMenuItem("Filters...", filterIcon);
        filtersMenuItem.setName("EditFiltersMenuItem");
    }
    return filtersMenuItem;
}
Also used : ImageIcon(javax.swing.ImageIcon) LogTypeHelper(com.cosylab.logging.engine.log.LogTypeHelper) JMenuItem(javax.swing.JMenuItem)

Example 95 with ImageIcon

use of javax.swing.ImageIcon in project ACS by ACS-Community.

the class LogToolBar method getClearLogsBtn.

/**
     * 
     * @return The button to clear the logs
     */
public JButton getClearLogsBtn() {
    if (clearLogsBtn == null) {
        // Add the button to delete logs
        ImageIcon iconClear = new ImageIcon(LogTypeHelper.class.getResource("/delete.png"));
        clearLogsBtn = new JButton("<HTML><FONT size=-2>Clear logs</FONT>", iconClear);
    }
    return clearLogsBtn;
}
Also used : ImageIcon(javax.swing.ImageIcon) LogTypeHelper(com.cosylab.logging.engine.log.LogTypeHelper) JButton(javax.swing.JButton)

Aggregations

ImageIcon (javax.swing.ImageIcon)427 JButton (javax.swing.JButton)109 ActionEvent (java.awt.event.ActionEvent)83 ActionListener (java.awt.event.ActionListener)70 JLabel (javax.swing.JLabel)67 Dimension (java.awt.Dimension)62 BufferedImage (java.awt.image.BufferedImage)51 JPanel (javax.swing.JPanel)48 Insets (java.awt.Insets)42 Image (java.awt.Image)31 BorderLayout (java.awt.BorderLayout)28 IOException (java.io.IOException)28 URL (java.net.URL)26 GridBagLayout (java.awt.GridBagLayout)23 JMenuItem (javax.swing.JMenuItem)23 Color (java.awt.Color)21 Point (java.awt.Point)21 LogTypeHelper (com.cosylab.logging.engine.log.LogTypeHelper)20 JToggleButton (javax.swing.JToggleButton)20 JScrollPane (javax.swing.JScrollPane)19