2017-06-16 23:35:56 +02:00
/ * *
2017-10-15 13:37:45 +02:00
* cemu_UI
*
2018-04-28 12:17:12 +02:00
* Copyright 2017 - 2018 < @Seil0 >
2017-10-15 13:37:45 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston ,
* MA 02110 - 1301 , USA .
2017-06-16 23:35:56 +02:00
* /
2017-11-13 16:44:39 +01:00
package com.cemu_UI.datatypes ;
2017-04-06 12:00:36 +02:00
2019-05-15 16:39:00 +02:00
import java.io.File ;
2017-04-06 12:00:36 +02:00
import com.jfoenix.controls.JFXButton ;
2019-05-15 16:19:31 +02:00
import javafx.geometry.Insets ;
2019-05-15 16:39:00 +02:00
import javafx.scene.control.ContextMenu ;
2017-04-06 12:00:36 +02:00
import javafx.scene.control.Label ;
2019-05-15 16:39:00 +02:00
import javafx.scene.image.Image ;
2017-10-14 15:42:13 +02:00
import javafx.scene.image.ImageView ;
2017-04-06 12:00:36 +02:00
import javafx.scene.layout.VBox ;
2019-05-15 16:19:31 +02:00
import javafx.scene.text.Font ;
import javafx.scene.text.FontWeight ;
2017-04-06 12:00:36 +02:00
2019-05-15 16:19:31 +02:00
public class UIROMDataType extends VBox {
private String titleID ;
private String romPath ;
private Label label = new Label ( ) ;
private JFXButton button = new JFXButton ( ) ;
private ImageView imageView = new ImageView ( ) ;
2019-05-15 16:39:00 +02:00
public UIROMDataType ( String text , String coverPath , ContextMenu contextMenu ) {
this ( ) ;
label . setText ( text ) ;
imageView . setImage ( new Image ( new File ( coverPath ) . toURI ( ) . toString ( ) ) ) ;
button . setContextMenu ( contextMenu ) ;
}
2019-05-15 16:19:31 +02:00
public UIROMDataType ( ) {
super . getChildren ( ) . addAll ( label , button ) ;
label . setMaxWidth ( 200 ) ;
label . setPadding ( new Insets ( 0 , 0 , 0 , 8 ) ) ;
label . setFont ( Font . font ( " System " , FontWeight . BOLD , 14 ) ) ;
imageView . setFitHeight ( 300 ) ;
imageView . setFitWidth ( 200 ) ;
button . setStyle ( " -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 3); " ) ;
button . setGraphic ( imageView ) ;
}
2017-06-16 23:35:56 +02:00
2019-05-15 16:19:31 +02:00
public String getTitleID ( ) {
return titleID ;
2017-04-06 12:00:36 +02:00
}
2019-05-15 16:19:31 +02:00
public String getRomPath ( ) {
return romPath ;
2017-04-06 12:00:36 +02:00
}
2019-05-15 16:19:31 +02:00
public Label getLabel ( ) {
2017-04-06 12:00:36 +02:00
return label ;
}
2019-05-15 16:19:31 +02:00
public JFXButton getButton ( ) {
2017-04-06 12:00:36 +02:00
return button ;
}
2019-05-15 16:19:31 +02:00
public ImageView getImageView ( ) {
2017-10-14 15:42:13 +02:00
return imageView ;
}
2019-05-15 16:19:31 +02:00
public void setTitleID ( String titleID ) {
this . titleID = titleID ;
2017-04-06 12:00:36 +02:00
}
2019-05-15 16:19:31 +02:00
public void setRomPath ( String romPath ) {
this . romPath = romPath ;
2017-04-06 12:00:36 +02:00
}
2019-05-15 16:19:31 +02:00
public void setLabel ( Label label ) {
this . label = label ;
2017-04-06 12:00:36 +02:00
}
2019-05-15 16:19:31 +02:00
public void setButton ( JFXButton button ) {
this . button = button ;
2017-10-14 15:42:13 +02:00
}
2019-05-15 16:19:31 +02:00
public void setImageView ( ImageView imageView ) {
this . imageView = imageView ;
2017-04-06 12:00:36 +02:00
}
}