Difference between revisions of "Creating a self-contained plug-in frame"
(→Creating a self-contained plug-in frame) |
m (→Installing plug-in programs) |
||
Line 44: | Line 44: | ||
|} | |} | ||
− | + | == Installing plug-in programs == | |
<div style="font-style: normal; font-weight: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Installing simple plug-in programs merely copies files into the user's home directory. <br /></font></div><div style="font-style: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Windows</font>'''</span><br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 4pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">c:\Documents and Settings\<user ID>\mipav\plugins</font></span><br /></font></div><div style="font-style: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">UNIX</font>'''</span><br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 4pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">/user/<user ID>/mipav/plugins</font></span><br /></font></div> | <div style="font-style: normal; font-weight: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Installing simple plug-in programs merely copies files into the user's home directory. <br /></font></div><div style="font-style: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Windows</font>'''</span><br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 4pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">c:\Documents and Settings\<user ID>\mipav\plugins</font></span><br /></font></div><div style="font-style: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">UNIX</font>'''</span><br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 4pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">/user/<user ID>/mipav/plugins</font></span><br /></font></div> |
Revision as of 12:05, 24 June 2013
You can create a self-contained plug-in that does not rely on the default MIPAV user interface. When running, this type of plug-in hides MIPAV and displays its own image(s) with the action and algorithm handling specific to its frame.
To create a self-contained plug-in:
Pre-defined button and menu parameters are located in CustomUIBuilder. Pre-defined as well as the user-defined UIParams can be added and used in both toolbars and menus.
Optional:
The ViewJFrameMessage Data and Debug tabs (as well as others) can be added to the plug-in frame by retrieving the JTabbedPane through ViewUserInterface.getReference().getMessageFrame().getTabbedPane(). This enables the Data and Debug message output to be displayed outside of the separate message frame that accompanies MIPAV.
See also: Figure 18 and Figure 19.
PlugInDialogImageVOIDisplay.java 1 import java.awt.*; 2 import java.awt.event.*; 3 import java.util.Vector; 4 5 import javax.swing.*; 6 import gov.nih.mipav.model.file.FileInfoBase; 7 import gov.nih.mipav.model.structures.ModelImage; 8 import gov.nih.mipav.model.structures.ModelLUT; 9 import gov.nih.mipav.model.structures.ModelRGB; 10 import gov.nih.mipav.model.structures.VOI; 11 import gov.nih.mipav.view.*; 12 import gov.nih.mipav.view.dialogs.*; 13 14 15 /** 16 * Plugin example class for creating a simple, self-contained frame that extends ViewJFrame Image 17 * Contains a subset of the VOI functions, as well as the message frame contained within the frame itself 18 * @author linkb 19 * 20 */ 21 public class PlugInDialogImageVOIDisplay extends ViewJFrameImage implements MouseListener, AdjustmentListener { 22 23 24 25 //~ Constructors --------------------------------------------------------------------------------------------------- 26 27 /** 28 * Default constructor 29 */ 30 public PlugInDialogImageVOIDisplay(ModelImage image) { 31 super(image, null, null, false, false); 32 init(); 33 } 34 35 36 /** 37 * ViewOpenFrameInterface function for opening a model image (result) into a new frame 38 */ 39 public PlugInDialogImageVOIDisplay openFrame(ModelImage image) { 40 return new PlugInDialogImageVOIDisplay(image); 41 }
|
Installing plug-in programs
You can choose one of two methods for copying the files: