OpenJUMP with Wallpaper

From OpenJUMP Wiki
Revision as of 23: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…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

that code adds a wallpaper to workbench's jdesktoppane.

File:Oj wallpaper.jpg

  1. First add the image to com.vividsolutions.jump.workbench.ui.images, where is the IconLoader. you can download one from here
  2. 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..