better now
This commit is contained in:
parent
4f46de8d00
commit
358503f857
5010 changed files with 161 additions and 603699 deletions
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j + 1 < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,272 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i-1; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
Library::setTotalBooks(numBooks);
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 1; j < Library::getTotalBooks(); j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,266 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,266 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < 99 - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < 99; i++) {
|
|
||||||
for (int j = 0; j < 99 - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < 99; i++) {
|
|
||||||
for (int j = 0; j < 99 - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,266 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i-1; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < 1; i++) {
|
|
||||||
for (int j = 0; j < i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i-1; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,266 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < 99; i++) {
|
|
||||||
for (int j = 0; j < 99 - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < 99; i++) {
|
|
||||||
for (int j = 0; j < 99 - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/a3/ali2.cpp","entries":[{"id":"oRqB.cpp","timestamp":1711905847733},{"id":"Yufd.cpp","timestamp":1711905905604},{"id":"OyPi.cpp","timestamp":1711905925645},{"id":"hyl6.cpp","timestamp":1711905948049},{"id":"DFD7.cpp","timestamp":1711906070572},{"id":"bdBv.cpp","timestamp":1711906080769},{"id":"9oTO.cpp","timestamp":1711906100620},{"id":"I2f2.cpp","timestamp":1711906187000},{"id":"sIvO.cpp","timestamp":1711906350289},{"id":"eonH.cpp","timestamp":1711906377038},{"id":"5oh9.cpp","timestamp":1711906726522},{"id":"jCjv.cpp","timestamp":1711906800879},{"id":"71QD.cpp","timestamp":1711906844386},{"id":"02RO.cpp","timestamp":1711906944724},{"id":"acJi.cpp","timestamp":1711906964117},{"id":"KKSz.cpp","timestamp":1711907079695},{"id":"3jwS.cpp","timestamp":1711907145693},{"id":"SZ5K.cpp","timestamp":1711907259725},{"id":"RwFw.cpp","timestamp":1711907349413}]}
|
|
||||||
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,266 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[100]) {
|
|
||||||
for (int i = 0; i < 99; i++) {
|
|
||||||
for (int j = 0; j < 99 - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < 99; i++) {
|
|
||||||
for (int j = 0; j < 99 - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < 99; i++) {
|
|
||||||
for (int j = 0; j < 99 - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 1; j < Library::getTotalBooks(); j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,271 +0,0 @@
|
||||||
#include<iostream>
|
|
||||||
#include<cstring>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
private:
|
|
||||||
char *bookTitle;
|
|
||||||
char *author;
|
|
||||||
int bookID;
|
|
||||||
int quantity;
|
|
||||||
float price;
|
|
||||||
static int totalBooks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
//Constructors
|
|
||||||
Library() : bookTitle(nullptr), author(nullptr) {
|
|
||||||
bookID = 0;
|
|
||||||
quantity = 0;
|
|
||||||
price = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library(char* title, char* authorName, int id, int newQuantity, float bookPrice) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
bookID = id;
|
|
||||||
quantity = newQuantity;
|
|
||||||
price = bookPrice;
|
|
||||||
totalBooks += newQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~Library() {
|
|
||||||
// delete[] bookTitle;
|
|
||||||
// delete[] author;
|
|
||||||
// totalBooks -= quantity;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Getters
|
|
||||||
char* getBookTitle() { return bookTitle; }
|
|
||||||
char* getAuthor() { return author; }
|
|
||||||
int getBookID() { return bookID; }
|
|
||||||
int getQuantity() { return quantity; }
|
|
||||||
float getPrice() { return price; }
|
|
||||||
|
|
||||||
static int getTotalBooks() {
|
|
||||||
return totalBooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setters
|
|
||||||
void setBookTitle(char* title) {
|
|
||||||
bookTitle = new char[strlen(title) + 1];
|
|
||||||
strcpy(bookTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAuthor(char* authorName) {
|
|
||||||
author = new char[strlen(authorName) + 1];
|
|
||||||
strcpy(author, authorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBookID(int bookID) { this->bookID = bookID; }
|
|
||||||
void setPrice(float price) { this->price = price; }
|
|
||||||
static void setTotalBooks(int total) { totalBooks = total; }
|
|
||||||
|
|
||||||
void setQuantity(int newQuantity) {
|
|
||||||
if (newQuantity >= 0) {
|
|
||||||
totalBooks += (newQuantity - quantity);
|
|
||||||
this->quantity = newQuantity;
|
|
||||||
} else {
|
|
||||||
cout << "Quantity cannot be negative." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Other member functions
|
|
||||||
void calcTotalPrice() {
|
|
||||||
float totalPrice = price * quantity;
|
|
||||||
cout << "The total price for all copies is Rs: " << totalPrice << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Library :: totalBooks = 0;
|
|
||||||
|
|
||||||
Library getBook_at(Library books[100], int index) {
|
|
||||||
return books[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBook(Library books[100], Library newBook) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == 0) {
|
|
||||||
books[i] = newBook;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Library is full. Cannot add more books," << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeBook(Library books[100], int bookID) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() == bookID) {
|
|
||||||
books[i] = Library();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << "Book of ID " << bookID << " not found." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByTitle(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), books[j + 1].getBookTitle()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByAuthor(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (strcmp(books[i].getAuthor(), books[j + 1].getAuthor()) > 0) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SortByPrice(Library books[100]) {
|
|
||||||
for (int i = 0; i < Library::getTotalBooks(); i++) {
|
|
||||||
for (int j = 0; j < Library::getTotalBooks() - i; j++) {
|
|
||||||
if (books[i].getPrice() > books[j + 1].getPrice()) {
|
|
||||||
Library temp = books[j];
|
|
||||||
books[j] = books[j + 1];
|
|
||||||
books[j + 1] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool searchByTittle(Library books[100], char* titlename) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (strcmp(books[i].getBookTitle(), titlename) == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Library mostExpensiveBook(Library books[100]) {
|
|
||||||
Library mostExpensive = books[0];
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getPrice() > mostExpensive.getPrice()) {
|
|
||||||
mostExpensive = books[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mostExpensive;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayBooks(Library books[100]) {
|
|
||||||
cout << "Books in the library: " << endl;
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
if (books[i].getBookID() != 0) {
|
|
||||||
cout << "Book Title: " << books[i].getBookTitle() << ", Author: " << books[i].getAuthor() << ", Price: " << books[i].getPrice() << ", Quantity: " << books[i].getQuantity() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Library books[100];
|
|
||||||
|
|
||||||
int numBooks;
|
|
||||||
cout << "Enter the total number of books: ";
|
|
||||||
cin >> numBooks;
|
|
||||||
|
|
||||||
for (int i = 0; i < numBooks && i < 100; i++) {
|
|
||||||
char bookName[100];
|
|
||||||
char authorName[100];
|
|
||||||
int id;
|
|
||||||
int booksQuantity;
|
|
||||||
float bookPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for Book " << i + 1 << ":" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(bookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore();
|
|
||||||
cin.getline(authorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> id;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> booksQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> bookPrice;
|
|
||||||
|
|
||||||
// books[i] = Library(bookName, authorName, id, booksQuantity, bookPrice);
|
|
||||||
books[i].setBookTitle(bookName);
|
|
||||||
books[i].setAuthor(authorName);
|
|
||||||
books[i].setBookID(id);
|
|
||||||
books[i].setQuantity(booksQuantity);
|
|
||||||
books[i].setPrice(bookPrice);
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByTitle(books);
|
|
||||||
cout << "Books sorted by title:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByAuthor(books);
|
|
||||||
cout << "Books sorted by author:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
SortByPrice(books);
|
|
||||||
cout << "Books sorted by price:" << endl;
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
|
|
||||||
Library mostExpensive = mostExpensiveBook(books);
|
|
||||||
cout << "The most expensive book of the library is: " << mostExpensive.getBookTitle() << " by " << mostExpensive.getAuthor() << endl;
|
|
||||||
|
|
||||||
char newBookName[100];
|
|
||||||
char newAuthorName[100];
|
|
||||||
int newID;
|
|
||||||
int newQuantity;
|
|
||||||
float newPrice;
|
|
||||||
|
|
||||||
cout << "Enter details for the new book:" << endl;
|
|
||||||
cout << "Book title: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(newBookName, 100);
|
|
||||||
cout << "Name of author: ";
|
|
||||||
//cin.ignore(); // Uncomment if needed
|
|
||||||
cin.getline(newAuthorName, 100);
|
|
||||||
cout << "ID: ";
|
|
||||||
cin >> newID;
|
|
||||||
cout << "Quantity of books: ";
|
|
||||||
cin >> newQuantity;
|
|
||||||
cout << "Price: ";
|
|
||||||
cin >> newPrice;
|
|
||||||
|
|
||||||
addBook(books, Library(newBookName, newAuthorName, newID, newQuantity, newPrice));
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
int removeID;
|
|
||||||
cout << "Enter the ID of the book to remove: ";
|
|
||||||
cin >> removeID;
|
|
||||||
|
|
||||||
removeBook(books, removeID);
|
|
||||||
|
|
||||||
displayBooks(books);
|
|
||||||
|
|
||||||
// Search by title
|
|
||||||
char searchTitle[100];
|
|
||||||
cout << "Enter the title to search: ";
|
|
||||||
cin.ignore();
|
|
||||||
cin.getline(searchTitle, 100);
|
|
||||||
|
|
||||||
if (searchByTittle(books, searchTitle)) {
|
|
||||||
cout << "Book found!" << endl;
|
|
||||||
} else {
|
|
||||||
cout << "Book not found!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"version":1,"resource":"file:///home/rafayahmad/Hibernate/hibernate/src/main/java/com/practice/Student.java","entries":[{"id":"hs27.java","timestamp":1711091228223}]}
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
package com.practice;
|
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
|
|
||||||
@Entity
|
|
||||||
public class Student{
|
|
||||||
|
|
||||||
@Id
|
|
||||||
private int rollNo;
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
private double gpa;
|
|
||||||
|
|
||||||
public Student(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Student(int rollNo, String name, double gpa){
|
|
||||||
this.rollNo = rollNo;
|
|
||||||
this.name = name;
|
|
||||||
this.gpa = gpa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRollNo(){
|
|
||||||
return rollNo;
|
|
||||||
}
|
|
||||||
public void setRollNo(int rollNo){
|
|
||||||
this.rollNo = rollNo;
|
|
||||||
}
|
|
||||||
public String getName(){
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(String name){
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
public double getGPA(){
|
|
||||||
return gpa;
|
|
||||||
}
|
|
||||||
public void setGPA(double gpa){
|
|
||||||
this.gpa = gpa;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
OBJS = util.o game.o Ball.o Paddle.o
|
|
||||||
|
|
||||||
LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
######
|
|
||||||
|
|
||||||
# CXX = g++
|
|
||||||
# CXXFLAGS = -Wall -g
|
|
||||||
# LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
# OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
# game: $(OBJS)
|
|
||||||
# $(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
# game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Ball.o: Ball.cpp Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# util.o: util.cpp util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f *.o game
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
OBJS = util.o game.o Ball.o Paddle.o Brick.o GameLevel.o Level1.o Food.o
|
|
||||||
|
|
||||||
LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
######
|
|
||||||
|
|
||||||
# CXX = g++
|
|
||||||
# CXXFLAGS = -Wall -g
|
|
||||||
# LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
# OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
# game: $(OBJS)
|
|
||||||
# $(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
# game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Ball.o: Ball.cpp Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# util.o: util.cpp util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f *.o game
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
OBJS = util.o game.o Ball.o Paddle.o Brick.o GameLevel.o Level1.o Level2.o Level3.o Food.o PinkFood.o GreenFood.o RedFood.o BlueFood.o YellowFood.o BrickBreaker.o
|
|
||||||
|
|
||||||
LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
######
|
|
||||||
|
|
||||||
# CXX = g++
|
|
||||||
# CXXFLAGS = -Wall -g
|
|
||||||
# LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
# OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
# game: $(OBJS)
|
|
||||||
# $(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
# game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Ball.o: Ball.cpp Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# util.o: util.cpp util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f *.o game
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
OBJS = util.o game.o Ball.o Paddle.o Brick.o GameLevel.o Level1.o Food.o PinkFood.o GreenFood.o RedFood.o BlueFood.o YellowFood.o BrickBreaker.o
|
|
||||||
|
|
||||||
LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
######
|
|
||||||
|
|
||||||
# CXX = g++
|
|
||||||
# CXXFLAGS = -Wall -g
|
|
||||||
# LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
# OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
# game: $(OBJS)
|
|
||||||
# $(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
# game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Ball.o: Ball.cpp Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# util.o: util.cpp util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f *.o game
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
# CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
# OBJS = util.o game.o
|
|
||||||
|
|
||||||
# LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
# $(TARGET): $(OBJS)
|
|
||||||
# $(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
# all: $(TARGET)
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
OBJS = util.o game.o Ball.o Paddle.o Brick.o GameLevel.o Level1.o Level2.o Level3.o Food.o PinkFood.o GreenFood.o RedFood.o BlueFood.o YellowFood.o BrickBreaker.o
|
|
||||||
|
|
||||||
LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
######
|
|
||||||
|
|
||||||
# CXX = g++
|
|
||||||
# CXXFLAGS = -Wall -g
|
|
||||||
# LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
# OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
# game: $(OBJS)
|
|
||||||
# $(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
# game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Ball.o: Ball.cpp Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# util.o: util.cpp util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f *.o game
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
# CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
# OBJS = util.o game.o
|
|
||||||
|
|
||||||
# LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
# $(TARGET): $(OBJS)
|
|
||||||
# $(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
# all: $(TARGET)
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
CXX = g++
|
|
||||||
CXXFLAGS = -Wall -g
|
|
||||||
LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
game: $(OBJS)
|
|
||||||
$(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
Ball.o: Ball.cpp Ball.h
|
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
util.o: util.cpp util.h
|
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o game
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/OOP/Project/Makefile","entries":[{"id":"Y9b6","timestamp":1714274464750},{"id":"eNtw","source":"Workspace Edit","timestamp":1714274470077},{"id":"pQQr","timestamp":1714274552961},{"id":"08bF","timestamp":1714274577412},{"id":"oa99","timestamp":1714444420261},{"id":"w8dM","timestamp":1714702095993},{"id":"BJai","timestamp":1714702188165},{"id":"o8JU","timestamp":1714896759288},{"id":"H85Z","timestamp":1715078595740},{"id":"Dp2v","timestamp":1715162236826},{"id":"bIOb","timestamp":1715185042230}]}
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
OBJS = util.o game.o Ball.o Paddle.o Brick.o GameLevel.o Level1.o Food.o PinkFood.o GreenFood.o RedFood.o BlueFood.o YellowFood.o
|
|
||||||
|
|
||||||
LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
######
|
|
||||||
|
|
||||||
# CXX = g++
|
|
||||||
# CXXFLAGS = -Wall -g
|
|
||||||
# LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
# OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
# game: $(OBJS)
|
|
||||||
# $(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
# game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Ball.o: Ball.cpp Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# util.o: util.cpp util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f *.o game
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
OBJS = util.o game.o Ball.o Paddle.o Brick.o GameLevel.o Level1.o
|
|
||||||
|
|
||||||
LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
######
|
|
||||||
|
|
||||||
# CXX = g++
|
|
||||||
# CXXFLAGS = -Wall -g
|
|
||||||
# LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
# OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
# game: $(OBJS)
|
|
||||||
# $(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
# game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Ball.o: Ball.cpp Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# util.o: util.cpp util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f *.o game
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
# CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
# OBJS = util.o game.o
|
|
||||||
|
|
||||||
# LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
# $(TARGET): $(OBJS)
|
|
||||||
# $(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
# all: $(TARGET)
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
######
|
|
||||||
|
|
||||||
CXX = g++
|
|
||||||
CXXFLAGS = -Wall -g
|
|
||||||
LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
game: $(OBJS)
|
|
||||||
$(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
Ball.o: Ball.cpp Ball.h
|
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
util.o: util.cpp util.h
|
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o game
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
CXXFLAGS = -g3 -Wall -fmessage-length=0 #-Werror
|
|
||||||
|
|
||||||
OBJS = util.o game.o Ball.o Paddle.o Brick.o GameLevel.o Level1.o Food.o
|
|
||||||
|
|
||||||
LIBS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TARGET = game
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
######
|
|
||||||
|
|
||||||
# CXX = g++
|
|
||||||
# CXXFLAGS = -Wall -g
|
|
||||||
# LDFLAGS = -L/usr/X11R6/lib -L/sw/lib -L/usr/sww/lib -L/usr/sww/bin -L/usr/sww/pkg/Mesa/lib -lglut -lGLU -lGL -lX11 -lfreeimage -pthread
|
|
||||||
|
|
||||||
# OBJS = game.o Ball.o Paddle.o util.o
|
|
||||||
|
|
||||||
# game: $(OBJS)
|
|
||||||
# $(CXX) -o $@ $^ $(LDFLAGS)
|
|
||||||
|
|
||||||
# game.o: game.cpp Ball.h Paddle.h util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Ball.o: Ball.cpp Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# Paddle.o: Paddle.cpp Paddle.h Ball.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# util.o: util.cpp util.h
|
|
||||||
# $(CXX) -c $(CXXFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# clean:
|
|
||||||
# rm -f *.o game
|
|
||||||
|
|
@ -1,729 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Author: Antonio Pelusi
|
|
||||||
* Website: https://www.antoniopelusi.com
|
|
||||||
* Source code: https://github.com/antoniopelusi/JavaFX-Dark-Theme
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
.root{
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Label */
|
|
||||||
.label{
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Pane */
|
|
||||||
.pane-grid{
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* GridPane */
|
|
||||||
.tab-pane-grid{
|
|
||||||
/*
|
|
||||||
* GridPane gridPane = new GridPane();
|
|
||||||
* gridPane.getStyleClass().add("tab-pane-grid");
|
|
||||||
* gridPane.setPadding(new Insets(3,0,0,0));
|
|
||||||
*/
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
-fx-background-insets: 3 0 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TextField */
|
|
||||||
.text-field{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-highlight-fill: #4e4e4e;
|
|
||||||
}
|
|
||||||
.text-field:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.text-field:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ComboBox */
|
|
||||||
.combo-box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-insets: 0 0 -1 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.combo-box .list-cell:selected{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.combo-box .list-cell:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.combo-box:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.combo-box:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.combo-box-base > .arrow-button {
|
|
||||||
-fx-padding: 0 6;
|
|
||||||
padding: 0 6;
|
|
||||||
}
|
|
||||||
.combo-box-base > .arrow-button > .arrow {
|
|
||||||
-fx-background-color: #555555;
|
|
||||||
background-color: #555555;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-padding: 2 4;
|
|
||||||
padding: 2 4;
|
|
||||||
-fx-shape: "M 0 0 H 7 L 3.5 4 z";
|
|
||||||
}
|
|
||||||
.combo-box .list-view{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-padding: 1;
|
|
||||||
padding: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ChoiceBox */
|
|
||||||
.choice-box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-insets: 0 0 -1 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.choice-box:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.choice-box:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ListCell */
|
|
||||||
.list-cell{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-min-height: 18;
|
|
||||||
min-height: 18;
|
|
||||||
-fx-pref-height: 18;
|
|
||||||
-fx-padding: 0 0 0 3;
|
|
||||||
padding: 0 0 0 3;
|
|
||||||
}
|
|
||||||
.list-cell:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.list-cell:pressed{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.list-cell:selected{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ListView */
|
|
||||||
.list-view{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-padding: 1;
|
|
||||||
padding: 1;
|
|
||||||
}
|
|
||||||
.list-view .scroll-bar{
|
|
||||||
-fx-background-insets: 0 -1 0 0;
|
|
||||||
}
|
|
||||||
.list-view .scroll-bar .thumb{
|
|
||||||
-fx-background-insets: 0 3 0 2;
|
|
||||||
}
|
|
||||||
.list-view:hover{
|
|
||||||
-fx-border-color: #3E3E40;
|
|
||||||
border-color: #3E3E40;
|
|
||||||
-fx-padding: 0;
|
|
||||||
padding: 0;
|
|
||||||
-fx-background-insets: 1 1 0 1;
|
|
||||||
}
|
|
||||||
.list-view:focused{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-padding: 0 0 1 0;
|
|
||||||
padding: 0 0 1 0;
|
|
||||||
-fx-background-insets: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Button */
|
|
||||||
.button{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-insets: 0 0 -1 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.button:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.button:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.button:pressed{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* CheckBox */
|
|
||||||
.check-box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-insets: 0 0 0 -1;
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.check-box > .box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-insets: 0 0 -1 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.check-box:focused > .box{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.check-box:hover > .box{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-background-insets: 0 0 1 0;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.check-box > .box > .mark{
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-shape: "M 9.97498 1.22334L 4.6983 9.09834 L 4.52164 9.09834 L 0 5.19331 L 1.27664 3.52165 L 4.255 6.08833 L 8.33331 1.52588e-005 L 9.97498 1.22334 Z " ;
|
|
||||||
}
|
|
||||||
.check-box:selected > .box > .mark{
|
|
||||||
-fx-background-color: #AFB1B3;
|
|
||||||
background-color: #AFB1B3;
|
|
||||||
}
|
|
||||||
.check-box:pressed > .box > .mark{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TextArea */
|
|
||||||
.text-area{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-highlight-fill: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.text-area:hover{
|
|
||||||
-fx-border-color: #3E3E40;
|
|
||||||
border-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.text-area:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.text-area .content{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.text-area .scroll-bar{
|
|
||||||
-fx-background-insets: 0 -0.5 0.5 0;
|
|
||||||
}
|
|
||||||
.text-area .scroll-bar .thumb{
|
|
||||||
-fx-background-insets: 0 2 0 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ScrollBar */
|
|
||||||
.scroll-bar{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #2A2A2C;
|
|
||||||
background-color: #2A2A2C;
|
|
||||||
}
|
|
||||||
.scroll-bar:vertical{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #2A2A2C;
|
|
||||||
background-color: #2A2A2C;
|
|
||||||
}
|
|
||||||
.scroll-bar > .decrement-button{
|
|
||||||
-fx-background-color: #2A2A2C;
|
|
||||||
background-color: #2A2A2C;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.scroll-bar .decrement-button,
|
|
||||||
.scroll-bar .increment-button{
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.scroll-bar .decrement-button:hover,
|
|
||||||
.scroll-bar .increment-button:hover{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.scroll-bar:vertical .increment-arrow,
|
|
||||||
.scroll-bar:vertical .decrement-arrow,
|
|
||||||
.scroll-bar:horizontal .increment-arrow,
|
|
||||||
.scroll-bar:horizontal .decrement-arrow{
|
|
||||||
-fx-shape : " ";
|
|
||||||
}
|
|
||||||
.scroll-bar:horizontal .thumb,
|
|
||||||
.scroll-bar:vertical .thumb {
|
|
||||||
-fx-background-color: #3D3D3D;
|
|
||||||
background-color: #3D3D3D;
|
|
||||||
-fx-background-radius : 0;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Menu */
|
|
||||||
.menu-bar {
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
}
|
|
||||||
.menu-bar .menu-button{
|
|
||||||
-fx-background: #4e4e4e;
|
|
||||||
background: #4e4e4e;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 20;
|
|
||||||
min-height: 20;
|
|
||||||
-fx-pref-height: 20;
|
|
||||||
-fx-padding: 0 5 0 5;
|
|
||||||
padding: 0 5 0 5;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.menu-item{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.menu-item:hover {
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.menu-item:pressed {
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.context-menu {
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-padding: 0 0 -1 0;
|
|
||||||
padding: 0 0 -1 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ProgressBar */
|
|
||||||
.progress-bar{
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.progress-bar .bar{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-padding: 3;
|
|
||||||
padding: 3;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
}
|
|
||||||
.progress-bar .track {
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Slider */
|
|
||||||
.slider{
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.slider .track{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-insets: 2 -2 1 0;
|
|
||||||
}
|
|
||||||
.slider .thumb{
|
|
||||||
-fx-background-color: #B1B1B1;
|
|
||||||
background-color: #B1B1B1;
|
|
||||||
-fx-background-radius: 6;
|
|
||||||
-fx-background-insets: 1 0 1 2;
|
|
||||||
-fx-border-radius: 6;
|
|
||||||
border-radius: 6;
|
|
||||||
-fx-border-insets: 1 0 1 2;
|
|
||||||
-fx-pref-width: 12;
|
|
||||||
-fx-pref-height: 12;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.slider:focused .thumb{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.slider .thumb:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.slider .thumb:pressed{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TreeView */
|
|
||||||
.tree-view .scroll-bar{
|
|
||||||
-fx-background-insets: 0 -1 0 0;
|
|
||||||
}
|
|
||||||
.tree-view .scroll-bar .thumb{
|
|
||||||
-fx-background-insets: 0 3 0 2;
|
|
||||||
}
|
|
||||||
.tree-view {
|
|
||||||
-fx-background-insets: 2;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-padding: 0 0 1 0;
|
|
||||||
padding: 0 0 1 0;
|
|
||||||
}
|
|
||||||
.tree-view:hover{
|
|
||||||
-fx-border-color: #3E3E40;
|
|
||||||
border-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.tree-view:focused {
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.tree-cell{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-pref-width: 20;
|
|
||||||
-fx-pref-height: 20;
|
|
||||||
-fx-padding: 1;
|
|
||||||
padding: 1;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.tree-cell:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.tree-cell:selected{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.tree-cell:pressed{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.tree-cell > .tree-disclosure-node > .arrow
|
|
||||||
{
|
|
||||||
-fx-background-color: #555555;
|
|
||||||
background-color: #555555;
|
|
||||||
}
|
|
||||||
.tree-cell:hover > .tree-disclosure-node > .arrow
|
|
||||||
{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Tab */
|
|
||||||
.tab-pane{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: transparent;
|
|
||||||
border-color: transparent;
|
|
||||||
-fx-background-insets: 25.5 0 0 0;
|
|
||||||
}
|
|
||||||
.tab{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 20;
|
|
||||||
min-height: 20;
|
|
||||||
-fx-pref-height: 20;
|
|
||||||
}
|
|
||||||
.tab:selected{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
|
|
||||||
-fx-border-color: transparent;
|
|
||||||
border-color: transparent;
|
|
||||||
}
|
|
||||||
.tab .tab-close-button {
|
|
||||||
-fx-shape: "M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z";
|
|
||||||
-fx-background-color: #AFB1B3;
|
|
||||||
background-color: #AFB1B3;
|
|
||||||
-fx-background-insets: 2;
|
|
||||||
-fx-margin: 0 0 -5 2;
|
|
||||||
margin: 0 0 -5 2;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.tab .tab-label {
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.tab-pane .tab-header-area .tab-header-background {
|
|
||||||
-fx-opacity: 0.0;
|
|
||||||
opacity: 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TitledPane */
|
|
||||||
.titled-pane{
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-label-padding: 0 0 -7 0;
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.titled-pane .title{
|
|
||||||
-fx-background-color: #3E3E42;
|
|
||||||
background-color: #3E3E42;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-pref-height: 14;
|
|
||||||
}
|
|
||||||
.titled-pane .content{
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
-fx-border-color: #3E3E42;
|
|
||||||
border-color: #3E3E42;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-border-width: 3 2 2 2;
|
|
||||||
border-width: 3 2 2 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TableView */
|
|
||||||
.table-view{
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-table-cell-border-color: #222222;
|
|
||||||
}
|
|
||||||
.table-view:focused{
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-insets: 1;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.table-view .column-header-background{
|
|
||||||
-fx-border-width: 0 0 1 0;
|
|
||||||
border-width: 0 0 1 0;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.table-view .column-header {
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
}
|
|
||||||
.table-view .column-resize-line {
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-pref-width: 1;
|
|
||||||
}
|
|
||||||
.table-row-cell{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-background-color: #AFB1B3;
|
|
||||||
-fx-margin: 1;
|
|
||||||
margin: 1;
|
|
||||||
}
|
|
||||||
.table-row-cell:hover {
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.table-row-cell:selected {
|
|
||||||
-fx-table-cell-border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.table-row-cell:pressed {
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.table-view .column-header .label {
|
|
||||||
-fx-alignment: center-left;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.table-view .filler {
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.table-view .column-drag-header{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Tooltip */
|
|
||||||
.tooltip{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-padding: 5;
|
|
||||||
padding: 5;
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/Java/HCloud/hcloudclient/src/main/java/com/rutils/styles/darktheme.css","entries":[{"id":"rIkd.css","timestamp":1720172212276},{"id":"yGZp.css","timestamp":1720172408932},{"id":"LKut.css","timestamp":1720781674031}]}
|
|
||||||
|
|
@ -1,732 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Author: Antonio Pelusi
|
|
||||||
* Website: https://www.antoniopelusi.com
|
|
||||||
* Source code: https://github.com/antoniopelusi/JavaFX-Dark-Theme
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
.root{
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Label */
|
|
||||||
.label{
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Pane */
|
|
||||||
.pane-grid{
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* GridPane */
|
|
||||||
.tab-pane-grid{
|
|
||||||
/*
|
|
||||||
* GridPane gridPane = new GridPane();
|
|
||||||
* gridPane.getStyleClass().add("tab-pane-grid");
|
|
||||||
* gridPane.setPadding(new Insets(3,0,0,0));
|
|
||||||
*/
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
-fx-background-insets: 3 0 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TextField */
|
|
||||||
.text-field{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-highlight-fill: #4e4e4e;
|
|
||||||
}
|
|
||||||
.text-field:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.text-field:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ComboBox */
|
|
||||||
.combo-box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-insets: 0 0 -1 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.combo-box .list-cell:selected{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.combo-box .list-cell:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.combo-box:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.combo-box:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.combo-box-base > .arrow-button {
|
|
||||||
-fx-padding: 0 6;
|
|
||||||
padding: 0 6;
|
|
||||||
}
|
|
||||||
.combo-box-base > .arrow-button > .arrow {
|
|
||||||
-fx-background-color: #555555;
|
|
||||||
background-color: #555555;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-padding: 2 4;
|
|
||||||
padding: 2 4;
|
|
||||||
-fx-shape: "M 0 0 H 7 L 3.5 4 z";
|
|
||||||
}
|
|
||||||
.combo-box .list-view{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-padding: 1;
|
|
||||||
padding: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ChoiceBox */
|
|
||||||
.choice-box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-insets: 0 0 -1 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.choice-box:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.choice-box:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ListCell */
|
|
||||||
.list-cell{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-min-height: 18;
|
|
||||||
min-height: 18;
|
|
||||||
-fx-pref-height: 18;
|
|
||||||
-fx-padding: 0 0 0 3;
|
|
||||||
padding: 0 0 0 3;
|
|
||||||
}
|
|
||||||
.list-cell:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.list-cell:pressed{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.list-cell:selected{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ListView */
|
|
||||||
.list-view{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-padding: 1;
|
|
||||||
padding: 1;
|
|
||||||
}
|
|
||||||
.list-view .scroll-bar{
|
|
||||||
-fx-background-insets: 0 -1 0 0;
|
|
||||||
}
|
|
||||||
.list-view .scroll-bar .thumb{
|
|
||||||
-fx-background-insets: 0 3 0 2;
|
|
||||||
}
|
|
||||||
.list-view:hover{
|
|
||||||
-fx-border-color: #3E3E40;
|
|
||||||
border-color: #3E3E40;
|
|
||||||
-fx-padding: 0;
|
|
||||||
padding: 0;
|
|
||||||
-fx-background-insets: 1 1 0 1;
|
|
||||||
}
|
|
||||||
.list-view:focused{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-padding: 0 0 1 0;
|
|
||||||
padding: 0 0 1 0;
|
|
||||||
-fx-background-insets: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Button */
|
|
||||||
.button{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-insets: 0 0 -1 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.button:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.button:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.button:pressed{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* CheckBox */
|
|
||||||
.check-box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-insets: 0 0 0 -1;
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.check-box > .box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-insets: 0 0 -1 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.check-box:focused > .box{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.check-box:hover > .box{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-background-insets: 0 0 1 0;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.check-box > .box > .mark{
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-shape: "M 9.97498 1.22334L 4.6983 9.09834 L 4.52164 9.09834 L 0 5.19331 L 1.27664 3.52165 L 4.255 6.08833 L 8.33331 1.52588e-005 L 9.97498 1.22334 Z " ;
|
|
||||||
}
|
|
||||||
.check-box:selected > .box > .mark{
|
|
||||||
-fx-background-color: #AFB1B3;
|
|
||||||
background-color: #AFB1B3;
|
|
||||||
}
|
|
||||||
.check-box:pressed > .box > .mark{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TextArea */
|
|
||||||
.text-area{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-highlight-fill: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.text-area:hover{
|
|
||||||
-fx-border-color: #3E3E40;
|
|
||||||
border-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.text-area:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.text-area .content{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.text-area .scroll-bar{
|
|
||||||
-fx-background-insets: 0 -0.5 0.5 0;
|
|
||||||
}
|
|
||||||
.text-area .scroll-bar .thumb{
|
|
||||||
-fx-background-insets: 0 2 0 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ScrollBar */
|
|
||||||
.scroll-bar{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #2A2A2C;
|
|
||||||
background-color: #2A2A2C;
|
|
||||||
}
|
|
||||||
.scroll-bar:vertical{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #2A2A2C;
|
|
||||||
background-color: #2A2A2C;
|
|
||||||
}
|
|
||||||
.scroll-bar > .decrement-button{
|
|
||||||
-fx-background-color: #2A2A2C;
|
|
||||||
background-color: #2A2A2C;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.scroll-bar .decrement-button,
|
|
||||||
.scroll-bar .increment-button{
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.scroll-bar .decrement-button:hover,
|
|
||||||
.scroll-bar .increment-button:hover{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.scroll-bar:vertical .increment-arrow,
|
|
||||||
.scroll-bar:vertical .decrement-arrow,
|
|
||||||
.scroll-bar:horizontal .increment-arrow,
|
|
||||||
.scroll-bar:horizontal .decrement-arrow{
|
|
||||||
-fx-shape : " ";
|
|
||||||
}
|
|
||||||
.scroll-bar:horizontal .thumb,
|
|
||||||
.scroll-bar:vertical .thumb {
|
|
||||||
-fx-background-color: #3D3D3D;
|
|
||||||
background-color: #3D3D3D;
|
|
||||||
-fx-background-radius : 0;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Menu */
|
|
||||||
.menu-bar {
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
}
|
|
||||||
.menu-bar .menu-button{
|
|
||||||
-fx-background: #4e4e4e;
|
|
||||||
background: #4e4e4e;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 20;
|
|
||||||
min-height: 20;
|
|
||||||
-fx-pref-height: 20;
|
|
||||||
-fx-padding: 0 5 0 5;
|
|
||||||
padding: 0 5 0 5;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.menu-item{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.menu-item:hover {
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.menu-item:pressed {
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.context-menu {
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-padding: 0 0 -1 0;
|
|
||||||
padding: 0 0 -1 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ProgressBar */
|
|
||||||
.progress-bar{
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.progress-bar .bar{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-padding: 3;
|
|
||||||
padding: 3;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
}
|
|
||||||
.progress-bar .track {
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Slider */
|
|
||||||
.slider{
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.slider .track{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-insets: 2 -2 1 0;
|
|
||||||
}
|
|
||||||
.slider .thumb{
|
|
||||||
-fx-background-color: #B1B1B1;
|
|
||||||
background-color: #B1B1B1;
|
|
||||||
-fx-background-radius: 6;
|
|
||||||
-fx-background-insets: 1 0 1 2;
|
|
||||||
-fx-border-radius: 6;
|
|
||||||
border-radius: 6;
|
|
||||||
-fx-border-insets: 1 0 1 2;
|
|
||||||
-fx-pref-width: 12;
|
|
||||||
-fx-pref-height: 12;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.slider:focused .thumb{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.slider .thumb:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.slider .thumb:pressed{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TreeView */
|
|
||||||
.tree-view .scroll-bar{
|
|
||||||
-fx-background-insets: 0 -1 0 0;
|
|
||||||
}
|
|
||||||
.tree-view .scroll-bar .thumb{
|
|
||||||
-fx-background-insets: 0 3 0 2;
|
|
||||||
}
|
|
||||||
.tree-view {
|
|
||||||
-fx-background-insets: 2;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-padding: 0 0 1 0;
|
|
||||||
padding: 0 0 1 0;
|
|
||||||
}
|
|
||||||
.tree-view:hover{
|
|
||||||
-fx-border-color: #3E3E40;
|
|
||||||
border-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.tree-view:focused {
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.tree-cell{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-pref-width: 20;
|
|
||||||
-fx-pref-height: 20;
|
|
||||||
-fx-padding: 1;
|
|
||||||
padding: 1;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.tree-cell:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.tree-cell:selected{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.tree-cell:pressed{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.tree-cell > .tree-disclosure-node > .arrow
|
|
||||||
{
|
|
||||||
-fx-background-color: #555555;
|
|
||||||
background-color: #555555;
|
|
||||||
}
|
|
||||||
.tree-cell:hover > .tree-disclosure-node > .arrow
|
|
||||||
{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Tab */
|
|
||||||
.tab-pane{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: transparent;
|
|
||||||
border-color: transparent;
|
|
||||||
-fx-background-insets: 25.5 0 0 0;
|
|
||||||
}
|
|
||||||
.tab{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 20;
|
|
||||||
min-height: 20;
|
|
||||||
-fx-pref-height: 20;
|
|
||||||
}
|
|
||||||
.tab:selected{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
|
|
||||||
-fx-border-color: transparent;
|
|
||||||
border-color: transparent;
|
|
||||||
}
|
|
||||||
.tab .tab-close-button {
|
|
||||||
-fx-shape: "M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z";
|
|
||||||
-fx-background-color: #AFB1B3;
|
|
||||||
background-color: #AFB1B3;
|
|
||||||
-fx-background-insets: 2;
|
|
||||||
-fx-margin: 0 0 -5 2;
|
|
||||||
margin: 0 0 -5 2;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.tab .tab-label {
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.tab-pane .tab-header-area .tab-header-background {
|
|
||||||
-fx-opacity: 0.0;
|
|
||||||
opacity: 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TitledPane */
|
|
||||||
.titled-pane{
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-label-padding: 0 0 -7 0;
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.titled-pane .title{
|
|
||||||
-fx-background-color: #3E3E42;
|
|
||||||
background-color: #3E3E42;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-pref-height: 14;
|
|
||||||
}
|
|
||||||
.titled-pane .content{
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
-fx-border-color: #3E3E42;
|
|
||||||
border-color: #3E3E42;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-border-width: 3 2 2 2;
|
|
||||||
border-width: 3 2 2 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TableView */
|
|
||||||
.table-view{
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-table-cell-border-color: #222222;
|
|
||||||
}
|
|
||||||
.table-view:focused{
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-insets: 1;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.table-view .column-header-background{
|
|
||||||
-fx-border-width: 0 0 1 0;
|
|
||||||
border-width: 0 0 1 0;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.table-view .column-header {
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
}
|
|
||||||
.table-view .column-resize-line {
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-pref-width: 1;
|
|
||||||
}
|
|
||||||
.table-row-cell{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-background-color: #AFB1B3;
|
|
||||||
-fx-margin: 1;
|
|
||||||
margin: 1;
|
|
||||||
}
|
|
||||||
.table-row-cell:hover {
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.table-row-cell:selected {
|
|
||||||
-fx-table-cell-border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.table-row-cell:pressed {
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.table-view .column-header .label {
|
|
||||||
-fx-alignment: center-left;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.table-view .filler {
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.table-view .column-drag-header{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Tooltip */
|
|
||||||
.tooltip{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-padding: 5;
|
|
||||||
padding: 5;
|
|
||||||
}
|
|
||||||
|
|
@ -1,729 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Author: Antonio Pelusi
|
|
||||||
* Website: https://www.antoniopelusi.com
|
|
||||||
* Source code: https://github.com/antoniopelusi/JavaFX-Dark-Theme
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
.root{
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Label */
|
|
||||||
.label{
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Pane */
|
|
||||||
.pane-grid{
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* GridPane */
|
|
||||||
.tab-pane-grid{
|
|
||||||
/*
|
|
||||||
* GridPane gridPane = new GridPane();
|
|
||||||
* gridPane.getStyleClass().add("tab-pane-grid");
|
|
||||||
* gridPane.setPadding(new Insets(3,0,0,0));
|
|
||||||
*/
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
-fx-background-insets: 3 0 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TextField */
|
|
||||||
.text-field{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-highlight-fill: #4e4e4e;
|
|
||||||
}
|
|
||||||
.text-field:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.text-field:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ComboBox */
|
|
||||||
.combo-box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-insets: 0 0 -1 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.combo-box .list-cell:selected{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.combo-box .list-cell:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.combo-box:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.combo-box:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.combo-box-base > .arrow-button {
|
|
||||||
-fx-padding: 0 6;
|
|
||||||
padding: 0 6;
|
|
||||||
}
|
|
||||||
.combo-box-base > .arrow-button > .arrow {
|
|
||||||
-fx-background-color: #555555;
|
|
||||||
background-color: #555555;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-padding: 2 4;
|
|
||||||
padding: 2 4;
|
|
||||||
-fx-shape: "M 0 0 H 7 L 3.5 4 z";
|
|
||||||
}
|
|
||||||
.combo-box .list-view{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-padding: 1;
|
|
||||||
padding: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ChoiceBox */
|
|
||||||
.choice-box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-insets: 0 0 -1 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.choice-box:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.choice-box:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ListCell */
|
|
||||||
.list-cell{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-min-height: 18;
|
|
||||||
min-height: 18;
|
|
||||||
-fx-pref-height: 18;
|
|
||||||
-fx-padding: 0 0 0 3;
|
|
||||||
padding: 0 0 0 3;
|
|
||||||
}
|
|
||||||
.list-cell:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.list-cell:pressed{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.list-cell:selected{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ListView */
|
|
||||||
.list-view{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-padding: 1;
|
|
||||||
padding: 1;
|
|
||||||
}
|
|
||||||
.list-view .scroll-bar{
|
|
||||||
-fx-background-insets: 0 -1 0 0;
|
|
||||||
}
|
|
||||||
.list-view .scroll-bar .thumb{
|
|
||||||
-fx-background-insets: 0 3 0 2;
|
|
||||||
}
|
|
||||||
.list-view:hover{
|
|
||||||
-fx-border-color: #3E3E40;
|
|
||||||
border-color: #3E3E40;
|
|
||||||
-fx-padding: 0;
|
|
||||||
padding: 0;
|
|
||||||
-fx-background-insets: 1 1 0 1;
|
|
||||||
}
|
|
||||||
.list-view:focused{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-padding: 0 0 1 0;
|
|
||||||
padding: 0 0 1 0;
|
|
||||||
-fx-background-insets: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Button */
|
|
||||||
.button{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-insets: 0 0 -1 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.button:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.button:hover{
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.button:pressed{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* CheckBox */
|
|
||||||
.check-box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-insets: 0 0 0 -1;
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 25;
|
|
||||||
min-height: 25;
|
|
||||||
-fx-pref-height: 25;
|
|
||||||
}
|
|
||||||
.check-box > .box{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-insets: 0 0 -1 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.check-box:focused > .box{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.check-box:hover > .box{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-background-insets: 0 0 1 0;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.check-box > .box > .mark{
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-shape: "M 9.97498 1.22334L 4.6983 9.09834 L 4.52164 9.09834 L 0 5.19331 L 1.27664 3.52165 L 4.255 6.08833 L 8.33331 1.52588e-005 L 9.97498 1.22334 Z " ;
|
|
||||||
}
|
|
||||||
.check-box:selected > .box > .mark{
|
|
||||||
-fx-background-color: #AFB1B3;
|
|
||||||
background-color: #AFB1B3;
|
|
||||||
}
|
|
||||||
.check-box:pressed > .box > .mark{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TextArea */
|
|
||||||
.text-area{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-highlight-fill: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.text-area:hover{
|
|
||||||
-fx-border-color: #3E3E40;
|
|
||||||
border-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.text-area:focused{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.text-area .content{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.text-area .scroll-bar{
|
|
||||||
-fx-background-insets: 0 -0.5 0.5 0;
|
|
||||||
}
|
|
||||||
.text-area .scroll-bar .thumb{
|
|
||||||
-fx-background-insets: 0 2 0 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ScrollBar */
|
|
||||||
.scroll-bar{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #2A2A2C;
|
|
||||||
background-color: #2A2A2C;
|
|
||||||
}
|
|
||||||
.scroll-bar:vertical{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #2A2A2C;
|
|
||||||
background-color: #2A2A2C;
|
|
||||||
}
|
|
||||||
.scroll-bar > .decrement-button{
|
|
||||||
-fx-background-color: #2A2A2C;
|
|
||||||
background-color: #2A2A2C;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.scroll-bar .decrement-button,
|
|
||||||
.scroll-bar .increment-button{
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.scroll-bar .decrement-button:hover,
|
|
||||||
.scroll-bar .increment-button:hover{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.scroll-bar:vertical .increment-arrow,
|
|
||||||
.scroll-bar:vertical .decrement-arrow,
|
|
||||||
.scroll-bar:horizontal .increment-arrow,
|
|
||||||
.scroll-bar:horizontal .decrement-arrow{
|
|
||||||
-fx-shape : " ";
|
|
||||||
}
|
|
||||||
.scroll-bar:horizontal .thumb,
|
|
||||||
.scroll-bar:vertical .thumb {
|
|
||||||
-fx-background-color: #3D3D3D;
|
|
||||||
background-color: #3D3D3D;
|
|
||||||
-fx-background-radius : 0;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Menu */
|
|
||||||
.menu-bar {
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
}
|
|
||||||
.menu-bar .menu-button{
|
|
||||||
-fx-background: #4e4e4e;
|
|
||||||
background: #4e4e4e;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 20;
|
|
||||||
min-height: 20;
|
|
||||||
-fx-pref-height: 20;
|
|
||||||
-fx-padding: 0 5 0 5;
|
|
||||||
padding: 0 5 0 5;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.menu-item{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.menu-item:hover {
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.menu-item:pressed {
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.context-menu {
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-padding: 0 0 -1 0;
|
|
||||||
padding: 0 0 -1 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ProgressBar */
|
|
||||||
.progress-bar{
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.progress-bar .bar{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-padding: 3;
|
|
||||||
padding: 3;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
}
|
|
||||||
.progress-bar .track {
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Slider */
|
|
||||||
.slider{
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.slider .track{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-insets: 2 -2 1 0;
|
|
||||||
}
|
|
||||||
.slider .thumb{
|
|
||||||
-fx-background-color: #B1B1B1;
|
|
||||||
background-color: #B1B1B1;
|
|
||||||
-fx-background-radius: 6;
|
|
||||||
-fx-background-insets: 1 0 1 2;
|
|
||||||
-fx-border-radius: 6;
|
|
||||||
border-radius: 6;
|
|
||||||
-fx-border-insets: 1 0 1 2;
|
|
||||||
-fx-pref-width: 12;
|
|
||||||
-fx-pref-height: 12;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.slider:focused .thumb{
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.slider .thumb:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.slider .thumb:pressed{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TreeView */
|
|
||||||
.tree-view .scroll-bar{
|
|
||||||
-fx-background-insets: 0 -1 0 0;
|
|
||||||
}
|
|
||||||
.tree-view .scroll-bar .thumb{
|
|
||||||
-fx-background-insets: 0 3 0 2;
|
|
||||||
}
|
|
||||||
.tree-view {
|
|
||||||
-fx-background-insets: 2;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-padding: 0 0 1 0;
|
|
||||||
padding: 0 0 1 0;
|
|
||||||
}
|
|
||||||
.tree-view:hover{
|
|
||||||
-fx-border-color: #3E3E40;
|
|
||||||
border-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.tree-view:focused {
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.tree-cell{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-pref-width: 20;
|
|
||||||
-fx-pref-height: 20;
|
|
||||||
-fx-padding: 1;
|
|
||||||
padding: 1;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.tree-cell:hover{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.tree-cell:selected{
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
}
|
|
||||||
.tree-cell:pressed{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.tree-cell > .tree-disclosure-node > .arrow
|
|
||||||
{
|
|
||||||
-fx-background-color: #555555;
|
|
||||||
background-color: #555555;
|
|
||||||
}
|
|
||||||
.tree-cell:hover > .tree-disclosure-node > .arrow
|
|
||||||
{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Tab */
|
|
||||||
.tab-pane{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-color: transparent;
|
|
||||||
border-color: transparent;
|
|
||||||
-fx-background-insets: 25.5 0 0 0;
|
|
||||||
}
|
|
||||||
.tab{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-min-height: 20;
|
|
||||||
min-height: 20;
|
|
||||||
-fx-pref-height: 20;
|
|
||||||
}
|
|
||||||
.tab:selected{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
|
|
||||||
-fx-border-color: transparent;
|
|
||||||
border-color: transparent;
|
|
||||||
}
|
|
||||||
.tab .tab-close-button {
|
|
||||||
-fx-shape: "M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z";
|
|
||||||
-fx-background-color: #AFB1B3;
|
|
||||||
background-color: #AFB1B3;
|
|
||||||
-fx-background-insets: 2;
|
|
||||||
-fx-margin: 0 0 -5 2;
|
|
||||||
margin: 0 0 -5 2;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.tab .tab-label {
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.tab-pane .tab-header-area .tab-header-background {
|
|
||||||
-fx-opacity: 0.0;
|
|
||||||
opacity: 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TitledPane */
|
|
||||||
.titled-pane{
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-label-padding: 0 0 -7 0;
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.titled-pane .title{
|
|
||||||
-fx-background-color: #3E3E42;
|
|
||||||
background-color: #3E3E42;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-width: 0;
|
|
||||||
border-width: 0;
|
|
||||||
-fx-pref-height: 14;
|
|
||||||
}
|
|
||||||
.titled-pane .content{
|
|
||||||
-fx-background-color: #2D2D30;
|
|
||||||
background-color: #2D2D30;
|
|
||||||
-fx-border-color: #3E3E42;
|
|
||||||
border-color: #3E3E42;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-border-width: 3 2 2 2;
|
|
||||||
border-width: 3 2 2 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TableView */
|
|
||||||
.table-view{
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-table-cell-border-color: #222222;
|
|
||||||
}
|
|
||||||
.table-view:focused{
|
|
||||||
-fx-border-width: 1;
|
|
||||||
border-width: 1;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-border-color: #4e4e4e;
|
|
||||||
border-color: #4e4e4e;
|
|
||||||
-fx-background-insets: 1;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
}
|
|
||||||
.table-view .column-header-background{
|
|
||||||
-fx-border-width: 0 0 1 0;
|
|
||||||
border-width: 0 0 1 0;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
}
|
|
||||||
.table-view .column-header {
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
-fx-border-color: #222222;
|
|
||||||
border-color: #222222;
|
|
||||||
}
|
|
||||||
.table-view .column-resize-line {
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-pref-width: 1;
|
|
||||||
}
|
|
||||||
.table-row-cell{
|
|
||||||
-fx-background-color: #1A1A1A;
|
|
||||||
background-color: #1A1A1A;
|
|
||||||
-fx-text-background-color: #AFB1B3;
|
|
||||||
-fx-margin: 1;
|
|
||||||
margin: 1;
|
|
||||||
}
|
|
||||||
.table-row-cell:hover {
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.table-row-cell:selected {
|
|
||||||
-fx-table-cell-border-color: #222222;
|
|
||||||
-fx-background-color: #3E3E40;
|
|
||||||
background-color: #3E3E40;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.table-row-cell:pressed {
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
-fx-background-insets: 0;
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
}
|
|
||||||
.table-view .column-header .label {
|
|
||||||
-fx-alignment: center-left;
|
|
||||||
-fx-cursor: HAND;
|
|
||||||
cursor: HAND;
|
|
||||||
}
|
|
||||||
.table-view .filler {
|
|
||||||
-fx-background-color: transparent;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.table-view .column-drag-header{
|
|
||||||
-fx-background-color: #4e4e4e;
|
|
||||||
background-color: #4e4e4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Tooltip */
|
|
||||||
.tooltip{
|
|
||||||
-fx-background-radius: 0;
|
|
||||||
-fx-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
-fx-text-fill: #AFB1B3;
|
|
||||||
-fx-padding: 5;
|
|
||||||
padding: 5;
|
|
||||||
}
|
|
||||||
|
|
@ -1,382 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<profiles version="20">
|
|
||||||
<profile kind="CodeFormatterProfile" name="JavaConventions" version="20">
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_record_components" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="8"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_never"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="0"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="mixed"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/Java/hcloudclient/.vscode/java-formatter.xml","entries":[{"id":"LKSK.xml","source":"Workspace Edit","timestamp":1720853681978}]}
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
package com.rutils;
|
|
||||||
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.Scene;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.Label;
|
|
||||||
import javafx.scene.control.PasswordField;
|
|
||||||
import javafx.scene.control.TextField;
|
|
||||||
import javafx.scene.layout.Region;
|
|
||||||
import javafx.scene.layout.VBox;
|
|
||||||
import javafx.scene.text.Font;
|
|
||||||
|
|
||||||
public class Scenes{
|
|
||||||
|
|
||||||
public static void createRegisterScene(){
|
|
||||||
VBox root = new VBox();
|
|
||||||
Scene scene = new Scene(root);
|
|
||||||
|
|
||||||
root.requestFocus();
|
|
||||||
root.setAlignment(Pos.CENTER);
|
|
||||||
root.setSpacing(25);
|
|
||||||
root.minWidthProperty().bind(stage.widthProperty());
|
|
||||||
root.minHeightProperty().bind(stage.heightProperty());
|
|
||||||
|
|
||||||
Label label = new Label("Sign Up");
|
|
||||||
label.setFont(new Font(40));
|
|
||||||
|
|
||||||
Region spcr1 = new Region();
|
|
||||||
spcr1.setPrefHeight(20);
|
|
||||||
|
|
||||||
TextField username = new TextField();
|
|
||||||
username.setPromptText("username");
|
|
||||||
username.setFont(new Font(20));
|
|
||||||
username.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
username.setPrefHeight(50);
|
|
||||||
|
|
||||||
PasswordField password = new PasswordField();
|
|
||||||
password.setPromptText("password");
|
|
||||||
password.setFont(new Font(20));
|
|
||||||
password.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
password.setPrefHeight(50);
|
|
||||||
|
|
||||||
PasswordField passwordAgain = new PasswordField();
|
|
||||||
passwordAgain.setPromptText("confirm password");
|
|
||||||
passwordAgain.setFont(new Font(20));
|
|
||||||
passwordAgain.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
passwordAgain.setPrefHeight(50);
|
|
||||||
|
|
||||||
Label info = new Label();
|
|
||||||
info.setPrefHeight(20);
|
|
||||||
info.setStyle("-fx-text-fill: red;");
|
|
||||||
|
|
||||||
Button signup = new Button("Sign Up");
|
|
||||||
signup.setFont(new Font(20));
|
|
||||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
signup.setPrefHeight(50);
|
|
||||||
signup.setOnAction(e -> handleRegister(username, password, passwordAgain, info));
|
|
||||||
|
|
||||||
Label or = new Label("OR");
|
|
||||||
or.setFont(new Font(30));
|
|
||||||
|
|
||||||
Button login = new Button("Login Instead");
|
|
||||||
login.setFont(new Font(20));
|
|
||||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
login.setPrefHeight(50);
|
|
||||||
login.setOnAction(e -> stage.setScene(loginScene));
|
|
||||||
|
|
||||||
root.getChildren().addAll(label, spcr1, username, password, passwordAgain, info, signup, or, login);
|
|
||||||
return scene;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
package com.rutils;
|
|
||||||
|
|
||||||
public class Scenes{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/Java/hcloudclient/src/main/java/com/rutils/Scenes.java","entries":[{"id":"7L0b.java","timestamp":1721298508805},{"id":"xQCB.java","timestamp":1721298533641},{"id":"4TJu.java","source":"Add all missing imports","timestamp":1721298543798}]}
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
package com.rutils;
|
|
||||||
|
|
||||||
public class Scenes{
|
|
||||||
|
|
||||||
public static void createRegisterScene(){
|
|
||||||
VBox root = new VBox();
|
|
||||||
Scene scene = new Scene(root);
|
|
||||||
|
|
||||||
root.requestFocus();
|
|
||||||
root.setAlignment(Pos.CENTER);
|
|
||||||
root.setSpacing(25);
|
|
||||||
root.minWidthProperty().bind(stage.widthProperty());
|
|
||||||
root.minHeightProperty().bind(stage.heightProperty());
|
|
||||||
|
|
||||||
Label label = new Label("Sign Up");
|
|
||||||
label.setFont(new Font(40));
|
|
||||||
|
|
||||||
Region spcr1 = new Region();
|
|
||||||
spcr1.setPrefHeight(20);
|
|
||||||
|
|
||||||
TextField username = new TextField();
|
|
||||||
username.setPromptText("username");
|
|
||||||
username.setFont(new Font(20));
|
|
||||||
username.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
username.setPrefHeight(50);
|
|
||||||
|
|
||||||
PasswordField password = new PasswordField();
|
|
||||||
password.setPromptText("password");
|
|
||||||
password.setFont(new Font(20));
|
|
||||||
password.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
password.setPrefHeight(50);
|
|
||||||
|
|
||||||
PasswordField passwordAgain = new PasswordField();
|
|
||||||
passwordAgain.setPromptText("confirm password");
|
|
||||||
passwordAgain.setFont(new Font(20));
|
|
||||||
passwordAgain.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
passwordAgain.setPrefHeight(50);
|
|
||||||
|
|
||||||
Label info = new Label();
|
|
||||||
info.setPrefHeight(20);
|
|
||||||
info.setStyle("-fx-text-fill: red;");
|
|
||||||
|
|
||||||
Button signup = new Button("Sign Up");
|
|
||||||
signup.setFont(new Font(20));
|
|
||||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
signup.setPrefHeight(50);
|
|
||||||
signup.setOnAction(e -> handleRegister(username, password, passwordAgain, info));
|
|
||||||
|
|
||||||
Label or = new Label("OR");
|
|
||||||
or.setFont(new Font(30));
|
|
||||||
|
|
||||||
Button login = new Button("Login Instead");
|
|
||||||
login.setFont(new Font(20));
|
|
||||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
|
||||||
login.setPrefHeight(50);
|
|
||||||
login.setOnAction(e -> stage.setScene(loginScene));
|
|
||||||
|
|
||||||
root.getChildren().addAll(label, spcr1, username, password, passwordAgain, info, signup, or, login);
|
|
||||||
return scene;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.getChildren().add(tt);
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,88 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
ttTabs.play();
|
|
||||||
ttTabs.setOnFinished(ev -> {
|
|
||||||
index.incrementAndGet();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.getChildren().add(tt);
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
ttTabs.play();
|
|
||||||
ttTabs.setOnFinished(ev -> {
|
|
||||||
index.incrementAndGet();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
ttTabs.play();
|
|
||||||
ttTabs.setOnFinished(ev -> {
|
|
||||||
index.incrementAndGet();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
ttTabs.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.getChildren().add(tt);
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
tab.shrink();
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.getChildren().add(tt);
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.getChildren().add(tt);
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
for(int i=index.get();i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getNodes().get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.getChildren().add(tt);
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
// ParallelTransition pt = new ParallelTransition();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
ttTabs.play();
|
|
||||||
ttTabs.setOnFinished(ev -> {
|
|
||||||
index.incrementAndGet();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.play();
|
|
||||||
// pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
ttTabs.play();
|
|
||||||
ttTabs.setOnFinished(ev -> {
|
|
||||||
index.incrementAndGet();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
tab.shrink();
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.getChildren().add(tt);
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
// ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
// tt.setByX(-155);
|
|
||||||
// for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
// pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
// ((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
tab.shrink();
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
for(int i=index.get();i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
ttTabs.play();
|
|
||||||
ttTabs.setOnFinished(ev -> {
|
|
||||||
index.incrementAndGet();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
// ((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/JBrowse/jbrowse/src/main/java/com/jb/TabButton.java","entries":[{"id":"cEog.java","timestamp":1713589737414},{"id":"3Dy7.java","timestamp":1713589751217},{"id":"5MgE.java","timestamp":1713589847691},{"id":"9UzD.java","timestamp":1713589945458},{"id":"VM8K.java","timestamp":1713589959418},{"id":"yPmE.java","timestamp":1713590061249},{"id":"fl24.java","timestamp":1713591913239},{"id":"RMfP.java","timestamp":1713592001222},{"id":"nf2J.java","timestamp":1713781581300},{"id":"cWkE.java","timestamp":1713781602354},{"id":"VRWR.java","source":"Import 'ParallelTransition' (javafx.animation)","timestamp":1713781607847},{"id":"c7F9.java","timestamp":1713781649038},{"id":"JRQb.java","timestamp":1713781666909},{"id":"sKrq.java","timestamp":1713781684869},{"id":"jeRu.java","timestamp":1713781696553},{"id":"0mRF.java","timestamp":1713782010233},{"id":"004C.java","timestamp":1713782977838},{"id":"ODPd.java","timestamp":1713783039422},{"id":"3v5W.java","timestamp":1713783144182},{"id":"IFxT.java","timestamp":1713783320466},{"id":"DY10.java","timestamp":1713783331853},{"id":"EOJH.java","timestamp":1713783372560},{"id":"Zwza.java","timestamp":1713783421333},{"id":"4fVm.java","timestamp":1713783451470},{"id":"xUYa.java","timestamp":1713783523337},{"id":"3Gha.java","timestamp":1713783550391},{"id":"Eg02.java","timestamp":1713783632838},{"id":"FtFe.java","timestamp":1713789651042},{"id":"gXId.java","timestamp":1713789674861},{"id":"gAaY.java","timestamp":1713789688441},{"id":"pAn4.java","timestamp":1713789740113},{"id":"bQe8.java","timestamp":1713789761655},{"id":"ZO5D.java","timestamp":1713789873687},{"id":"E4xn.java","timestamp":1713789888551},{"id":"bhTm.java","timestamp":1713790139862},{"id":"dpGI.java","timestamp":1713790181619},{"id":"JDH2.java","timestamp":1713790215438},{"id":"5PTH.java","timestamp":1713790248319},{"id":"q5gM.java","source":"Workspace Edit","timestamp":1713790432851},{"id":"jC5p.java","timestamp":1713834289919},{"id":"KZQp.java","timestamp":1713834308931},{"id":"4DaJ.java","timestamp":1713834320908},{"id":"eRrv.java","timestamp":1713834350590},{"id":"KVIZ.java","timestamp":1713834394746},{"id":"ThiM.java","timestamp":1713953194310},{"id":"0KG0.java","timestamp":1713955804099},{"id":"YMpI.java","timestamp":1713956236909},{"id":"qK5q.java","timestamp":1713956252241},{"id":"4tD7.java","timestamp":1713957991559},{"id":"8M4F.java","timestamp":1713958014969}]}
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
// ParallelTransition pt = new ParallelTransition();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
ttTabs.play();
|
|
||||||
ttTabs.setOnFinished(ev -> {
|
|
||||||
index.incrementAndGet();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.play();
|
|
||||||
// pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
tab.shrink();
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
tab.shrink();
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
// @SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
for(int i=index.get();i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ParallelTransition pt = new ParallelTransition();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
tab.shrink();
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else Main.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
// TODO: fix the animation for right most tab closing
|
|
||||||
|
|
||||||
// ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
// tt.setByX(-155);
|
|
||||||
// for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
tt.play();
|
|
||||||
// pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(JBrowse.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(JBrowse.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
int index = JBrowse.getTabs().indexOf(tab);
|
|
||||||
JBrowse.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<JBrowse.getNoOfTabs()) JBrowse.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
else JBrowse.getTabs().get(index-1).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), JBrowse.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<JBrowse.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), JBrowse.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tab.shrink();
|
|
||||||
tt.play();
|
|
||||||
pt.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,85 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
for(int i=index.get();i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getNodes().get(0));
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getTabButton(), tab.getStackPane());
|
|
||||||
int index = Main.getTabs().indexOf(tab);
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
|
|
||||||
if(index<Main.getNoOfTabs()) Main.getTabs().get(index).getTabButton().toggleButton.setSelected(true);
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
for(int i=index;i<Main.getNoOfTabs();i++){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(i).getTabButton());
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
pt.play();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.setByX(-155);
|
|
||||||
// ttTabs.play();
|
|
||||||
// ttTabs.setOnFinished(ev -> {
|
|
||||||
// index.incrementAndGet();
|
|
||||||
// if(index.get()<Main.getNoOfTabs()){
|
|
||||||
// ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
// ttTabs.play();
|
|
||||||
// // pt.getChildren().add(ttTabs);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
package com.jb;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import javafx.animation.ParallelTransition;
|
|
||||||
import javafx.animation.TranslateTransition;
|
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.ToggleButton;
|
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.util.Duration;
|
|
||||||
|
|
||||||
public class TabButton extends StackPane{
|
|
||||||
|
|
||||||
private ToggleButton toggleButton;
|
|
||||||
private Button closeBtn;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private BrowserTab tab;
|
|
||||||
|
|
||||||
public TabButton(BrowserTab tab){
|
|
||||||
toggleButton = new ToggleButton("Home");
|
|
||||||
closeBtn = new Button("");
|
|
||||||
this.tab = tab;
|
|
||||||
|
|
||||||
this.setId("tab-button-container");
|
|
||||||
toggleButton.setId("tab-button");
|
|
||||||
closeBtn.setId("tab-close-button");
|
|
||||||
|
|
||||||
toggleButton.setSelected(true);
|
|
||||||
toggleButton.setToggleGroup(Main.getToggleGroup());
|
|
||||||
closeBtn.setTranslateX(120);
|
|
||||||
|
|
||||||
StackPane.setAlignment(toggleButton, Pos.TOP_LEFT);
|
|
||||||
StackPane.setAlignment(closeBtn, Pos.TOP_LEFT);
|
|
||||||
|
|
||||||
this.getChildren().addAll(toggleButton, closeBtn);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toggleButton.setOnAction(e -> {
|
|
||||||
if(!toggleButton.isSelected()) toggleButton.setSelected(true);
|
|
||||||
tab.bringToFront();
|
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.setOnAction(e -> {
|
|
||||||
if(Main.getNoOfTabs() == 1) ((Stage)this.getScene().getWindow()).close();
|
|
||||||
else{
|
|
||||||
((StackPane)(this.getScene().getRoot())).getChildren().removeAll(tab.getNodes());
|
|
||||||
AtomicInteger index = new AtomicInteger(Main.getTabs().indexOf(tab));
|
|
||||||
Main.getTabs().remove(tab);
|
|
||||||
TranslateTransition tt = new TranslateTransition(new Duration(250), Main.getNewTabBtn());
|
|
||||||
tt.setByX(-155);
|
|
||||||
tt.play();
|
|
||||||
tab.shrink();
|
|
||||||
|
|
||||||
ParallelTransition pt = new ParallelTransition();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
TranslateTransition ttTabs = new TranslateTransition(new Duration(250), Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.setByX(-155);
|
|
||||||
ttTabs.play();
|
|
||||||
ttTabs.setOnFinished(ev -> {
|
|
||||||
index.incrementAndGet();
|
|
||||||
if(index.get()<Main.getNoOfTabs()){
|
|
||||||
ttTabs.setNode(Main.getTabs().get(index.get()).getNodes().get(0));
|
|
||||||
ttTabs.play();
|
|
||||||
pt.getChildren().add(ttTabs);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
package com.rutils;
|
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
import java.net.http.HttpClient;
|
|
||||||
import java.net.http.HttpRequest;
|
|
||||||
import java.net.http.HttpResponse;
|
|
||||||
import java.net.http.HttpResponse.BodyHandlers;
|
|
||||||
import java.security.KeyStore;
|
|
||||||
|
|
||||||
import javax.net.ssl.SSLContext;
|
|
||||||
import javax.net.ssl.TrustManagerFactory;
|
|
||||||
|
|
||||||
|
|
||||||
public class Main{
|
|
||||||
public static void main(String[] args){
|
|
||||||
|
|
||||||
try{
|
|
||||||
KeyStore keyStore = KeyStore.getInstance("PKCS12");
|
|
||||||
keyStore.load(Main.class.getClassLoader().getResourceAsStream("ksclient.p12"), "ksclient7548".toCharArray());
|
|
||||||
|
|
||||||
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
|
||||||
tmf.init(keyStore);
|
|
||||||
|
|
||||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
|
||||||
sslContext.init(null, tmf.getTrustManagers(), null);
|
|
||||||
|
|
||||||
HttpClient client = HttpClient.newBuilder()
|
|
||||||
.sslContext(sslContext)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
HttpRequest request = HttpRequest.newBuilder().uri(new URI("https://localhost:8000/greet")).build();
|
|
||||||
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
|
|
||||||
System.out.println(response.statusCode());
|
|
||||||
System.out.println(response.body());
|
|
||||||
}
|
|
||||||
catch(Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
package com.rutils;
|
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
import java.net.http.HttpClient;
|
|
||||||
import java.net.http.HttpRequest;
|
|
||||||
import java.net.http.HttpResponse;
|
|
||||||
|
|
||||||
|
|
||||||
public class Main{
|
|
||||||
public static void main(String[] args){
|
|
||||||
|
|
||||||
try{
|
|
||||||
HttpClient client = HttpClient.newBuilder().build();
|
|
||||||
|
|
||||||
HttpRequest request = HttpRequest.newBuilder().uri(new URI("https://localhost:8000/greet")).build();
|
|
||||||
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
|
|
||||||
System.out.println(response.body());
|
|
||||||
}
|
|
||||||
catch(Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
package com.rutils;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URI;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.net.http.HttpClient;
|
|
||||||
import java.net.http.HttpRequest;
|
|
||||||
import java.net.http.HttpResponse;
|
|
||||||
|
|
||||||
|
|
||||||
public class Main{
|
|
||||||
public static void main(String[] args){
|
|
||||||
|
|
||||||
HttpClient client = HttpClient.newHttpClient();
|
|
||||||
try{
|
|
||||||
HttpRequest request = HttpRequest.newBuilder().uri(new URI("https://localhost:8000/greet")).build();
|
|
||||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
|
||||||
System.out.println(response.body());
|
|
||||||
}
|
|
||||||
catch(URISyntaxException e){
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
catch (IOException e){
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
catch (InterruptedException e){
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
package com.rutils;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URI;
|
|
||||||
import java.net.http.HttpClient;
|
|
||||||
import java.net.http.HttpRequest;
|
|
||||||
import java.net.http.HttpResponse;
|
|
||||||
import java.security.KeyStore;
|
|
||||||
import java.security.cert.CertificateFactory;
|
|
||||||
import java.security.cert.X509Certificate;
|
|
||||||
|
|
||||||
|
|
||||||
public class Main{
|
|
||||||
public static void main(String[] args){
|
|
||||||
|
|
||||||
HttpClient client = HttpClient.newHttpClient();
|
|
||||||
try{
|
|
||||||
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
|
||||||
InputStream certInputStream = Main.class.getResourceAsStream("/mycertificate.crt");
|
|
||||||
X509Certificate caCert = (X509Certificate)cf.generateCertificate(certInputStream);
|
|
||||||
|
|
||||||
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
|
|
||||||
keyStore.load(null, null);
|
|
||||||
keyStore.setCertificateEntry("mycertificate", caCert);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HttpRequest request = HttpRequest.newBuilder().uri(new URI("https://localhost:8000/greet")).build();
|
|
||||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
|
||||||
System.out.println(response.body());
|
|
||||||
}
|
|
||||||
catch(Exception e){}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
package com.rutils;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URI;
|
|
||||||
import java.net.http.HttpClient;
|
|
||||||
import java.net.http.HttpRequest;
|
|
||||||
import java.net.http.HttpResponse;
|
|
||||||
import java.security.KeyStore;
|
|
||||||
import java.security.cert.CertificateFactory;
|
|
||||||
import java.security.cert.X509Certificate;
|
|
||||||
|
|
||||||
import javax.net.ssl.SSLContext;
|
|
||||||
import javax.net.ssl.TrustManagerFactory;
|
|
||||||
|
|
||||||
|
|
||||||
public class Main{
|
|
||||||
public static void main(String[] args){
|
|
||||||
|
|
||||||
try{
|
|
||||||
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
|
||||||
InputStream certInputStream = Main.class.getResourceAsStream("/mycertificate.crt");
|
|
||||||
X509Certificate caCert = (X509Certificate)cf.generateCertificate(certInputStream);
|
|
||||||
|
|
||||||
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
|
|
||||||
keyStore.load(null, null);
|
|
||||||
keyStore.setCertificateEntry("mycertificate", caCert);
|
|
||||||
|
|
||||||
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
|
||||||
tmf.init(keyStore);
|
|
||||||
|
|
||||||
SSLContext context = SSLContext.getInstance("TLS");
|
|
||||||
context.init(null, tmf.getTrustManagers(), null);
|
|
||||||
|
|
||||||
HttpClient client = HttpClient.newBuilder().sslContext(context).build();
|
|
||||||
|
|
||||||
HttpRequest request = HttpRequest.newBuilder().uri(new URI("https://localhost:8000/greet")).build();
|
|
||||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
|
||||||
System.out.println(response.body());
|
|
||||||
}
|
|
||||||
catch(Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue