-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
22 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
src/main/java/armameeldoparti/utils/common/custom/graphical/CustomBorderedLabel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package armameeldoparti.utils.common.custom.graphical; | ||
|
||
import javax.swing.BorderFactory; | ||
import javax.swing.JLabel; | ||
|
||
/** | ||
* Custom label class. | ||
* | ||
* <p>This class is used to instantiate a custom label that fits the overall program | ||
* aesthetics. | ||
* | ||
* @author Bonino, Francisco Ignacio. | ||
* | ||
* @version 0.0.1 | ||
* | ||
* @since v3.0 | ||
*/ | ||
public class CustomBorderedLabel extends JLabel { | ||
|
||
// ---------------------------------------- Constructors -------------------------------------- | ||
|
||
/** | ||
* Builds a basic empty label using the established program aesthetics. | ||
* | ||
* @param alignment The text alignment. | ||
*/ | ||
public CustomBorderedLabel(int alignment) { | ||
super(); | ||
setupGraphicalProperties(alignment); | ||
} | ||
|
||
/** | ||
* Builds a basic label using the established program aesthetics. | ||
* | ||
* @param text The label text. | ||
* @param alignment The text alignment. | ||
*/ | ||
public CustomBorderedLabel(String text, int alignment) { | ||
super(text); | ||
setupGraphicalProperties(alignment); | ||
} | ||
|
||
// ---------------------------------------- Private methods ----------------------------------- | ||
|
||
/** | ||
* Configures the graphical properties of the label in order to fit the program aesthetics. | ||
* | ||
* @param alignment The text alignment. | ||
*/ | ||
private void setupGraphicalProperties(int alignment) { | ||
setBorder(BorderFactory.createLoweredSoftBevelBorder()); | ||
setHorizontalAlignment(alignment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters