Tips For New Design

an interesting design tips

Iklan

Javafx Swine Shooter – The Source Code

Astaghfirullah, hampir lupa untuk ngasih source code. maaf buat semuanya :oops: :(
Masih ingat posting game sangat sederhana dengan javafx disini kan source codenya silahkan di download langsung dari link berikut:
SwineShooterzip .
source code tersebut sudah lama gak di update, kalau ada masalah, silahkan ditanyakan. jangan lupa untuk merename dari .doc menjadi .zip (itu paket file terkompresi dalam format zip, hanya diganti ekstensinya saja)

play3

JavaFX Dynamic Selection Using Polygon

Contoh membuat seleksi map dengan menggunakan polygon, lihat demo berikut ( a video is worth more than a thousands words :P )

klik kiri untuk membuat polygon, dan klik kanan sebagai titik terakhir.
sourcecode:

package selectarea;

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.input.MouseButton;
import javafx.scene.shape.Polygon;
import javafx.scene.paint.Color;
import javafx.scene.Group;
import javafx.scene.input.MouseEvent;
import javafx.scene.image.*;

/**
 * @author Muhammad Hakim A <hakimrie&#91;at&#93;gmail.com>
 */

var points:Number[];
var nextpoint:Number[];
var end:Boolean = false;
var polygon = Polygon {
        points : bind [points, nextpoint];
        fill: Color.YELLOW
        stroke: Color.BLUE
        opacity: 0.5
    }
var a:String;

var group = Group {
        content: bind [ImageView {
                x: 0, y: 0
                image: Image{
                    url: "{__DIR__}mountainview.jpg"
                }

                onMouseClicked: function( e: MouseEvent ):Void {
                    var p = [e.x,e.y];
                    insert p into points;

                    if (e.button == MouseButton.SECONDARY)
                        end = true;
                }

                onMouseMoved: function( e: MouseEvent ):Void {
                    if (not end)
                        nextpoint = [e.x,e.y];
                }
            },polygon
        ]
}

Stage {
    title: "Select Area"
    width: 800
    height: 500
    scene: Scene {
        content:bind group
    }
}

Harmonyfx – JavaFx Media Player

Introduction

Before you start read the rest of the article, watch the demo below

and the longer one (with drag & drop + search demo: 4:19 minutes)

This article has been in the making a while, and has sort of become a labour of love. When I first started the sole purpose of this article was to gain a deeper understanding of some of JavaFX features APIs, (CustomNode, Storage & Resource, RESTful Web Service using HttpRequest & pullparser, Binding with java object, drag and drop, effects, animation, “3D” etc) I needed an arena in which to perform this self study, so what I decided to do was construct a workable/searchable MP3 player. The MP3 player would work of MP3 ID3 tag metadata which would be obtained using myID3 a java ID3 tag library.

In essence this is what this article is all about.

Overview
Essentially HarmonyFx (the codename ;)) looks like this. It is made up of a number of different consituent CustomNode (Custom Control),

harmonyfx
harmonyfx2

How It Is Intended to Work
I have tried to write this application in a logical manner, and I hope it works as most people would expect it to work. So without further ado, let me delve in to how I intended Harmonyfx to work.

When Harmonyfx is run it will examine the Storage (Library) and tray read all files, that previously saved, Read the metadata (ID3) tag, and arrange it in shelf (cover flow), and download the Album art based on the Album name from last.fm web service. User can add songs in the library by drag and drop folder or files into harmonyfx.

If Harmonyfx is shutdowned, the library updated again with last changed library in application.

Read More »