About Color Resource command

31 views
Skip to first unread message

Rajmahendra R

unread,
Jul 15, 2013, 2:32:55 AM7/15/13
to jrebirth-...@googlegroups.com
Seb

I have did a major change in your color command...

merged all 5 command to a single command as color-add
i have added a new Completer for color type to make typing easy.
Also i moved the class creation inside ResourceUtils.

Sebastien Bordes

unread,
Jul 15, 2013, 4:06:57 AM7/15/13
to jrebirth-...@googlegroups.com
Hi Raj,

It's far better I really like the Completer feature, I wanted to discuss with you about a way to reduce the command number, you have foreseen this :D
The method name is wrongly written, it should be colorAdd instead of colorAddGray, for sure it's anecdotal.

It remains to implement regex checker and it will be really cool and a agodd basis to implement others resources.


While I've been fixing some quality issues I had found an old class that can be useful. => AbstractSimpleModel
It allows to build an UI view (MVC) without View & Controller.

So we should have a command to create :
  • MVC =Done
  • MV  (skipController attribute) => Done
  • M (SkipViewController)

The goal is to have lightweight object for really simple way to limit memory overhead, I faced this problem while optimizing an EclipseRCP application with draw2D, we replace all Label by primitive call to drawString to limit number of overall object created to be compliant with the 1.4GB heap limit.


Seb

rajma...@gmail.com

unread,
Jul 15, 2013, 4:22:32 AM7/15/13
to jrebirth-...@googlegroups.com
Seb,

Regex part of the color value validation Guru going to work on it.


Regarding the mode..

Currently the MainApp default model is specified like

      @Override
        public Class<? extends Model> getFirstModelClass() {
          return DefaultModel.class;
        }

Can we change this to DefaultSimpleModel ? 
I do have one more TODO for this...   Change the firstmdoelclass through command something like

jrebirth app-config --defaultModel intro

This changes the MainApp getFirstModelClass value or something similar.

Without a VC how can user use a Model ?



--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes JRebirth Developers.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-develo...@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .
 
 



--
Thank you and regards,
Rajmahendra R Hegde (Raj)
Website:
http://www.twitter.com/rajonjava
http://www.jugchennai.in             
----------------------------------------------------------------------------------------------
"DREAM is not what you see in sleep;
is the thing which does not let you sleep" - APJ Abdul Kalam
Do the difficult things while they are easy and do the great things while they are small.
A journey of a thousand miles must begin with a single step. - Lao Tzu


image003.png

Sebastien Bordes

unread,
Jul 15, 2013, 4:46:28 AM7/15/13
to jrebirth-...@googlegroups.com
The AbstractSimpleModel implements Model interface, so there isn't any problem

This model must manage itself the view & controller concerns.

There is an abstract method used to create the root node, all events handler must be managed manually without all convenient method of View-Controller classes.
The goal is to be lightweight when you want to manage hundred of UI that require to listen a wave without creating three 'manager' instead of one.


public abstract class AbstractSimpleModel<N extends Node> extends AbstractWaveReady<Model> implements Model {

    /** The root model not null for inner model. */
    private Model rootModel;

    /** The root node. */
    private N rootNode;

    /**
* {@inheritDoc}
*/
    @Override
    public final void ready() throws CoreException {

        // Initialize the current model
        initialize();

        // Prepare the root node
        this.rootNode = prepareNode();
    }

    /**
* Prepare the root node.
*
* With simple model no view neither controller are created.<br />
* You must manage them yourself.
*
* @return the model root node
*/
    protected abstract N prepareNode();

    /**
* Initialize the model.
*
* @throws CoreException if the creation of the view fails
*/
    protected void initialize() throws CoreException {
        customInitialize();
    }

    /**
* Initialize method to implement for adding custom processes.
*/
    protected abstract void customInitialize();

    /**
* {@inheritDoc}
*/
    @Override
    public N getRootNode() {
        return this.rootNode;
    }

    /**
* {@inheritDoc}
*/
    @Override
    public Model getRootModel() {
        return this.rootModel;
    }

    /**
* {@inheritDoc}
*/
    @Override
    public void setRootModel(final Model rootModel) {
        this.rootModel = rootModel;
    }

    /**
* {@inheritDoc}
*/
    @Override
    protected abstract void processAction(final Wave wave);

    /**
* {@inheritDoc}
*/
    @Override
    protected void finalize() throws Throwable {
        getLocalFacade().getGlobalFacade().trackEvent(JRebirthEventType.DESTROY_MODEL, null, this.getClass());
        super.finalize();
    }

}


Le lundi 15 juillet 2013 08:32:55 UTC+2, Rajmahendra R a écrit :

Rajmahendra R

unread,
Jul 17, 2013, 5:41:51 AM7/17/13
to jrebirth-...@googlegroups.com
I added the prompt confirmation if the variable exists and also add or update the variable.

As we update the existing variable...If all the ColorItem of a type say GrayColor is removed from the interenface there may be some import statements remain on top. I tried to remove this  but its increasing too many possibility. So instead of adding and removing the import statement i am plan to add  * in the import statement in template so we no need to worry of removing and adding of import.

Let me continue this, in futures lets see how to make this more user friendly .

Sebastien Bordes

unread,
Jul 17, 2013, 5:46:36 AM7/17/13
to jrebirth-...@googlegroups.com
OK,

It's not really a problem because developers should perform an organize import (or a clean up) before commiting taht will remove unused import and reorganize them.
I will push my new import order config file (for eclipse on the Conf repository) that remove some quality issues (.

Rajmahendra R

unread,
Jul 26, 2013, 5:32:00 AM7/26/13
to jrebirth-...@googlegroups.com
Seb

I am working on creating only model command. Can we have a DefaultSimpleModel for AbstractSimpleModel  i see there are many abstract method user need to add!

Sebastien Bordes

unread,
Jul 26, 2013, 6:07:16 AM7/26/13
to jrebirth-...@googlegroups.com
Yes you are right, I will add it to the 0.7.5-SNAPHOT version and I will refactor this part a little bit

Seb

rajma...@gmail.com

unread,
Jul 26, 2013, 6:08:59 AM7/26/13
to jrebirth-...@googlegroups.com
How you add the FXML in the system i see one example in 

FX-Presentation\org.jrebirth.presentation.javafx2\src\main\java\org\jrebirth\presentation\javafx\ui\slides\arch

which uses Presentation module  how to use in a general fxml ?


--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes JRebirth Developers.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-develo...@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .
 
 
image003.png

Sebastien Bordes

unread,
Jul 26, 2013, 6:18:15 AM7/26/13
to jrebirth-...@googlegroups.com
You can find some code sample here : https://github.com/JRebirth/JRebirth/tree/master/org.jrebirth/core/src/test/java/org/jrebirth/core/ui/fxml

(even if tests are cracked)

You can also read my explanation on user mailing list here about fxml : https://groups.google.com/forum/#!topic/jrebirth-users/xt-nBlAExTc

Seb
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-developers+unsub...@googlegroups.com.

Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .
 
 

rajma...@gmail.com

unread,
Jul 26, 2013, 6:58:19 AM7/26/13
to jrebirth-...@googlegroups.com
Seb

For model i will use

public class SplashMyFxmlModel extends DefaultFXMLModel<SplashMyFxmlModel>
{

    private String fxmlPath;

    private String resourcePath;

 }

Here do i need to set fxml to fxmlPath  ?

in SplashMyFxmlController 
public class SplashMyFxmlController extends AbstractFXMLController<SplashMyFxmlModel>

its asking for the view!


Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-develo...@googlegroups.com.

Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .
 
 
image003.png

Sebastien Bordes

unread,
Jul 26, 2013, 7:29:09 AM7/26/13
to jrebirth-...@googlegroups.com
If you use AbstractFXMLModel you can create getFxmlPath path to return a constant (fxml file not just the path)

if you use DefaultFXMLModel, fxml and resource bundle will be loaded from key part of the model

In this 2 cases the view will be equals to NullView.

The view is only used when using FXMLComponent( fxml + fxmlController) with MVC or MV sub pattern.

Let me konw if it's ok

Seb
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-developers+unsubscribe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages