All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.filePiper.gui.StatusBar Maven / Gradle / Ivy

Go to download

This project is a GUI utility for processing files. It allows selecting a set of source files and a pipeline of processes to apply onto those files. The applications shows in a nice-looking user interface where you can define profiles for your repetitive tasks. It provides pre-defined processors doing usual file manipulation tasks like: Copy, Head, Tail, Chunk, Search, Replace, Zip, Unzip... But the biggest value of this file processor tool is the ability to add easily custom file processors written in java.

The newest version!
package net.sf.filePiper.gui;


import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JLabel;


public class StatusBar extends JLabel {


    private static final double FACTOR = 0.9;
    private String status;


    public StatusBar() {
        setText(" ");
        setBackground(darker(getBackground()));
        setOpaque(true);
        Dimension preferredSize = getPreferredSize();
        setPreferredSize(new Dimension(200, preferredSize.height));
    }


    public Color darker(Color src) {
        return new Color(Math.max((int) (src.getRed() * FACTOR), 0), Math.max((int) (src.getGreen() * FACTOR), 0), Math.max(
                (int) (src.getBlue() * FACTOR), 0));
    }


    public void setStatus(String newStatus) {
        if (!newStatus.equals(status)) {
            status = newStatus;
            setText(newStatus);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy