当前位置: 首页>>代码示例>>Java>>正文


Java Atom.intern方法代码示例

本文整理汇总了Java中gnu.x11.Atom.intern方法的典型用法代码示例。如果您正苦于以下问题:Java Atom.intern方法的具体用法?Java Atom.intern怎么用?Java Atom.intern使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.x11.Atom的用法示例。


在下文中一共展示了Atom.intern方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setNetAllowedActions

import gnu.x11.Atom; //导入方法依赖的package包/类
/**
    * set _NET_WM_ALLOWED_ACTIONS properity according to window type.
    * @param client
    */
   static void setNetAllowedActions(Display display, X11Client client) {
int temp[] = new int[10];
int i = 0;

for (int j = 0; j < windowTypes.length; j++) {
    if (client.getNetWindowType() == ((Atom) Atom.intern(display,
	    "_NET_WM_WINDOW_TYPE_DIALOG")).id) {
	temp[i++] = ((Atom) Atom
		.intern(display, "_NET_WM_ACTION_CLOSE")).id;
	temp[i++] = ((Atom) Atom.intern(display, "_NET_WM_ACTION_MOVE")).id;
	break;
    }
}
int data[] = new int[i];
for (int j = 0; j < i; j++) {
    data[j] = temp[j];
}
client.change_property(Window.REPLACE, i, netallowedAction, Atom.ATOM,
	32, data, 0, 32);
   }
 
开发者ID:josmas,项目名称:openwonderland,代码行数:25,代码来源:X11WindowManagerHints.java

示例2: getWmState

import gnu.x11.Atom; //导入方法依赖的package包/类
/**
    * get current window state.
    * @param win
    */
   Atom[] getWmState(Display display, Window win) {
ArrayList<Atom> res = new ArrayList<Atom>();
Window.PropertyReply rep = win.property(false, netWmState, Atom.ATOM,
	0, 5);
Enum enm = rep.items();
while (enm.more()) {
    Atom atom = (Atom) Atom.intern(display, enm.next_integer());
    res.add(atom);
    logger.fine("WM State: " + win + " " + atom);
}
if (res.size() > 0) {
    return res.toArray(new Atom[res.size()]);
}
return null;
   }
 
开发者ID:josmas,项目名称:openwonderland,代码行数:20,代码来源:X11WindowManagerHints.java

示例3: show

import gnu.x11.Atom; //导入方法依赖的package包/类
/**
   * Makes the component visible. This is called by {@link Component#show()}.
   *
   * This is implemented to call setVisible(true) on the Swing component.
   */
  public void show()
  {
    // Prevent ResizeRedirect events.
    //xwindow.select_input(Event.NO_EVENT_MASK);
    //xwindow.select_input(noResizeRedirectSelect);

    XGraphicsDevice dev = XToolkit.getDefaultDevice();
    xwindow.map();
    EventQueue eq = XToolkit.getDefaultToolkit().getSystemEventQueue();
    java.awt.Window w = (java.awt.Window) super.awtComponent;
    eq.postEvent(new WindowEvent(w, WindowEvent.WINDOW_OPENED));
    eq.postEvent(new PaintEvent(w, PaintEvent.PAINT,
                                new Rectangle(0, 0, w.getWidth(),
                                              w.getHeight())));

    Graphics g = getGraphics();
    g.clearRect(0, 0, awtComponent.getWidth(), awtComponent.getHeight());
    g.dispose();
//    // Reset input selection.
//    atts.set_override_redirect(false);
//    xwindow.change_attributes(atts);

    // Determine the frame insets.
    Atom atom = (Atom) Atom.intern(dev.getDisplay(), "_NET_FRAME_EXTENTS");
    Window.Property p = xwindow.get_property(false, atom, Atom.CARDINAL, 0,
                                             Window.MAX_WM_LENGTH);
    if (p.format() != 0)
      {
        insets = new Insets(p.value(0), p.value(1), p.value(2), p.value(3));
        Window.Changes ch = new Window.Changes();
        ch.width(awtComponent.getWidth() - insets.left - insets.top);
        ch.height(awtComponent.getHeight() - insets.top - insets.bottom);
        xwindow.configure(ch);
      }

  }
 
开发者ID:vilie,项目名称:javify,代码行数:42,代码来源:XWindowPeer.java

示例4: show

import gnu.x11.Atom; //导入方法依赖的package包/类
/**
   * Makes the component visible. This is called by {@link Component#show()}.
   *
   * This is implemented to call setVisible(true) on the Swing component.
   */
  public void show()
  {
    // Prevent ResizeRedirect events.
    //xwindow.select_input(Event.NO_EVENT_MASK);
    //xwindow.select_input(noResizeRedirectSelect);

    XGraphicsDevice dev = XToolkit.getDefaultDevice();
    xwindow.map();
    EventQueue eq = XToolkit.getDefaultToolkit().getSystemEventQueue();
    java.awt.Window w = (java.awt.Window) super.awtComponent;
    eq.postEvent(new WindowEvent(w, WindowEvent.WINDOW_OPENED));
    eq.postEvent(new PaintEvent(w, PaintEvent.PAINT,
                                new Rectangle(0, 0, w.getWidth(),
                                              w.getHeight())));

    Graphics g = getGraphics();
    g.clearRect(0, 0, awtComponent.getWidth(), awtComponent.getHeight());
    g.dispose();
//    // Reset input selection.
//    atts.set_override_redirect(false);
//    xwindow.change_attributes(atts);
    
    // Determine the frame insets.
    Atom atom = (Atom) Atom.intern(dev.getDisplay(), "_NET_FRAME_EXTENTS");
    Window.Property p = xwindow.get_property(false, atom, Atom.CARDINAL, 0,
                                             Window.MAX_WM_LENGTH);
    if (p.format() != 0)
      {
        insets = new Insets(p.value(0), p.value(1), p.value(2), p.value(3));
        Window.Changes ch = new Window.Changes();
        ch.width(awtComponent.getWidth() - insets.left - insets.top);
        ch.height(awtComponent.getHeight() - insets.top - insets.bottom);
        xwindow.configure(ch);
      }

  }
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:42,代码来源:XWindowPeer.java

示例5: setNetWmState

import gnu.x11.Atom; //导入方法依赖的package包/类
/**
    * set the default NET_WM_STATE acording to window type. 
    * @param client
    */
   static void setNetWmState(Display display, X11Client client) {
int temp[] = new int[5];
int i = 0;

for (int j = 0; j < windowTypes.length; j++) {
    if (client.getNetWindowType() == ((Atom) Atom.intern(display,
	    "_NET_WM_WINDOW_TYPE_DIALOG")).id) {
	temp[i++] = ((Atom) Atom.intern(display,
		"_NET_WM_STATE_SKIP_TASKBAR")).id;
	break;
    }
    if (client.getNetWindowType() == ((Atom) Atom.intern(display,
	    "_NET_WM_WINDOW_TYPE_SPLASH")).id) {
	temp[i++] = ((Atom) Atom.intern(display,
		"_NET_WM_STATE_SKIP_TASKBAR")).id;
	break;
    }
    if (client.getNetWindowType() == ((Atom) Atom.intern(display,
	    "_NET_WM_WINDOW_TYPE_UTILITY")).id) {
	temp[i++] = ((Atom) Atom.intern(display,
		"_NET_WM_STATE_SKIP_TASKBAR")).id;
	break;
    }
}
int data[] = new int[i];
for (int j = 0; j < i; j++) {
    data[j] = temp[j];
}
client.change_property(Window.REPLACE, i, netWmState, Atom.ATOM, 32,
	data, 0, 32);
   }
 
开发者ID:josmas,项目名称:openwonderland,代码行数:36,代码来源:X11WindowManagerHints.java

示例6: XWindowPeer

import gnu.x11.Atom; //导入方法依赖的package包/类
XWindowPeer(java.awt.Window window)
{
  super(window);
  XGraphicsDevice dev = XToolkit.getDefaultDevice();

  // TODO: Maybe initialize lazily in show().
  Window.Attributes atts = new Window.Attributes();
  // FIXME: Howto generate a Window without decorations?
  int x = Math.max(window.getX(), 0);
  int y = Math.max(window.getY(), 0);
  int w = Math.max(window.getWidth(), 1);
  int h = Math.max(window.getHeight(), 1);
  xwindow = new Window(dev.getDisplay().default_root, x, y, w, h, 0, atts);
  xwindow.select_input(standardSelect);

  dev.getEventPump().registerWindow(xwindow, window);
  xwindow.set_wm_delete_window();

  boolean undecorated;
  if (awtComponent instanceof Frame)
    {
      Frame f = (Frame) awtComponent;
      undecorated = f.isUndecorated();
    }
  else if (awtComponent instanceof Dialog)
    {
      Dialog d = (Dialog) awtComponent;
      undecorated = d.isUndecorated();
    }
  else
    {
      undecorated = true;
    }
  if (undecorated)
    {
      // First try the Motif implementation of undecorated frames. This
      // is semantically closest and supported by all major window
      // managers.
      // TODO: At the time of writing this, there's no freedesktop.org
      // standard extension that matches the required semantic. Maybe
      // undecorated frames are added in the future, if so, then use these.
      Atom at = Atom.intern(dev.getDisplay(), "_MOTIF_WM_HINTS");
      if (at != null)
        {
          xwindow.change_property(Window.REPLACE, at, at, 32,
                                  new int[]{1 << 1, 0, 0, 0, 0}, 0, 5);
        }
    }
  insets = new Insets(0, 0, 0, 0);
}
 
开发者ID:vilie,项目名称:javify,代码行数:51,代码来源:XWindowPeer.java

示例7: XWindowPeer

import gnu.x11.Atom; //导入方法依赖的package包/类
XWindowPeer(java.awt.Window window)
{
  super(window);
  XGraphicsDevice dev = XToolkit.getDefaultDevice();

  // TODO: Maybe initialize lazily in show().
  Window.Attributes atts = new Window.Attributes();
  // FIXME: Howto generate a Window without decorations?
  int x = Math.max(window.getX(), 0);
  int y = Math.max(window.getY(), 0);
  int w = Math.max(window.getWidth(), 1);
  int h = Math.max(window.getHeight(), 1);
  xwindow = new Window(dev.getDisplay().default_root, x, y, w, h, 0, atts);
  xwindow.select_input(standardSelect);
  
  dev.getEventPump().registerWindow(xwindow, window);
  xwindow.set_wm_delete_window();
  
  boolean undecorated;
  if (awtComponent instanceof Frame)
    {
      Frame f = (Frame) awtComponent;
      undecorated = f.isUndecorated();
    }
  else if (awtComponent instanceof Dialog)
    {
      Dialog d = (Dialog) awtComponent;
      undecorated = d.isUndecorated();
    }
  else
    {
      undecorated = true;
    }
  if (undecorated)
    {
      // First try the Motif implementation of undecorated frames. This
      // is semantically closest and supported by all major window
      // managers.
      // TODO: At the time of writing this, there's no freedesktop.org
      // standard extension that matches the required semantic. Maybe
      // undecorated frames are added in the future, if so, then use these.
      Atom at = Atom.intern(dev.getDisplay(), "_MOTIF_WM_HINTS");
      if (at != null)
        {
          xwindow.change_property(Window.REPLACE, at, at, 32,
                                  new int[]{1 << 1, 0, 0, 0, 0}, 0, 5);
        }
    }
  insets = new Insets(0, 0, 0, 0);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:51,代码来源:XWindowPeer.java

示例8: initX11WindowManagerHint

import gnu.x11.Atom; //导入方法依赖的package包/类
static void initX11WindowManagerHint(Display display) {
netSupported = (Atom) Atom.intern(display, "_NET_SUPPORTED");
netWmName = (Atom) Atom.intern(display, "_NET_WM_NAME");

netSupportingWmCheck = (Atom) Atom.intern(display,
	"_NET_SUPPORTING_WM_CHECK");
windowTypes[0] = (Atom) Atom.intern(display, "_NET_WM_WINDOW_TYPE");
windowTypes[1] = (Atom) Atom.intern(display,
	"_NET_WM_WINDOW_TYPE_NORMAL");
windowTypes[2] = (Atom) Atom.intern(display,
	"_NET_WM_WINDOW_TYPE_DIALOG");
windowTypes[3] = (Atom) Atom.intern(display,
	"_NET_WM_WINDOW_TYPE_SPLASH");
windowTypes[4] = (Atom) Atom.intern(display,
	"_NET_WM_WINDOW_TYPE_DESKTOP");
windowTypes[5] = (Atom) Atom.intern(display,
	"_NET_WM_WINDOW_TYPE_DOCK");
windowTypes[6] = (Atom) Atom.intern(display,
	"_NET_WM_WINDOW_TYPE_TOOLBAR");
windowTypes[7] = (Atom) Atom.intern(display,
	"_NET_WM_WINDOW_TYPE_MENU");
windowTypes[8] = (Atom) Atom.intern(display,
	"_NET_WM_WINDOW_TYPE_UTILITY");

netWmState = (Atom) Atom.intern(display, "_NET_WM_STATE");
wmStates[0] = (Atom) Atom.intern(display, "_NET_WM_STATE_ABOVE");
wmStates[1] = (Atom) Atom.intern(display, "_NET_WM_STATE_BELOW");
wmStates[2] = (Atom) Atom.intern(display, "_NET_WM_STATE_MODAL");
wmStates[3] = (Atom) Atom.intern(display,
	"_NET_WM_STATE_SKIP_TASKBAR");

netallowedAction = (Atom) Atom.intern(display,
	"_NET_WM_ALLOWED_ACTIONS");
allowedActions[0] = (Atom) Atom.intern(display,
	"_NET_WM_ACTION_CLOSE");
allowedActions[1] = (Atom) Atom.intern(display,
	"_NET_WM_ACTION_MINIMIZE");
allowedActions[2] = (Atom) Atom
	.intern(display, "_NET_WM_ACTION_MOVE");
allowedActions[3] = (Atom) Atom.intern(display,
	"_NET_WM_ACTION_RESIZE");
   }
 
开发者ID:josmas,项目名称:openwonderland,代码行数:43,代码来源:X11WindowManagerHints.java


注:本文中的gnu.x11.Atom.intern方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。