Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.
/ lib-tile-demo Public archive

This project is a demonstration application to show the features from the project Lib-Tile with it's included sublibraries.

License

Notifications You must be signed in to change notification settings

Naoghuman/lib-tile-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

68 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Lib-Tile-Demo

Intention

This project is a demonstration application to show the features from the project Lib-Tile and it's included sublibraries lib-tile-core, lib-tile-transparenttextures and lib-tile-transparenttextures-images.

Background: Winter sunset shinning through the trees (Earth / Sunbeam)
Tile: Blu Stripes made by Seb Jachec
demo-application-modified.png

Hint
The background image is taken from https://wall.alphacoders.com/big.php?i=723891 and is under the license from CCO Public Domain Image. Big thanks to the autor for his great work πŸ˜ƒ.
The tile image is taken from https://www.transparenttextures.com/ and is free to use. Big thanks to the autor for his great work πŸ˜ƒ.

The current version is 0.2.0 from 08.27.2016.

The demo application is build with the Project-Template-afterburnerfx-Naoghuman from my project Project-Templates.

Description:
Project-Templates contains predefined JavaFX & Maven projects with afterburner.fx and optional my own libraries. For example: Lib-Action, Lib-Logger and more.

Please have a look for more information in the project README Project-Templates.

Content

Demonstration

Like I said in the section Intention this application is a demonstration to show the features from the project Lib-Tile and it's included sublibraries lib-tile-core, lib-tile-transparenttextures and lib-tile-transparenttextures-images.

Project Lib-Tile

Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE 8.0.2 and provides the functionalities to use and handle easily Tiles in your JavaFX application.

A Tile is per definition a little transparent Image which overlay a background-color or -image with the help of repetitions from the image in a layer.


_Image:_ Crimson Night (Dark / Landscape) with different tile images

Hint
Normally only one Tile can shown simultaneously. For demonstration purpose I have merge different Tiles in one picture.

different-tile-images.png

Hint
This image is from the webpage https://wall.alphacoders.com. The image haven't neither a created by or shared by flag (see http://alphacoders.com/site/faq ). If anyone is the autor and won't that I use this image here in my open souce project plz send me an email (see Contact) and I will remove it. Thanks for your great work πŸ˜ƒ.

For more information plz see Lib-Tile.

Library Lib-Tile-Core

The library Lib-Tile-Core provides the main functionalities to load a Tile as a Background or an Image with a concrete implementation from the interface AbstractTileLoader.

For more informations and examples plz see Lib-Tile-Core.

Library Lib-Tile-TransparentTextures

With the library Lib-Tile-TransparentTextures the developer have access to the tileset Transparent Textures from the internet page https://www.transparenttextures.com/ through the enum TransparentTexturesTile. Momentary that are 396 Tiles.

The tile images from this tileset are outsourced in a own library Lib-Tile-TransparentTextures-Images to reduce the size from this library. One more advance is that you can use an own AbstractTileLoader in combination with the library Lib-Tile-TransparentTextures. So you don't need to include the library Lib-Tile-TransparentTextures-Images into your project which size is momenatry 13MB.

For more informations and examples plz see Lib-Tile-TransparentTextures.

Library Lib-Tile-TransparentTextures-Images

The library Lib-Tile-TransparentTextures-Images contains all images from the tileset Transparent Textures and the loader TransparentTexturesTileLoader which allowed the developer to load a Tile image from the enum TransparentTexturesTile.

For more informations and examples plz see Lib-Tile-TransparentTextures-Images.

Features

The main goal from this application is to demonstrate the features from the library Lib-Tile and its containing sub-libraries which are momentary lib-core, lib-transparent-textures and lib-transparent-textures-images.

TitledPane Background

Over the TitledPane Background you can tweak the background image and / or the background color from the application.

Choose a Background Image

With the TextField Background image the developer / user have the option to load an optional background image from the internet. Momentary only images from the internet are accepted. The loaded image will be resized to the size 1280x720.

Hint
For a future version I plan the option that the developer / user can also choose a local stored images via a FileChooser.

For example use this link in the demo application and click on the Load button:

Image: Loaded Crimson Night (Dark / Landscape)
loaded-crimson-night.png

Hint
This image is from the webpage https://wall.alphacoders.com. The image haven't neither a created by or shared by flag (see http://alphacoders.com/site/faq ). If anyone is the autor and won't that I use this image here in my open souce project plz send me an email (see Contact) and I will remove it. Thanks for your great work πŸ˜ƒ.

Ps
A click on the Example button will prefilled the TextField Background image with an example link. Then like above described click the Load button to load the image.

Clicking the button Reset removes the loaded background image and clears the TextField.

Feedback: No Image Icon

In the case that its shouldn't be possible to load an Image into the demo application a special image will be shown to signal that something gone wrong:

Image: No Image Icon
no-image-icon.png

Hint
The image is taken from https://www.iconfinder.com/icons/27836/approve_block_cancel_delete_reject_icon and under the license: Creative Commons Attribution-No Derivative Works 3.0 Unported. Thanks for the great work πŸ˜ƒ.

Choose a Background Color

Single color

  • Given is the selection from the RadioButton Colorchooser.
  • Click on the ColorPicker will open the color dialog where a new color can choosen.
  • Clicking the button Reset reset the background color to the default color AQUAMARINE.

Image: Open ColorPicker
open-colorpicker.png

Method onActionShowBackgroundSingleColor(Color) in the class ApplicationPresenter

private void onActionShowBackgroundSingleColor(Color backgroundColor) {
    LoggerFacade.INSTANCE.debug(this.getClass(), "On action show Background SingleColor"); // NOI18N

    Platform.runLater(() -> {
        final String _fx_base = "-fx-base: rgba("; // NOI18N
        final String _fx_control_inner_background = "-fx-control-inner-background: rgba("; // NOI18N

        final StringBuilder sb = new StringBuilder();
        sb.append((int)(backgroundColor.getRed() * 255));
        sb.append(", "); // NOI18N
        sb.append((int)(backgroundColor.getGreen() * 255));
        sb.append(", "); // NOI18N
        sb.append((int)(backgroundColor.getBlue() * 255));
        sb.append(", "); // NOI18N
        sb.append(backgroundColor.getOpacity());
        sb.append("); "); // NOI18N

        apBackground.setStyle(_fx_base + sb.toString()
                + _fx_control_inner_background + sb.toString());
    });
}

Linear- and/or RadialGradient

  • Given is the selection from the RadioButton Linear- and/or RadialGradient.
  • Like the prompt text said in the TextArea the three flags -fx-base , -fx-background-color and -fx-control-inner-background are for the tweaking from interest.
  • For a css example plz click on the Example button.
  • Clicking the button Reset reset the background color to the default color AQUAMARINE.

Image: Example css combined LinearGradient and RadialGradient. css-example-gradient.png

Method onActionShowBackgroundXyGradient(String) in the class ApplicationPresenter

private void onActionShowBackgroundXyGradient(String backgroundColor) {
    LoggerFacade.INSTANCE.debug(this.getClass(), "On action show Background XyGradient"); // NOI18N
        
    Platform.runLater(() -> {
//        final String _fx_base = "-fx-base: "; // NOI18N
//        final String _fx_background_color = "-fx-background-color: ";
//        final String _fx_control_inner_background = "-fx-control-inner-background: "; // NOI18N
//            
//        apBackground.setStyle(
//                _fx_base + backgroundColor
//                + _fx_background_color + backgroundColor
//                + _fx_control_inner_background + backgroundColor);
            
        apBackground.setStyle(backgroundColor);
    });
}

TitledPane Tile

The TitledPane Tile allowed you to choose a Tile from one of the available tilesets. Momentary only the Transparent Textures tiles are available.

Definition
A Tile is per definition a little transparent Image which overlay a background-color or -image with the help of repetitions from the image in a layer.

Tileset Transparent Textures

The Transparent Textures tiles are from the webpage https://www.transparenttextures.com/ and are free to use. Momentary there are 396 tiles in the demo application available.

Background: Winter sunset shinning through the trees (Earth / Sunbeam)
Tile: Subtle White Feathers by Viahorizon
demo-application-modified2.png

Hint
The background image is taken from https://wall.alphacoders.com/big.php?i=723891 and is under the license from CCO Public Domain Image. Big thanks to the autor for his great work πŸ˜ƒ.
The tile image is taken from https://www.transparenttextures.com/ and is free to use. Big thanks to the autor for his great work πŸ˜ƒ.

The tiles are loaded with the help from the enum TransparentTexturesTile which is included into the library Lib-Tile-TransparentTextures.

Enum TransparentTexturesTile

/**
 * The <code>enum</code> TransparentTexturesTile is a collection from 
 * {@link com.github.naoghuman.lib.tile.core.Tile}s which representated the 
 * <code>Tileset</code> from the internet page https://www.transparenttextures.com/.
 * <p />
 * The individual {@link com.github.naoghuman.lib.tile.core.Tile} can be loaded 
 * with the class {@link com.github.naoghuman.lib.tile.transparenttextures.images.TransparentTexturesTileLoader} 
 * from the associated library <code>Lib-Tile-TransparentTextures-Images</code>.
 *
 * @author Naoghuman
 * @see com.github.naoghuman.lib.tile.core.Tile
 * @see com.github.naoghuman.lib.tile.transparenttextures.images.TransparentTexturesTileLoader
 */
public enum TransparentTexturesTile implements Tile {

    /**
     * The <code>Java</code> representation from the tile: 3Px Tile
     */
    TT_3PX_TILE("tt-3px-tile.png", "3Px Tile", 100, 100, "Gre3g", "http://gre3g.livejournal.com/"), // NOI18N
    
    /**
     * The <code>Java</code> representation from the tile: 45 Degree Fabric (Dark)
     */
    TT_45_DEGREE_FABRIC_DARK("tt-45-degree-fabric-dark.png", "45 Degree Fabric (Dark)", 315, 315, "Atle Mo", "http://atle.co/"), // NOI18N
    
    // and 394 more tiles! :))

    TransparentTexturesTile(
            final String name, final String header,
            final double width, final double height,
            final String autor
    ) {
        this(name, header, width, height, autor, ""); // NOI18N
    }

    TransparentTexturesTile(
            final String imageName, final String title,
            final double width, final double height,
            final String autor, final String autorUrl
    ) {
        this.imageName = imageName;
        this.title = title;
        this.width = width;
        this.height = height;
        this.autor = autor;
        this.autorUrl = autorUrl;
    }

    ...
}

For more informations and examples plz see the ReadMe from Lib-Tile-TransparentTextures.

TitledPane About

The TitledPane About show informations like description, autor, webpage, license about the project Lib-Tile-Demo, the Transparent Textures and the used icons in this application.

Image: TitledPane About
titledpane-about.png

Requirements

  • On your system you need JRE 8 or JDK 8 installed.
  • You should have downloaded the demo application πŸ˜ƒ.

Installation

  • Current version is Lib-Tile-Demo v0.2.0 (08.27.2016).
  • Download it and unzip the folder to a place of your choose.
  • Doubleclick the jar file inside the folder and have fun πŸ˜ƒ.

Contribution

  • If you find a Bug I will be glad if you will report an Issue.
  • If you want to contribute to the project plz fork the project and do a Pull Request.

License

The project Lib-Tile-Demo is licensed under General Public License 3.0.

Autor

The project Lib-Tile-Demo is maintained by me, Peter Rogge. See Contact.

Contact

You can reach me under [email protected].

About

This project is a demonstration application to show the features from the project Lib-Tile with it's included sublibraries.

Resources

License

Stars

Watchers

Forks

Packages

No packages published