Java 类java.awt.AWTError 实例源码

项目:jNotifyOSD    文件:ServerOSD.java   
private Dimension getDeviceDimension() {
    Dimension deviceDimension = null;
    try {
        Toolkit tool = Toolkit.getDefaultToolkit();
        deviceDimension = tool.getScreenSize();
    } catch (AWTError e) {
        System.out.println(CLASS_NAME+": ERROR! "+ e.getMessage());
        e.printStackTrace();
    }
    return deviceDimension;
}
项目:javify    文件:BoxLayout.java   
/**
 * Lays out the specified container using this layout.
 *
 * @param parent The container that needs to be laid out.
 */
public void layoutContainer(Container parent)
{
  synchronized (container.getTreeLock())
    {
      if (container != parent)
        throw new AWTError("BoxLayout can't be shared");

      checkLayout();
      Component[] children = container.getComponents();
      Insets in = container.getInsets();
      for (int i = 0; i < children.length; i++)
        children[i].setBounds(offsetsX[i] + in.left, offsetsY[i] + in.top,
                              spansX[i], spansY[i]);
    }
}
项目:javify    文件:BoxLayout.java   
/**
 * Invalidates the layout.
 *
 * @param parent The container that needs to be laid out.
 */
public void invalidateLayout(Container parent)
{
  if (container != parent)
    throw new AWTError("BoxLayout can't be shared");

  synchronized (container.getTreeLock())
    {
      xChildren = null;
      yChildren = null;
      xTotal = null;
      yTotal = null;
      offsetsX = null;
      offsetsY = null;
      spansX = null;
      spansY = null;
    }
}
项目:javify    文件:BoxLayout.java   
/**
 * Returns the maximum size of the layout gived the components
 * in the given container.
 *
 * @param parent The container that needs to be laid out.
 *
 * @return The dimension of the layout.
 */
public Dimension maximumLayoutSize(Container parent)
{
  synchronized (container.getTreeLock())
    {
      if (container != parent)
        throw new AWTError("BoxLayout can't be shared");

      checkTotalRequirements();
      Insets i = container.getInsets();
      int xDim = xTotal.maximum + i.left + i.right;
      int yDim = yTotal.maximum + i.top + i.bottom;

      // Check for overflow
      if (xDim < xTotal.maximum)
        xDim = Integer.MAX_VALUE;
      if (yDim < yTotal.maximum)
        yDim = Integer.MAX_VALUE;
      return new Dimension(xDim, yDim);
    }
}
项目:javify    文件:XFontPeer.java   
/**
 * Initializes the font peer with the specified attributes. This method is
 * called from both constructors.
 *
 * @param name the font name
 * @param style the font style
 * @param size the font size
 */
private void init(String name, int style, int size)
{
  if (name == null)
    {
      name = "SansSerif";
    }
  GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice dev = env.getDefaultScreenDevice();
  if (dev instanceof XGraphicsDevice)
    {
      Display display = ((XGraphicsDevice) dev).getDisplay();
      String fontDescr = encodeFont(name, style, size);
      if (XToolkit.DEBUG)
        System.err.println("XLFD font description: " + fontDescr);
      xfont = new gnu.x11.Font(display, fontDescr);
    }
  else
    {
      throw new AWTError("Local GraphicsEnvironment is not XWindowGraphicsEnvironment");
    }
}
项目:jvm-stm    文件:BoxLayout.java   
/**
 * Lays out the specified container using this layout.
 *
 * @param parent The container that needs to be laid out.
 */
public void layoutContainer(Container parent)
{
  synchronized (container.getTreeLock())
    {
      if (container != parent)
        throw new AWTError("BoxLayout can't be shared");

      checkLayout();
      Component[] children = container.getComponents();
      Insets in = container.getInsets();
      for (int i = 0; i < children.length; i++)
        children[i].setBounds(offsetsX[i] + in.left, offsetsY[i] + in.top,
                              spansX[i], spansY[i]);
    }
}
项目:jvm-stm    文件:BoxLayout.java   
/**
 * Invalidates the layout.
 *
 * @param parent The container that needs to be laid out.
 */
public void invalidateLayout(Container parent)
{
  if (container != parent)
    throw new AWTError("BoxLayout can't be shared");

  synchronized (container.getTreeLock())
    {
      xChildren = null;
      yChildren = null;
      xTotal = null;
      yTotal = null;
      offsetsX = null;
      offsetsY = null;
      spansX = null;
      spansY = null;
    }
}
项目:jvm-stm    文件:BoxLayout.java   
/**
 * Returns the maximum size of the layout gived the components
 * in the given container.
 *
 * @param parent The container that needs to be laid out.
 *
 * @return The dimension of the layout.
 */
public Dimension maximumLayoutSize(Container parent)
{
  synchronized (container.getTreeLock())
    {
      if (container != parent)
        throw new AWTError("BoxLayout can't be shared");

      checkTotalRequirements();
      Insets i = container.getInsets();
      int xDim = xTotal.maximum + i.left + i.right;
      int yDim = yTotal.maximum + i.top + i.bottom;

      // Check for overflow
      if (xDim < xTotal.maximum)
        xDim = Integer.MAX_VALUE;
      if (yDim < yTotal.maximum)
        yDim = Integer.MAX_VALUE;
      return new Dimension(xDim, yDim);
    }
}
项目:jvm-stm    文件:XFontPeer.java   
/**
 * Initializes the font peer with the specified attributes. This method is
 * called from both constructors.
 *
 * @param name the font name
 * @param style the font style
 * @param size the font size
 */
private void init(String name, int style, int size)
{
  if (name == null)
    {
      name = "SansSerif";
    }
  GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice dev = env.getDefaultScreenDevice();
  if (dev instanceof XGraphicsDevice)
    {
      Display display = ((XGraphicsDevice) dev).getDisplay();
      String fontDescr = encodeFont(name, style, size);
      if (XToolkit.DEBUG)
        System.err.println("XLFD font description: " + fontDescr);
      xfont = new gnu.x11.Font(display, fontDescr);
    }
  else
    {
      throw new AWTError("Local GraphicsEnvironment is not XWindowGraphicsEnvironment");
    }
}
项目:cn1    文件:BoxLayout.java   
private int axisToAlignment(final Container target, final int axis) throws AWTError {
    int alignment = LayoutParameters.HORIZONTAL_ALIGNMENT;
    if (axis == X_AXIS) {
        alignment = LayoutParameters.HORIZONTAL_ALIGNMENT;
    } else if (axis == Y_AXIS) {
        alignment = LayoutParameters.VERTICAL_ALIGNMENT;
    } else if (axis == LINE_AXIS) {
        if (target != null) {
            alignment = target.getComponentOrientation().isHorizontal() ? LayoutParameters.HORIZONTAL_ALIGNMENT
                    : LayoutParameters.VERTICAL_ALIGNMENT;
        }
    } else if (axis == PAGE_AXIS) {
        if (target != null) {
            alignment = target.getComponentOrientation().isHorizontal() ? LayoutParameters.VERTICAL_ALIGNMENT
                    : LayoutParameters.HORIZONTAL_ALIGNMENT;
        }
    } else {
        throw new AWTError(Messages.getString("swing.err.04")); //$NON-NLS-1$
    }
    return alignment;
}
项目:JamVM-PH    文件:BoxLayout.java   
/**
 * Lays out the specified container using this layout.
 *
 * @param parent The container that needs to be laid out.
 */
public void layoutContainer(Container parent)
{
  synchronized (container.getTreeLock())
    {
      if (container != parent)
        throw new AWTError("BoxLayout can't be shared");

      checkLayout();
      Component[] children = container.getComponents();
      Insets in = container.getInsets();
      for (int i = 0; i < children.length; i++)
        children[i].setBounds(offsetsX[i] + in.left, offsetsY[i] + in.top,
                              spansX[i], spansY[i]);
    }
}
项目:JamVM-PH    文件:BoxLayout.java   
/**
 * Invalidates the layout.
 *
 * @param parent The container that needs to be laid out.
 */
public void invalidateLayout(Container parent)
{
  if (container != parent)
    throw new AWTError("BoxLayout can't be shared");

  synchronized (container.getTreeLock())
    {
      xChildren = null;
      yChildren = null;
      xTotal = null;
      yTotal = null;
      offsetsX = null;
      offsetsY = null;
      spansX = null;
      spansY = null;
    }
}
项目:JamVM-PH    文件:BoxLayout.java   
/**
 * Returns the maximum size of the layout gived the components
 * in the given container.
 *
 * @param parent The container that needs to be laid out.
 *
 * @return The dimension of the layout.
 */
public Dimension maximumLayoutSize(Container parent)
{
  synchronized (container.getTreeLock())
    {
      if (container != parent)
        throw new AWTError("BoxLayout can't be shared");

      checkTotalRequirements();
      Insets i = container.getInsets();
      int xDim = xTotal.maximum + i.left + i.right;
      int yDim = yTotal.maximum + i.top + i.bottom;

      // Check for overflow
      if (xDim < xTotal.maximum)
        xDim = Integer.MAX_VALUE;
      if (yDim < yTotal.maximum)
        yDim = Integer.MAX_VALUE;
      return new Dimension(xDim, yDim);
    }
}
项目:JamVM-PH    文件:XFontPeer.java   
/**
 * Initializes the font peer with the specified attributes. This method is
 * called from both constructors.
 *
 * @param name the font name
 * @param style the font style
 * @param size the font size
 */
private void init(String name, int style, int size)
{
  if (name == null)
    {
      name = "SansSerif";
    }
  GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice dev = env.getDefaultScreenDevice();
  if (dev instanceof XGraphicsDevice)
    {
      Display display = ((XGraphicsDevice) dev).getDisplay();
      String fontDescr = encodeFont(name, style, size);
      if (XToolkit.DEBUG)
        System.err.println("XLFD font description: " + fontDescr);
      xfont = new gnu.x11.Font(display, fontDescr);
    }
  else
    {
      throw new AWTError("Local GraphicsEnvironment is not XWindowGraphicsEnvironment");
    }
}
项目:awtonandroid    文件:FreetypeFontPeer.java   
public FreetypeFontPeer(String name, Map<?, ?> attrs) {
    super(name, attrs);
    nativefont = createfont();
    System.out.println("native font: "+nativefont);
    if(nativefont == 0){
        throw new AWTError("errorr while allocating memory for freetype font");
    }
    int error = initFont(nativefont, "/system/fonts/DroidSans.ttf");
    System.out.println("init font error code "+error);
    if(error != 0){
        throw new AWTError("an error occurred during font initialization: error code " + error);
    }
    error = setsize(nativefont, (int) this.size);
    System.out.println("resize error code "+error);
    if(error != 0){
        throw new AWTError("an error occurred during font resize: error code " + error);
    }
}
项目:classpath    文件:BoxLayout.java   
/**
 * Lays out the specified container using this layout.
 *
 * @param parent The container that needs to be laid out.
 */
public void layoutContainer(Container parent)
{
  synchronized (container.getTreeLock())
    {
      if (container != parent)
        throw new AWTError("BoxLayout can't be shared");

      checkLayout();
      Component[] children = container.getComponents();
      Insets in = container.getInsets();
      for (int i = 0; i < children.length; i++)
        children[i].setBounds(offsetsX[i] + in.left, offsetsY[i] + in.top,
                              spansX[i], spansY[i]);
    }
}
项目:classpath    文件:BoxLayout.java   
/**
 * Invalidates the layout.
 *
 * @param parent The container that needs to be laid out.
 */
public void invalidateLayout(Container parent)
{
  if (container != parent)
    throw new AWTError("BoxLayout can't be shared");

  synchronized (container.getTreeLock())
    {
      xChildren = null;
      yChildren = null;
      xTotal = null;
      yTotal = null;
      offsetsX = null;
      offsetsY = null;
      spansX = null;
      spansY = null;
    }
}
项目:classpath    文件:BoxLayout.java   
/**
 * Returns the maximum size of the layout gived the components
 * in the given container.
 *
 * @param parent The container that needs to be laid out.
 *
 * @return The dimension of the layout.
 */
public Dimension maximumLayoutSize(Container parent)
{
  synchronized (container.getTreeLock())
    {
      if (container != parent)
        throw new AWTError("BoxLayout can't be shared");

      checkTotalRequirements();
      Insets i = container.getInsets();
      int xDim = xTotal.maximum + i.left + i.right;
      int yDim = yTotal.maximum + i.top + i.bottom;

      // Check for overflow
      if (xDim < xTotal.maximum)
        xDim = Integer.MAX_VALUE;
      if (yDim < yTotal.maximum)
        yDim = Integer.MAX_VALUE;
      return new Dimension(xDim, yDim);
    }
}
项目:classpath    文件:XFontPeer.java   
/**
 * Initializes the font peer with the specified attributes. This method is
 * called from both constructors.
 *
 * @param name the font name
 * @param style the font style
 * @param size the font size
 */
private void init(String name, int style, int size)
{
  if (name == null)
    {
      name = "SansSerif";
    }
  GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice dev = env.getDefaultScreenDevice();
  if (dev instanceof XGraphicsDevice)
    {
      Display display = ((XGraphicsDevice) dev).getDisplay();
      String fontDescr = encodeFont(name, style, size);
      if (XToolkit.DEBUG)
        System.err.println("XLFD font description: " + fontDescr);
      xfont = new gnu.x11.Font(display, fontDescr);
    }
  else
    {
      throw new AWTError("Local GraphicsEnvironment is not XWindowGraphicsEnvironment");
    }
}
项目:freeVM    文件:BoxLayout.java   
private int axisToAlignment(final Container target, final int axis) throws AWTError {
    int alignment = LayoutParameters.HORIZONTAL_ALIGNMENT;
    if (axis == X_AXIS) {
        alignment = LayoutParameters.HORIZONTAL_ALIGNMENT;
    } else if (axis == Y_AXIS) {
        alignment = LayoutParameters.VERTICAL_ALIGNMENT;
    } else if (axis == LINE_AXIS) {
        if (target != null) {
            alignment = target.getComponentOrientation().isHorizontal() ? LayoutParameters.HORIZONTAL_ALIGNMENT
                    : LayoutParameters.VERTICAL_ALIGNMENT;
        }
    } else if (axis == PAGE_AXIS) {
        if (target != null) {
            alignment = target.getComponentOrientation().isHorizontal() ? LayoutParameters.VERTICAL_ALIGNMENT
                    : LayoutParameters.HORIZONTAL_ALIGNMENT;
        }
    } else {
        throw new AWTError(Messages.getString("swing.err.04")); //$NON-NLS-1$
    }
    return alignment;
}
项目:freeVM    文件:BoxLayout.java   
private int axisToAlignment(final Container target, final int axis) throws AWTError {
    int alignment = LayoutParameters.HORIZONTAL_ALIGNMENT;
    if (axis == X_AXIS) {
        alignment = LayoutParameters.HORIZONTAL_ALIGNMENT;
    } else if (axis == Y_AXIS) {
        alignment = LayoutParameters.VERTICAL_ALIGNMENT;
    } else if (axis == LINE_AXIS) {
        if (target != null) {
            alignment = target.getComponentOrientation().isHorizontal() ? LayoutParameters.HORIZONTAL_ALIGNMENT
                    : LayoutParameters.VERTICAL_ALIGNMENT;
        }
    } else if (axis == PAGE_AXIS) {
        if (target != null) {
            alignment = target.getComponentOrientation().isHorizontal() ? LayoutParameters.VERTICAL_ALIGNMENT
                    : LayoutParameters.HORIZONTAL_ALIGNMENT;
        }
    } else {
        throw new AWTError(Messages.getString("swing.err.04")); //$NON-NLS-1$
    }
    return alignment;
}
项目:OpenJSharp    文件:SunGraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
项目:OpenJSharp    文件:Win32GraphicsEnvironment.java   
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:OpenJSharp    文件:X11GraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:jdk8u-jdk    文件:SunGraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
项目:jdk8u-jdk    文件:Win32GraphicsEnvironment.java   
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:jdk8u-jdk    文件:X11GraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:openjdk-jdk10    文件:SunGraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
项目:openjdk-jdk10    文件:X11GraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:openjdk-jdk10    文件:Win32GraphicsEnvironment.java   
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:openjdk9    文件:SunGraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
项目:openjdk9    文件:X11GraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:openjdk9    文件:Win32GraphicsEnvironment.java   
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:jdk8u_jdk    文件:SunGraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
项目:jdk8u_jdk    文件:CThreading.java   
public static void executeOnAppKit(Runnable command) {
    if (!isAppKit()) {
        Dispatch dispatch = Dispatch.getInstance();

        if (dispatch != null) {
            dispatch.getNonBlockingMainQueueExecutor().execute(command);
        }
        else {
            throw new AWTError("Could not get Dispatch object");
        }
    } else
        command.run();
}
项目:jdk8u_jdk    文件:Win32GraphicsEnvironment.java   
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:jdk8u_jdk    文件:X11GraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:lookaside_java-1.8.0-openjdk    文件:SunGraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
项目:lookaside_java-1.8.0-openjdk    文件:Win32GraphicsEnvironment.java   
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
项目:lookaside_java-1.8.0-openjdk    文件:X11GraphicsEnvironment.java   
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}