< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XAtom.java

Print this page




 321      */
 322     public void setProperty8(long window, String str) {
 323         if (atom == 0) {
 324             throw new IllegalStateException("Atom should be initialized");
 325         }
 326         checkWindow(window);
 327         byte[] bdata = null;
 328         try {
 329             bdata = str.getBytes("ISO-8859-1");
 330         } catch (java.io.UnsupportedEncodingException uee) {
 331             uee.printStackTrace();
 332         }
 333         if (bdata != null) {
 334             setAtomData(window, XA_STRING, bdata);
 335         }
 336     }
 337 
 338 
 339     /**  Gets the window property for the specified window
 340      * @param window window id to use
 341      * @param str value to set to.
 342      * @return string with the property.
 343      * @since 1.5
 344      */
 345     public String getProperty(long window) {
 346         if (atom == 0) {
 347             throw new IllegalStateException("Atom should be initialized");
 348         }
 349         checkWindow(window);
 350         XToolkit.awtLock();
 351         try {
 352             return XlibWrapper.GetProperty(display,window,atom);
 353         } finally {
 354             XToolkit.awtUnlock();
 355         }
 356     }
 357 
 358 
 359     /*
 360      * Auxiliary function that returns the value of 'property' of type
 361      * 'property_type' on window 'window'.  Format of the property must be 32.




 321      */
 322     public void setProperty8(long window, String str) {
 323         if (atom == 0) {
 324             throw new IllegalStateException("Atom should be initialized");
 325         }
 326         checkWindow(window);
 327         byte[] bdata = null;
 328         try {
 329             bdata = str.getBytes("ISO-8859-1");
 330         } catch (java.io.UnsupportedEncodingException uee) {
 331             uee.printStackTrace();
 332         }
 333         if (bdata != null) {
 334             setAtomData(window, XA_STRING, bdata);
 335         }
 336     }
 337 
 338 
 339     /**  Gets the window property for the specified window
 340      * @param window window id to use

 341      * @return string with the property.
 342      * @since 1.5
 343      */
 344     public String getProperty(long window) {
 345         if (atom == 0) {
 346             throw new IllegalStateException("Atom should be initialized");
 347         }
 348         checkWindow(window);
 349         XToolkit.awtLock();
 350         try {
 351             return XlibWrapper.GetProperty(display,window,atom);
 352         } finally {
 353             XToolkit.awtUnlock();
 354         }
 355     }
 356 
 357 
 358     /*
 359      * Auxiliary function that returns the value of 'property' of type
 360      * 'property_type' on window 'window'.  Format of the property must be 32.


< prev index next >