Package com.cedarsoft.commons.struct

Examples of com.cedarsoft.commons.struct.DefaultNode.addChild()


  public MenuDemo() {
    rootNode = new DefaultNode( "menuNode" );
    final DefaultNode fileMenuNode = new DefaultNode( "file", Lookups.singletonLookup( Action.class, new FileAction() ) );
    rootNode.addChild( fileMenuNode );

    fileMenuNode.addChild( new DefaultNode( "open", Lookups.singletonLookup( Action.class, new OpenAction() ) ) );
    fileMenuNode.addChild( new DefaultNode( "close", Lookups.singletonLookup( Action.class, new CloseAction() ) ) );

    fileMenuNode.addChild( new DefaultNode( "increate counter", Lookups.singletonLookup( Action.class, new CounterAction() ) ) );

View Full Code Here


    rootNode = new DefaultNode( "menuNode" );
    final DefaultNode fileMenuNode = new DefaultNode( "file", Lookups.singletonLookup( Action.class, new FileAction() ) );
    rootNode.addChild( fileMenuNode );

    fileMenuNode.addChild( new DefaultNode( "open", Lookups.singletonLookup( Action.class, new OpenAction() ) ) );
    fileMenuNode.addChild( new DefaultNode( "close", Lookups.singletonLookup( Action.class, new CloseAction() ) ) );

    fileMenuNode.addChild( new DefaultNode( "increate counter", Lookups.singletonLookup( Action.class, new CounterAction() ) ) );


    DefaultNode recentlyOpenedFilesNode = new DefaultNode( "recentlyOpenedFiles", Lookups.singletonLookup( Action.class, new RecentFilesAction() ) );
View Full Code Here

    rootNode.addChild( fileMenuNode );

    fileMenuNode.addChild( new DefaultNode( "open", Lookups.singletonLookup( Action.class, new OpenAction() ) ) );
    fileMenuNode.addChild( new DefaultNode( "close", Lookups.singletonLookup( Action.class, new CloseAction() ) ) );

    fileMenuNode.addChild( new DefaultNode( "increate counter", Lookups.singletonLookup( Action.class, new CounterAction() ) ) );


    DefaultNode recentlyOpenedFilesNode = new DefaultNode( "recentlyOpenedFiles", Lookups.singletonLookup( Action.class, new RecentFilesAction() ) );
    fileMenuNode.addChild( recentlyOpenedFilesNode );
View Full Code Here


    DefaultNode recentlyOpenedFilesNode = new DefaultNode( "recentlyOpenedFiles", Lookups.singletonLookup( Action.class, new RecentFilesAction() ) );
    fileMenuNode.addChild( recentlyOpenedFilesNode );

    recentlyOpenedFilesNode.addChild( new DefaultNode( "file0", Lookups.singletonLookup( Action.class, new RecentFileAction( "file0" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file1", Lookups.singletonLookup( Action.class, new RecentFileAction( "file1" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file2", Lookups.singletonLookup( Action.class, new RecentFileAction( "file2" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file3", Lookups.dynamicLookup( new RecentFileAction( "file3" ), new NodePresenter() {
      @Override
      @NotNull
View Full Code Here

    DefaultNode recentlyOpenedFilesNode = new DefaultNode( "recentlyOpenedFiles", Lookups.singletonLookup( Action.class, new RecentFilesAction() ) );
    fileMenuNode.addChild( recentlyOpenedFilesNode );

    recentlyOpenedFilesNode.addChild( new DefaultNode( "file0", Lookups.singletonLookup( Action.class, new RecentFileAction( "file0" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file1", Lookups.singletonLookup( Action.class, new RecentFileAction( "file1" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file2", Lookups.singletonLookup( Action.class, new RecentFileAction( "file2" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file3", Lookups.dynamicLookup( new RecentFileAction( "file3" ), new NodePresenter() {
      @Override
      @NotNull
      protected y.base.Node createPresentation() {
View Full Code Here

    DefaultNode recentlyOpenedFilesNode = new DefaultNode( "recentlyOpenedFiles", Lookups.singletonLookup( Action.class, new RecentFilesAction() ) );
    fileMenuNode.addChild( recentlyOpenedFilesNode );

    recentlyOpenedFilesNode.addChild( new DefaultNode( "file0", Lookups.singletonLookup( Action.class, new RecentFileAction( "file0" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file1", Lookups.singletonLookup( Action.class, new RecentFileAction( "file1" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file2", Lookups.singletonLookup( Action.class, new RecentFileAction( "file2" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file3", Lookups.dynamicLookup( new RecentFileAction( "file3" ), new NodePresenter() {
      @Override
      @NotNull
      protected y.base.Node createPresentation() {
        y.base.Node node = super.createPresentation();
View Full Code Here

    fileMenuNode.addChild( recentlyOpenedFilesNode );

    recentlyOpenedFilesNode.addChild( new DefaultNode( "file0", Lookups.singletonLookup( Action.class, new RecentFileAction( "file0" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file1", Lookups.singletonLookup( Action.class, new RecentFileAction( "file1" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file2", Lookups.singletonLookup( Action.class, new RecentFileAction( "file2" ) ) ) );
    recentlyOpenedFilesNode.addChild( new DefaultNode( "file3", Lookups.dynamicLookup( new RecentFileAction( "file3" ), new NodePresenter() {
      @Override
      @NotNull
      protected y.base.Node createPresentation() {
        y.base.Node node = super.createPresentation();
        ( ( Graph2D ) node.getGraph() ).getRealizer( node ).setFillColor( Color.CYAN );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.