OpenJUMP with Wallpaper
Revision as of 22:41, 18 October 2009 by Mentaer (talk | contribs) (Created page with 'that code adds a wallpaper to workbench's jdesktoppane. File:Oj_wallpaper.jpg # First add the image to ''com.vividsolutions.jump.workbench.ui.images'', where is the IconLoa…')
that code adds a wallpaper to workbench's jdesktoppane.
- First add the image to com.vividsolutions.jump.workbench.ui.images, where is the IconLoader. you can download one from here
- Then modified the Configuration in OpenJUMP the class org.openjump.OpenJumpConfigurationin JUMP com.vividsolutions.jump.workbench.JUMPConfiguration
adding the follow code
first add the next method.
private static void loadBackground(WorkbenchContext workbenchContext){
/*setting the border with a image*/
workbenchContext.getWorkbench().getFrame()
.getDesktopPane().setBorder(new Border() {
public void paintBorder(Component c, Graphics g,
int x, int y, int width, int height) {
//the name of the image is walljump.png in this case
g.drawImage(IconLoader.icon("walljump.png").getImage(),
0, 0, null);
}
public Insets getBorderInsets(Component c) {
return new Insets(0,0,0,0);
}
public boolean isBorderOpaque() {
return true;
}
}
);
/*setting background white*/
workbenchContext.getWorkbench().getFrame()
.getDesktopPane().setBackground(Color.WHITE);
}
and now call the method loadBackground from OpenJumpConfiguration.java in (JUMP add the line in the method setup)
public static void loadOpenJumpPlugIns(final WorkbenchContext workbenchContext)
throws Exception {
.....
loadBackground(workbenchContext);
}
.. so that's all..