Create your first VRL - Plugin

Content

In this tutorial you will learn to:

Create a VRL - Plugin

tut-component-01
tut-component–01

We open TestTutorialComponent01.java and write:

package edu.gcsc.vrl.tutorial;

import eu.mihosoft.vrl.annotation.ComponentInfo;
import java.io.Serializable;

@ComponentInfo(name="TestTutorialComponent01", 
        category="TestTutorialPlugin/01", 
        description="My Component")

public class TestTutorialComponent01 implements Serializable{


    private static final long serialVersionUID = 1L;


    public String doSomething() {
        return "Congratulations! "
                + "Your new project works!";
    }
}

Then we create TutorialPluginConfigurator.java and copy the code:

create TutorialPluginConfigurator
create TutorialPluginConfigurator
package edu.gcsc.vrl.tutorial;

import eu.mihosoft.vrl.system.InitPluginAPI;
import eu.mihosoft.vrl.system.PluginAPI;
import eu.mihosoft.vrl.system.PluginIdentifier;
import eu.mihosoft.vrl.system.VPluginAPI;
import eu.mihosoft.vrl.system.VPluginConfigurator;

/**
*
* @author Michael Hoffer <info@michaelhoffer.de>
*/

public class TestTutorialPluginConfigurator extends VPluginConfigurator{

public TestTutorialPluginConfigurator() {
    //specify the plugin name and version
   setIdentifier(new PluginIdentifier("TestTutorial-Plugin01", "0.1"));

   // describe the plugin
   setDescription("Plugin Description");

   // copyright info
   setCopyrightInfo("Sample-Plugin",
           "(c) Your Name",
           "www.you.com", "License Name", "License Text...");
}

@Override
public void register(PluginAPI api) {

   // register plugin with canvas
   if (api instanceof VPluginAPI) {
       VPluginAPI vapi = (VPluginAPI) api;
       vapi.addComponent(TutorialComponent01.class);
       }
}

@Override
public void unregister(PluginAPI api) {
   // nothing to unregister
}

@Override
public void init(InitPluginAPI iApi) {
   // nothing to init
  }
}
create VRL-Studio project
create VRL-Studio project
instal plugin
instal plugin
select plugins
select plugins
plugin-ready
plugin-ready

That means that your plugin works! ;)


To export your whole VRL-Project (with plugins):


you can also load the example plugin from GitHub: Test-VRL-Tut-Plugin–01.zip

Committing your new Plugin to GitHub

1. Create your new Repository in GitHub:

create-repository
create-repository
git-address
git-address

2. Initialize a git repository for the project local and push it to github:

Open the Terminal on your computer and write the address of your project in NetBeans, for example:

    cd NetBeansProjects/Test-VRL-Tut-Plugin-01 

// it means that you go to the directory where your plugin is located, you can see the address in NetBeans in Project Properties;

git-init
git-init
    git init 

// it means that you Initialise Git-Repository local;

    git add .
    git commit -a -m "your commentar"
    git remote set-url origin git@github.com:Elena23/Test-VRL-Tut-Plugin-01.git
    git push -u origin master 

// Initialize a new git repository local, then stage all the files in the directory, then commit the initial snapshot and finally push it into GitHub branch master;

Finished! Now your plugin is in GitHub!

This commands can help you:

    cd ../ 

// to back out one level out of the current directory;

    ls -la

// it shows all files in this directory;

    git status

// it shows the status;

    man git 

// this is Git Manual

//Click ‘q’ to get out of Manual;

For other Git-Commands look here:
Git Cheat Sheet

<- Back To Help Index