• Home
  • Contact
  • Careers
  • Socialize With Us:
  • Send us Mail
  • Follow us on Twitter
  • Join our Facebook Group
  • /
  • Linkedin
  • /
  • Vimeo Videos
  • /
  • Youtube
  • /
  • RSS Feed
  • Search Site

  • About UsAwards & Bio
  • PortfolioOur Latest Work
  • TrainingTips & Tutorials
  • BlogGreat Articles

You are here: Home / Tag: Java

Tag Archive for: Java

Event Dispatching in Java

Category: Quick Tips     |     Tags: API, Experimental, Java

My professional focus is on client-side development. For a recent project, I re-learned some substantial Java concepts and completed server-side coding.

During the project, I was surprised to find there is no native java event messaging (event dispatching and event listening). While some UI frameworks have a solution, the solution appears to be coupled to those frameworks.

So I created a custom Java solution to handle it. The system uses common Observer pattern and modeled it after the spirit of what is present in ActionScript 3.0. I used abstraction and interfaces so its fairly decoupled and flexible. Take a look.

Usage

[actionscript3]
public EventsDemo()
{

// CREATE
SampleEventDispatcher s = new SampleEventDispatcher();

// LISTEN
s.addEventListener(Event.EVENT_NAME, this, "_onEvent1");

//TEST ‘HAS’
/*
if (s.hasEventListener(Event.EVENT_NAME, this, "_onEvent1") ){

//TEST ‘REMOVE’
s.removeEventListener(Event.EVENT_NAME, this, "_onEvent1");
}
*/

// TEST A DISPATCH OF EVENT (IN A FAKE, TEMPORARY WAY)
s.doDispatchTestEvent(new Event (Event.EVENT_NAME, this));

}

public void _onEvent1 (Event aEvent)
{
System.out.println (" _onEvent1(): " + aEvent + " , " + aEvent.getType() + ", " + aEvent.getTarget() );
}
[/actionscript3]

It rocks!

Next Steps

  • Download the code and check it out! (See Member Resources)
  • Comment below with your thoughts.

Member Resources

[private_Free member]Enjoy this members-only content!

  • Download my JavaDemos
  • Create ‘EventDispatcherDemo’ project set compiler dependency to project ‘RMCCodeLibraryJava’ and publish ‘EventDispatcherDemo’.

[/private_Free member]

Tag

3D AIR API AS3 AS3.5 AssetStore Augmented Reality Business C# Charity Debugging Design Patterns DevDiary ECS Architecture Experimental Flash Flex Game Design Game Design Prototypes Games GUI HTML5 Java Loom Mobile MVCS Architecture Optimization Project Planning PushButtonEngine ReactiveExtensions Review Robotlegs Smash Testing Unity3D UnityApplicantTest WordPress WordPress Plugin

Brazilean Developers

  • Abendita.com
  • dclick.com.br
  • dm9.com.br
  • Fellyph Cintra
  • IgorCosta.org
  • MonadaSolucoes.com.br
  • PossibleWorldwide.com.br
  • Unit9.com

Developers

  • Adobe Blogs
  • Ben Forta
  • Colin Moock
  • Enrique Duvos
  • Flash Mobile Blog
  • Jess Freeman
  • Kevin Hoyt
  • Lee Brimelow
  • Paul Trani
  • Quasimondo
  • Renaun Erickson
  • Ryan Stewart

Free Assets

  • Free Sounds
  • HasGrafics

HTML5 Games

  • Closure JS Library
  • Eloquent JS Manual
  • Game Framework – CraftyJS
  • Game Framework – EaselJS

Italian Developers

  • alchimedia.com
  • corlan.org/
  • creativesource.it
  • dimix.it
  • fabiobiondi.com
  • gnstudio.com
  • Interpreting-tech.com/bemobile/
  • leonardorisuleo.info
  • lucamascaro.info
  • mart3.org
  • mxml.it
  • nxn.it
  • pirosoft.it
  • Preload.it
  • sonnati.wordpress.com/
  • webgriffe.com

Products

  • Adobe.com
  • Amazon Kindle E-Reader
  • ElectroServer
  • F*CSS
  • Flash Development Toolkit (FDT)
  • O'Reilly PureMVC Book
  • Samsung Galaxy Tablet
  • Unity3D

RMC

  • RMC Consulting

Spanish Developers

  • Flash Adictos
  • HTML Cinqo
  • Tutoriales Flash

Tutorial

  • Active Tuts
  • AS3-to-Unity3D Training Videos
  • Doing 2D in Unity3D
  • Learning C#
  • Unity3D Tutorials

Unity3D Games

  • AS3-to-Unity3D Training Videos
  • Doing 2D in Unity3D
  • Learning C#
  • Matt Eley's Blog
  • Unity3D
  • Unity3D Tools
  • Unity3D Tutorials

Interesting links

Besides are some interesting links for you! Enjoy your stay :)

Latest Portfolio

  • Coins And PlatformsMarch 19, 2014, 6:04 am
  • Paddle SoccerMarch 2, 2014, 9:13 pm
  • Spider StrikeFebruary 21, 2014, 4:19 am
  • Custom Game System APIJuly 8, 2013, 8:05 am

Latest News

  • RMC Primer: Everything Virtual Reality (VR)September 3, 2016, 10:29 am
  • Unity3D Architectures: EntitasJuly 29, 2016, 11:15 pm
  • RMC Primer: Get A Job In Game DevelopmentAugust 19, 2015, 10:18 am
  • Unity UI: Overview – Part 1 of 3December 10, 2014, 9:55 am

Archive

  • September 2016
  • July 2016
  • August 2015
  • December 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • December 2012
  • October 2012
  • September 2012
  • July 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • April 2011
  • March 2011
  • January 2011
  • December 2010
  • October 2010
  • September 2010
  • April 2010
  • March 2010
  • January 2010
  • October 2009
  • August 2009
  • June 2009
  • May 2009
  • April 2009
  • January 2009
  • December 2008
  • November 2008
  • August 2008
  • May 2008
  • April 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • August 2007
  • May 2007
  • January 2007
  • October 2006
  • April 2006
  • March 1999

© Copyright 2006 - 2023 - Rivello Multimedia Consulting - RMC by Samuel Asher Rivello