Menu

Plugin

Wolf

Preview

Creating your own Plugin is a rather simple process, compared to creating plugins for other programs.

To implement your own Plugin you must implement 3 three interfaces: IPlugin, IPollPlugin and ISettingsScreen, additionally you will also need to create a simple XML-File telling the Classloader, which Class implements the IPlugin-interface to load your plugin.

Two Plugins have been implemented as reference, the Testplugin located at {basedir}/testplugin/* is rather simple and should be used as a starting reference

Steps required

There are 3 Interfaces which must be implemented

  • IPlugin.java
  • IPollPlugin.java
  • ISettingsScreen.java
    ( all located in sturesy.core.plugin )

Implementing iPlugin.java is a must, because its used by the classloader

IPollPlugin and ISettingsScreen are optional, but should be done if you want the plugin to be able to supply votes and have a page in the settings.

IPollPlugin:
setInjectable(Injectable injectable)
- is called when the votingwindow opens, the injectable should be saved in a field, for future use

prepareVoting(LectureID lectureid, final QuestionModel question)
- is called everytime when a new Question is selected by the left/right-arrow

startPolling()
- tells the plugin to utilize the Injectable by calling the method injectVote whenever a Vote is gathered:
injectable.injectVote(new Vote(123123, 0, 1000));

stopPolling()
- stop using the injectable

However, depending on your Hardware-Vendor it might be quite difficult to get the hardware working.

First of all Java doesn't come with any features to work with USB or COM-Ports. (RXTX can be used here, see hitt-plugin source-code)

Second the data that comes from the Clicker-Receivers might be encrypted and without a SDK supplied by the Hardware-Vendor this might be tricky.


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.