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


Java InternalFrameListener类代码示例

本文整理汇总了Java中javax.swing.event.InternalFrameListener的典型用法代码示例。如果您正苦于以下问题:Java InternalFrameListener类的具体用法?Java InternalFrameListener怎么用?Java InternalFrameListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: addInternalFrameListener

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
/**
 * Maps
 * {@code JInternalFrame.addInternalFrameListener(InternalFrameListener)}
 * through queue
 */
public void addInternalFrameListener(final InternalFrameListener internalFrameListener) {
    runMapping(new MapVoidAction("addInternalFrameListener") {
        @Override
        public void map() {
            ((JInternalFrame) getSource()).addInternalFrameListener(internalFrameListener);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:JInternalFrameOperator.java

示例2: removeInternalFrameListener

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
/**
 * Maps
 * {@code JInternalFrame.removeInternalFrameListener(InternalFrameListener)}
 * through queue
 */
public void removeInternalFrameListener(final InternalFrameListener internalFrameListener) {
    runMapping(new MapVoidAction("removeInternalFrameListener") {
        @Override
        public void map() {
            ((JInternalFrame) getSource()).removeInternalFrameListener(internalFrameListener);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:JInternalFrameOperator.java

示例3: add

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
@Override
public Component add( Component toadd ) {
	Component frames[] = getAllFrames();
	// we want to stagger the top left corner of the window
	int topleft = CASCADE_STEPSIZE * ( null == frames ? 0 : frames.length );
	Component cmp = super.add( toadd );

	if ( toadd instanceof JInternalFrame ) {
		JInternalFrame jif = JInternalFrame.class.cast( toadd );

		for ( InternalFrameListener ifl : framelisteners ) {
			jif.addInternalFrameListener( ifl );
		}

		if ( null != tblistener ) {
			jif.addInternalFrameListener( tblistener );
			jif.pack();

			Dimension paneSize = getSize();
			toadd.setSize( paneSize.width - topleft, paneSize.height - topleft );
			toadd.setLocation( topleft, topleft );

			if ( jif instanceof PlaySheetFrame ) {
				PlaySheetFrame psf = PlaySheetFrame.class.cast(  jif );
				
				psf.addChangeListener( tblistener );
				
				psf.addedToDesktop( this );
			}

			toadd.setVisible( true );
		}
	}

	return cmp;
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:37,代码来源:CustomDesktopPane.java

示例4: backupProperties

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
private void backupProperties(JInternalFrame frame) {
oldDefaultCloseOperation = frame.getDefaultCloseOperation();
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
oldInternalFrameListeners = frame.getInternalFrameListeners();
for (InternalFrameListener listener : oldInternalFrameListeners) {
  frame.removeInternalFrameListener(listener);
}
 }
 
开发者ID:caduandrade,项目名称:japura-gui,代码行数:9,代码来源:Modal.java

示例5: getPaletteInternalWindow

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
/**
 * Get a layer's associated palette as an internal window
 * 
 * @param gui the Component to place in the window
 * @param ifl the listener to associate with the palette
 * @return the frame that the palette is in
 */
public static JInternalFrame getPaletteInternalWindow(
                                                      Component gui,
                                                      String windowName,
                                                      InternalFrameListener ifl) {

    JInternalFrame paletteWindow;

    // create the palette's scroll pane
    JScrollPane scrollPane = new JScrollPane(gui, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
    scrollPane.setAlignmentY(Component.TOP_ALIGNMENT);

    // create the palette internal window
    paletteWindow = new JInternalFrame(windowName, true, //resizable
            true, //closable
            false, //maximizable
            true //iconifiable
    );

    // add a window listener that destroys the palette when
    // the window is closed
    paletteWindow.addInternalFrameListener(ifl);
    paletteWindow.getContentPane().add(scrollPane);
    paletteWindow.setOpaque(true);

    //layout all the components
    paletteWindow.pack();

    return paletteWindow;
}
 
开发者ID:d2fn,项目名称:passage,代码行数:38,代码来源:PaletteHelper.java

示例6: fireInternalFrameEvent

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
/**
 * Fires the internal frame event.
 *
 * @param id identifier of the event to fire
 */
protected void fireInternalFrameEvent(final int id) {
    Object[] listeners = listenerList.getListenerList();
    InternalFrameEvent e = null;
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == InternalFrameListener.class) {
            if (e == null) {
                e = new InternalFrameEvent(this, id);
            }
            InternalFrameListener l = (InternalFrameListener) listeners[i + 1];
            switch (id) {
                case InternalFrameEvent.INTERNAL_FRAME_ACTIVATED:
                    l.internalFrameActivated(e);
                    break;
                case InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED:
                    l.internalFrameDeactivated(e);
                    break;
                case InternalFrameEvent.INTERNAL_FRAME_ICONIFIED:
                    l.internalFrameIconified(e);
                    break;
                case InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED:
                    l.internalFrameDeiconified(e);
                    break;
                case InternalFrameEvent.INTERNAL_FRAME_CLOSING:
                    l.internalFrameClosing(e);
                    break;
                case InternalFrameEvent.INTERNAL_FRAME_OPENED:
                    l.internalFrameOpened(e);
                    break;
                case InternalFrameEvent.INTERNAL_FRAME_CLOSED:
                    l.internalFrameClosed(e);
                    break;
            }
        }
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:41,代码来源:JInternalFrame.java

示例7: postClosingEvent

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
protected void postClosingEvent(final JInternalFrame frame) {
    // this method seems to be unused
    Object[] listeners = frame.getListeners(InternalFrameListener.class);
    InternalFrameEvent e = null;

    for (int i = 0; i < listeners.length; i++) {
        if (e == null) {
            e = new InternalFrameEvent(
                frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
        }
        ((InternalFrameListener)listeners[i]).internalFrameClosing(e);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:14,代码来源:BasicInternalFrameTitlePane.java

示例8: testAddRemoveGetInternalFrameListener

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
public void testAddRemoveGetInternalFrameListener() {
    InternalFrameListener l = new MyInternalFrameListener();
    frame.addInternalFrameListener(l);
    InternalFrameListener[] listeners = frame.getInternalFrameListeners();
    assertTrue("listener was added", contains(listeners, l));
    frame.removeInternalFrameListener(l);
    listeners = frame.getInternalFrameListeners();
    assertFalse("listener was removed", contains(listeners, l));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:JInternalFrameTest.java

示例9: addInternalFrameListener

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
@Override
public void addInternalFrameListener(InternalFrameListener l) {
    super.addInternalFrameListener(l);
}
 
开发者ID:openea,项目名称:eva2,代码行数:5,代码来源:JEFrame.java

示例10: addInternalFrameListener

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
public void addInternalFrameListener(InternalFrameListener l) {
	list.add(InternalFrameListener.class, l);
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:4,代码来源:JInternalFrame.java

示例11: removeInternalFrameListener

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
public void removeInternalFrameListener(InternalFrameListener l) {
	list.remove(InternalFrameListener.class, l);
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:4,代码来源:JInternalFrame.java

示例12: getInternalFrameListeners

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
public InternalFrameListener[] getInternalFrameListeners() {
	return list.getListeners(InternalFrameListener.class);
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:4,代码来源:JInternalFrame.java

示例13: fireInternalFrameEvent

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
/**
 * This method fires an InternalFrameEvent to the listeners.
 *
 * @param id The type of event being fired. See InternalFrameEvent.
 */
protected void fireInternalFrameEvent(int id)
{
  Object[] ifListeners = listenerList.getListenerList();
  InternalFrameEvent evt = new InternalFrameEvent(this, id);
  switch (id)
    {
    case InternalFrameEvent.INTERNAL_FRAME_CLOSING:
      for (int i = ifListeners.length - 2; i >= 0; i -= 2)
        {
          if (ifListeners[i] == InternalFrameListener.class)
            ((InternalFrameListener) ifListeners[i + 1])
            .internalFrameClosing(evt);
        }
      break;
    case InternalFrameEvent.INTERNAL_FRAME_ACTIVATED:
      for (int i = ifListeners.length - 2; i >= 0; i -= 2)
        {
          if (ifListeners[i] == InternalFrameListener.class)
            ((InternalFrameListener) ifListeners[i + 1])
            .internalFrameActivated(evt);
        }
      break;
    case InternalFrameEvent.INTERNAL_FRAME_CLOSED:
      for (int i = ifListeners.length - 2; i >= 0; i -= 2)
        {
          if (ifListeners[i] == InternalFrameListener.class)
            ((InternalFrameListener) ifListeners[i + 1]).internalFrameClosed(evt);
        }
      break;
    case InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED:
      for (int i = ifListeners.length - 2; i >= 0; i -= 2)
        {
          if (ifListeners[i] == InternalFrameListener.class)
            ((InternalFrameListener) ifListeners[i + 1])
            .internalFrameDeactivated(evt);
        }
      break;
    case InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED:
      for (int i = ifListeners.length - 2; i >= 0; i -= 2)
        {
          if (ifListeners[i] == InternalFrameListener.class)
            ((InternalFrameListener) ifListeners[i + 1])
            .internalFrameDeiconified(evt);
        }
      break;
    case InternalFrameEvent.INTERNAL_FRAME_ICONIFIED:
      for (int i = ifListeners.length - 2; i >= 0; i -= 2)
        {
          if (ifListeners[i] == InternalFrameListener.class)
            ((InternalFrameListener) ifListeners[i + 1])
            .internalFrameIconified(evt);
        }
      break;
    case InternalFrameEvent.INTERNAL_FRAME_OPENED:
      for (int i = ifListeners.length - 2; i >= 0; i -= 2)
        {
          if (ifListeners[i] == InternalFrameListener.class)
            ((InternalFrameListener) ifListeners[i + 1]).internalFrameOpened(evt);
        }
      break;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:68,代码来源:JInternalFrame.java

示例14: fireInternalFrameEvent

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
/**
  * This method fires an InternalFrameEvent to the listeners.
  *
  * @param id The type of event being fired. See InternalFrameEvent.
  */
 protected void fireInternalFrameEvent(int id)
 {
   Object[] ifListeners = listenerList.getListenerList();
   InternalFrameEvent evt = new InternalFrameEvent(this, id);
   switch (id)
     {
     case InternalFrameEvent.INTERNAL_FRAME_CLOSING:
for (int i = ifListeners.length - 2; i >= 0; i -= 2)
  {
    if (ifListeners[i] == InternalFrameListener.class)
      ((InternalFrameListener) ifListeners[i + 1])
      .internalFrameClosing(evt);
  }
break;
     case InternalFrameEvent.INTERNAL_FRAME_ACTIVATED:
for (int i = ifListeners.length - 2; i >= 0; i -= 2)
  {
    if (ifListeners[i] == InternalFrameListener.class)
      ((InternalFrameListener) ifListeners[i + 1])
      .internalFrameActivated(evt);
  }
break;
     case InternalFrameEvent.INTERNAL_FRAME_CLOSED:
for (int i = ifListeners.length - 2; i >= 0; i -= 2)
  {
    if (ifListeners[i] == InternalFrameListener.class)
      ((InternalFrameListener) ifListeners[i + 1]).internalFrameClosed(evt);
  }
break;
     case InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED:
for (int i = ifListeners.length - 2; i >= 0; i -= 2)
  {
    if (ifListeners[i] == InternalFrameListener.class)
      ((InternalFrameListener) ifListeners[i + 1])
      .internalFrameDeactivated(evt);
  }
break;
     case InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED:
for (int i = ifListeners.length - 2; i >= 0; i -= 2)
  {
    if (ifListeners[i] == InternalFrameListener.class)
      ((InternalFrameListener) ifListeners[i + 1])
      .internalFrameDeiconified(evt);
  }
break;
     case InternalFrameEvent.INTERNAL_FRAME_ICONIFIED:
for (int i = ifListeners.length - 2; i >= 0; i -= 2)
  {
    if (ifListeners[i] == InternalFrameListener.class)
      ((InternalFrameListener) ifListeners[i + 1])
      .internalFrameIconified(evt);
  }
break;
     case InternalFrameEvent.INTERNAL_FRAME_OPENED:
for (int i = ifListeners.length - 2; i >= 0; i -= 2)
  {
    if (ifListeners[i] == InternalFrameListener.class)
      ((InternalFrameListener) ifListeners[i + 1]).internalFrameOpened(evt);
  }
break;
     }
 }
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:68,代码来源:JInternalFrame.java

示例15: fireInternalFrameEvent

import javax.swing.event.InternalFrameListener; //导入依赖的package包/类
/**
 * Fires an internal frame event.
 *
 * @param id  the type of the event being fired; one of the following:
 * <ul>
 * <li><code>InternalFrameEvent.INTERNAL_FRAME_OPENED</code>
 * <li><code>InternalFrameEvent.INTERNAL_FRAME_CLOSING</code>
 * <li><code>InternalFrameEvent.INTERNAL_FRAME_CLOSED</code>
 * <li><code>InternalFrameEvent.INTERNAL_FRAME_ICONIFIED</code>
 * <li><code>InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED</code>
 * <li><code>InternalFrameEvent.INTERNAL_FRAME_ACTIVATED</code>
 * <li><code>InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED</code>
 * </ul>
 * If the event type is not one of the above, nothing happens.
 */
protected void fireInternalFrameEvent(int id){
  Object[] listeners = listenerList.getListenerList();
  InternalFrameEvent e = null;
  for (int i = listeners.length -2; i >=0; i -= 2){
    if (listeners[i] == InternalFrameListener.class){
      if (e == null){
        e = new InternalFrameEvent(this, id);
        //      System.out.println("InternalFrameEvent: " + e.paramString());
      }
      switch(e.getID()) {
      case InternalFrameEvent.INTERNAL_FRAME_OPENED:
        ((InternalFrameListener)listeners[i+1]).internalFrameOpened(e);
        break;
      case InternalFrameEvent.INTERNAL_FRAME_CLOSING:
        ((InternalFrameListener)listeners[i+1]).internalFrameClosing(e);
        break;
      case InternalFrameEvent.INTERNAL_FRAME_CLOSED:
        ((InternalFrameListener)listeners[i+1]).internalFrameClosed(e);
        break;
      case InternalFrameEvent.INTERNAL_FRAME_ICONIFIED:
        ((InternalFrameListener)listeners[i+1]).internalFrameIconified(e);
        break;
      case InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED:
        ((InternalFrameListener)listeners[i+1]).internalFrameDeiconified(e);
        break;
      case InternalFrameEvent.INTERNAL_FRAME_ACTIVATED:
        ((InternalFrameListener)listeners[i+1]).internalFrameActivated(e);
        break;
      case InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED:
        ((InternalFrameListener)listeners[i+1]).internalFrameDeactivated(e);
        break;
      default:
        break;
      }
    }
  }
  /* we could do it off the event, but at the moment, that's not how
     I'm implementing it */
  //      if (id == InternalFrameEvent.INTERNAL_FRAME_CLOSING) {
  //          doDefaultCloseAction();
  //      }
}
 
开发者ID:infobip,项目名称:infobip-open-jdk-8,代码行数:58,代码来源:JInternalFrame.java


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