Java desktop application for calculating and visualizing CO2/Carbon emissions before and after cloud adoption. Features emission calculations, data persistence, reporting, and interactive charts.
- Emission Calculation: Calculate CO2 and Carbon emissions based on energy consumption and emission factors
- Cloud Impact Analysis: Compare emissions before and after cloud adoption with configurable power reduction percentages
- Data Persistence: Save emission data with timestamps to a text file
- Report Generation: Generate comprehensive reports from saved emission data
- Visual Analytics: Create interactive line charts showing emission trends over time
- User-Friendly GUI: Intuitive Swing-based graphical user interface
- Java: JDK 8 or higher
- JFreeChart Library: Version 1.0.19 (included in the project)
- JCommon Library: Version 1.0.23 (included in the project)
Sustainable-Resource-Management-System/
├── finalProject/
│ ├── src/
│ │ └── finalProject/
│ │ └── SustainableResourceManagementSystem.java
│ ├── bin/
│ │ └── finalProject/
│ │ └── SustainableResourceManagementSystem.class
│ ├── emission_data.txt # Saved emission data
│ └── jfreechart-1.0.19/ # JFreeChart library
│ └── lib/
│ ├── jfreechart-1.0.19.jar
│ └── jcommon-1.0.23.jar
├── Proposal.docx
├── Presentation.pdf
└── README.md
-
Clone or download the repository
git clone <repository-url> cd Sustainable-Resource-Management-System
-
Ensure Java is installed
java -version
Should show Java 8 or higher.
-
Compile the project
cd finalProject javac -cp "jfreechart-1.0.19/lib/jfreechart-1.0.19.jar:jfreechart-1.0.19/lib/jcommon-1.0.23.jar" src/finalProject/SustainableResourceManagementSystem.java -d bin
cd finalProject
java -cp "bin:jfreechart-1.0.19/lib/jfreechart-1.0.19.jar:jfreechart-1.0.19/lib/jcommon-1.0.23.jar" finalProject.SustainableResourceManagementSystem-
Enter Input Values:
- Energy Consumption (kWh): Total energy consumption
- CO2 Emission Factor (kg CO2/kWh): Emission factor for your energy source
- CO2 Emission (kg): Additional CO2 emissions
- Cloud Power Reduction (%): Percentage reduction in power consumption after cloud adoption
-
Calculate Total Emission:
- Click "Calculate Total Emission" to see emissions before and after cloud adoption
- Results display both CO2 and Carbon emissions
-
Save Data:
- Click "Save Data" to persist the current calculation with a timestamp
- Data is saved to
emission_data.txtin thefinalProjectdirectory
-
Generate Report:
- Click "Generate Report" to view all saved emission data
- The report appears in the Report text area
-
Generate Emission Graphs:
- Click "Generate Emission Graphs" to create visual charts
- The graph displays four series:
- Red: CO2 Emission Before Cloud
- Yellow: CO2 Emission After Cloud
- Green: Carbon Emission Before Cloud
- Blue: Carbon Emission After Cloud
- Before Cloud:
(Energy Consumption × CO2 Emission Factor) + CO2 Emission - After Cloud:
(Energy Consumption × (1 - Reduction%) × CO2 Emission Factor) + CO2 Emission
- Carbon Emission Factor:
CO2 Emission Factor × 0.2727(1 kg CO2 = 0.2727 kg Carbon) - Before Cloud:
(Energy Consumption × Carbon Emission Factor) + (CO2 Emission × 0.2727) - After Cloud:
(Energy Consumption × (1 - Reduction%) × Carbon Emission Factor) + (CO2 Emission × 0.2727)
Saved data is stored in emission_data.txt with the following format:
Timestamp: YYYY-MM-DD HH:mm:ss, Energy Consumption: X kWh, CO2 Emission Factor: Y kg CO2/kWh, CO2 Emission: Z kg, Carbon Emission Factor: W kg C/kWh, Power Reduction: P%, Total CO2 Emission Before Cloud: A kg CO2, Total CO2 Emission After Cloud: B kg CO2, Total Carbon Emission Before Cloud: C kg C, Total Carbon Emission After Cloud: D kg C
- JFreeChart 1.0.19: For chart generation and visualization
- JCommon 1.0.23: Required dependency for JFreeChart
Both libraries are included in the jfreechart-1.0.19/lib/ directory.
-
ClassNotFoundException: Ensure the JAR files are in the classpath
java -cp "bin:jfreechart-1.0.19/lib/*" finalProject.SustainableResourceManagementSystem -
No data available for report: Make sure you've saved at least one data entry before generating a report
-
Graph generation error: Ensure
emission_data.txtexists and contains valid data entries -
Invalid input error: Make sure all input fields contain valid numeric values
cd finalProject
javac -cp "jfreechart-1.0.19/lib/jfreechart-1.0.19.jar:jfreechart-1.0.19/lib/jcommon-1.0.23.jar" \
src/finalProject/SustainableResourceManagementSystem.java \
-d bin- Main Class:
SustainableResourceManagementSystem.java- GUI initialization and layout
- Event handlers for buttons
- Calculation logic
- File I/O operations
- Chart generation
This project uses JFreeChart library which is licensed under LGPL. Please refer to jfreechart-1.0.19/licence-LGPL.txt for details.
Developed as part of a final project for Sustainable Resource Management.
- Export reports to PDF format
- Database integration for data storage
- Multiple chart types (bar, pie, etc.)
- Data filtering and search capabilities
- Multi-user support
- API integration for real-time emission factors
Contributions are welcome! Please feel free to submit issues or pull requests.
For questions or support, please refer to the project documentation or contact the development team.