當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。