當前位置: 首頁>>代碼示例>>Java>>正文


Java BasicInternalFrameUI類代碼示例

本文整理匯總了Java中javax.swing.plaf.basic.BasicInternalFrameUI的典型用法代碼示例。如果您正苦於以下問題:Java BasicInternalFrameUI類的具體用法?Java BasicInternalFrameUI怎麽用?Java BasicInternalFrameUI使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BasicInternalFrameUI類屬於javax.swing.plaf.basic包,在下文中一共展示了BasicInternalFrameUI類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initialize

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
/**
	 * Initialize.
	 */
	private void initialize() {
		
		this.setClosable(true);
		this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
		this.setVisible(true);
		this.registerEscapeKeyStroke();
		this.addInternalFrameListener(new InternalFrameAdapter() {
			/* (non-Javadoc)
			 * @see javax.swing.event.InternalFrameAdapter#internalFrameClosing(javax.swing.event.InternalFrameEvent)
			 */
			@Override
			public void internalFrameClosing(InternalFrameEvent ife) {
				projectWindow.tabRestore();
				super.internalFrameClosing(ife);
			}
			/* (non-Javadoc)
			 * @see javax.swing.event.InternalFrameAdapter#internalFrameDeactivated(javax.swing.event.InternalFrameEvent)
			 */
			@Override
			public void internalFrameDeactivated(InternalFrameEvent e) {
//				projectWindow.tabRestore();
				super.internalFrameDeactivated(e);
			}
			
		});
		((BasicInternalFrameUI) this.getUI()).setNorthPane(null);
	
		// --- Add ComponentListener to MainWindow -------- 
		this.addComponentListenerOfMainWindow();
		
	}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:35,代碼來源:MaximizedTab.java

示例2: setMaximized

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
/**
 * Maximise the Project-Window within the AgenGUI-Application
 */
public void setMaximized() {

	MainWindow mainWindow = Application.getMainWindow();
	if (mainWindow != null) {
		// --- Validate the main application window -----------------
		mainWindow.validate();
		// --- Be sure that everything is there as needed -----------
		if (this.getParent() != null) {
			((BasicInternalFrameUI) this.getUI()).setNorthPane(null);
			DesktopManager dtm = mainWindow.getJDesktopPane4Projects().getDesktopManager();
			if (dtm != null) {
				dtm.maximizeFrame(this);
			}
		}
		mainWindow.setCloseButtonPosition(true);
	}
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:21,代碼來源:ProjectWindow.java

示例3: initialize

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
/**
 * This method initializes this
 * @return void
 */
private void initialize() {
	
	this.setAutoscrolls(true);
	this.setMaximizable(true);
	this.setResizable(true);
	this.setIconifiable(true);

	this.setClosable(true);
	this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
	
	this.setTitle("Component");
	
	// --- Remove Frame menu ----------------
	BasicInternalFrameUI ui = (BasicInternalFrameUI)this.getUI();
	ui.getNorthPane().remove(0);
	
	this.addInternalFrameListener(new InternalFrameAdapter() {
		@Override
		public void internalFrameClosing(InternalFrameEvent ife) {
			doClose();
		}
	});
	
	this.configureForGraphObject();
	this.setContentPane(this.getJContentPane());
	this.setSize(this.defaultWidth, this.defaultHeight);
	this.setInitialSizeAndPosition();
	
	// --- Call to the super-class ----------
	this.registerAtDesktopAndSetVisible();
	
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:37,代碼來源:BasicGraphGuiProperties.java

示例4: setContent

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
public void setContent(JComponent content) {
	JInternalFrame frame = new JInternalFrame("") {
		private static final long serialVersionUID = 1L;

		@Override
		public void updateUI() {
			super.updateUI();
			setBorder(null);
			BasicInternalFrameUI bi = (BasicInternalFrameUI) getUI();
			bi.setNorthPane(null);
		}
	};
	frame.setLayout(new BorderLayout());
	frame.add(content, BorderLayout.CENTER);
	add(frame);
	frame.setVisible(true);
	try {
		frame.setMaximum(true);
	} catch (PropertyVetoException e) {
		LOG.log(Level.WARNING, e.getLocalizedMessage(), e);
	}
}
 
開發者ID:BrunoEberhard,項目名稱:minimal-j,代碼行數:23,代碼來源:EditablePanel.java

示例5: NabInternalFrame

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
public NabInternalFrame(String title) {
    super(title);
    
    listeners = new LinkedList();
    isDetached = false;
    
    createMenu();
    setMaximizable(true);
    setClosable(true);
    setIconifiable(true);
    setResizable(true);
    
    BasicInternalFrameUI ui = (BasicInternalFrameUI)getUI();
    if(ui != null && ui.getNorthPane() != null){
        ui.getNorthPane().addMouseListener(new MListener());
    }
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:18,代碼來源:NabInternalFrame.java

示例6: NabInternalFrame

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
public NabInternalFrame(String title) {
    super(title);
    
    listeners = new LinkedList();
    isDetached = false;
    
    createMenu();
    setMaximizable(true);
    setClosable(true);
    setIconifiable(true);
    setResizable(true);
    
    BasicInternalFrameUI ui = (BasicInternalFrameUI)getUI();
    if(ui != null && ui.getNorthPane() != null){
        ui.getNorthPane().addMouseListener(new MListener());
    }
    //this.getRootPane().addMouseListener(new MListener());
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:19,代碼來源:NabInternalFrame.java

示例7: addFrame

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
private static void addFrame(JDesktopPane desktop, int idx) {
    String titleAlignment = idx == 0 ? "CENTER" : "LEADING";
    JInternalFrame frame = new JInternalFrame("title: " + titleAlignment, true, true, true, true);

    BasicInternalFrameUI ui = (BasicInternalFrameUI) frame.getUI();
    JComponent titleBar = (JComponent) ui.getNorthPane();
    UIDefaults d = new UIDefaults();
    d.put("InternalFrame:InternalFrameTitlePane.titleAlignment", titleAlignment);
    titleBar.putClientProperty("Nimbus.Overrides", d);

    frame.add(makePanel());
    frame.setSize(240, 100);
    frame.setVisible(true);
    frame.setLocation(10 + 60 * idx, 10 + 120 * idx);
    desktop.add(frame);
    desktop.getDesktopManager().activateFrame(frame);
}
 
開發者ID:aterai,項目名稱:java-swing-tips,代碼行數:18,代碼來源:MainPanel.java

示例8: initialize

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
/**
 * This method initializes this.
 */
private void initialize() {

	this.setSize(850, 500);
	this.setContentPane(this.getJSplitPaneProjectView());
	this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
	this.setClosable(true);
	this.setMaximizable(true);
	this.setResizable(false);
	this.setAutoscrolls(true);
	this.setBorder(null);
	this.setFocusable(true);
	((BasicInternalFrameUI) this.getUI()).setNorthPane(null);
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:17,代碼來源:ProjectWindow.java

示例9: initialize

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
/**
   * This method initializes this
   * @return void
   */
  private void initialize() {

  	this.setContentPane(getJSplitPaneContent());
this.setTitle("Add Network Component");
this.setBounds(new Rectangle(0, 0, 240, 410));
this.setTitle(Language.translate(this.getTitle(), Language.EN));
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.registerEscapeKeyStroke();

this.setClosable(true);
this.setMaximizable(false);
this.setIconifiable(false);

this.setAutoscrolls(true);
this.setResizable(true);

BasicInternalFrameUI ui = (BasicInternalFrameUI)this.getUI();
ui.getNorthPane().remove(0);

// --- Call to the super-class ----------
if (this.isHiddenFactory==false) {
	this.registerAtDesktopAndSetVisible();	
	this.graphDesktop.addComponentListener(this.getComponentAdapter4Desktop());
}

  }
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:31,代碼來源:AddComponentDialog.java

示例10: WelcomeTab

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
/**
 * @param pNewFileMenu The NewFileMenu to link to the WelcomeTab.
 * @param pRecentFileMenu The RecentFileMenu to link to the WelcomeTab.
 */
public WelcomeTab(JMenu pNewFileMenu, JMenu pRecentFileMenu)
{
	aWelcomeResources = ResourceBundle.getBundle("ca.mcgill.cs.jetuml.gui.EditorStrings");
	aLeftPanelIcon = new ImageIcon(getClass().getClassLoader().getResource(aWelcomeResources.getString("welcome.create.icon")));
	aRightPanelIcon = new ImageIcon(getClass().getClassLoader().getResource(aWelcomeResources.getString("welcome.open.icon"))); 
    setOpaque(false);
    setLayout(new BorderLayout());
    
    BasicInternalFrameUI ui = (BasicInternalFrameUI)getUI();
    Container north = ui.getNorthPane();
    north.remove(0);
    north.validate();
    north.repaint();

    aNewFileMenu = pNewFileMenu;
    aRecentFileMenu = pRecentFileMenu;
    JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());
    panel.setOpaque(false);

    JPanel shortcutPanel = new JPanel();
    shortcutPanel.setOpaque(false);
    shortcutPanel.setLayout(new GridLayout(2, 2));
    shortcutPanel.add(getLeftTitlePanel());
    shortcutPanel.add(getRightTitlePanel());
    shortcutPanel.add(getLeftPanel());
    shortcutPanel.add(getRightPanel());
    GridBagConstraints c = new GridBagConstraints();
    c.anchor = GridBagConstraints.NORTH;
    c.weightx = 1;
    c.gridx = 0;
    c.gridy = 1;
    panel.add(shortcutPanel, c);

    add(panel, BorderLayout.NORTH);
    add(getFootTextPanel(), BorderLayout.SOUTH);
    setComponentPopupMenu( null ); // Removes the system pop-up menu full of disabled buttons.
}
 
開發者ID:prmr,項目名稱:JetUML,代碼行數:43,代碼來源:WelcomeTab.java

示例11: addTab

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
private void addTab(final JInternalFrame pInternalFrame)
{  
 int frameCount = aTabbedPane.getComponentCount();   
 BasicInternalFrameUI ui = (BasicInternalFrameUI)pInternalFrame.getUI();
 Container north = ui.getNorthPane();
 north.remove(0);
 north.validate();
 north.repaint();
 aTabbedPane.add(setTitle(pInternalFrame), pInternalFrame);
 int i = aTabs.size();
 aTabbedPane.setTabComponentAt(i,
            new ButtonTabComponent(this, pInternalFrame, aTabbedPane));
 aTabs.add(pInternalFrame);
 // position frame
 int emptySpace = FRAME_GAP * Math.max(ESTIMATED_FRAMES, frameCount);
 int width = Math.max(aTabbedPane.getWidth() / 2, aTabbedPane.getWidth() - emptySpace);            
 int height = Math.max(aTabbedPane.getHeight() / 2, aTabbedPane.getHeight() - emptySpace);

 pInternalFrame.reshape(frameCount * FRAME_GAP, frameCount * FRAME_GAP, width, height);
 pInternalFrame.show(); 
 int last = aTabs.size();
 aTabbedPane.setSelectedIndex(last-1);
 if(aTabbedPane.getComponentAt(0) instanceof WelcomeTab)
 {
  removeWelcomeTab();
 }

	}
 
開發者ID:prmr,項目名稱:JetUML,代碼行數:29,代碼來源:EditorFrame.java

示例12: addAsFrame

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
/**
 * Adds a component on this Canvas inside a frame.
 *
 * @param comp The component to add to the canvas.
 * @param toolBox Should be set to true if the resulting frame is
 *     used as a toolbox (that is: it should not be counted as a
 *     frame).
 * @param popupPosition A preferred {@code PopupPosition}.
 * @param resizable Whether this component can be resized.
 * @return The {@code JInternalFrame} that was created and added.
 */
private JInternalFrame addAsFrame(JComponent comp, boolean toolBox,
                                  PopupPosition popupPosition,
                                  boolean resizable) {
    final int FRAME_EMPTY_SPACE = 60;

    final JInternalFrame f = (toolBox) ? new ToolBoxFrame()
        : new JInternalFrame();
    if (f.getContentPane() instanceof JComponent) {
        JComponent c = (JComponent) f.getContentPane();
        c.setOpaque(false);
        c.setBorder(null);
    }

    if (comp.getBorder() != null) {
        if (comp.getBorder() instanceof EmptyBorder) {
            f.setBorder(Utility.blankBorder(10, 10, 10, 10));
        } else {
            f.setBorder(comp.getBorder());
            comp.setBorder(Utility.blankBorder(5, 5, 5, 5));
        }
    } else {
        f.setBorder(null);
    }

    final FrameMotionListener fml = new FrameMotionListener(f);
    comp.addMouseMotionListener(fml);
    comp.addMouseListener(fml);
    if (f.getUI() instanceof BasicInternalFrameUI) {
        BasicInternalFrameUI biu = (BasicInternalFrameUI) f.getUI();
        biu.setNorthPane(null);
        biu.setSouthPane(null);
        biu.setWestPane(null);
        biu.setEastPane(null);
    }

    f.getContentPane().add(comp);
    f.setOpaque(false);
    f.pack();
    int width = f.getWidth();
    int height = f.getHeight();
    if (width > getWidth() - FRAME_EMPTY_SPACE) {
        width = Math.min(width, getWidth());
    }
    if (height > getHeight() - FRAME_EMPTY_SPACE) {
        height = Math.min(height, getHeight());
    }
    f.setSize(width, height);
    Point p = chooseLocation(comp, width, height, popupPosition);
    f.setLocation(p);
    this.add(f, MODAL_LAYER);
    f.setName(comp.getClass().getSimpleName());

    f.setFrameIcon(null);
    f.setVisible(true);
    f.setResizable(resizable);
    try {
        f.setSelected(true);
    } catch (java.beans.PropertyVetoException e) {}

    return f;
}
 
開發者ID:FreeCol,項目名稱:freecol,代碼行數:73,代碼來源:Canvas.java

示例13: ToolWindow

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
/**
 * Constructor.
 * @param name the name of the tool
 * @param desktop the main desktop.
 */
public ToolWindow(String name, MainDesktopPane desktop) {

	// use JInternalFrame constructor
	super(
		name,
		true, // resizable
		true, // closable
		false, // maximizable
		false // iconifiable
	);

	// Initialize data members
	this.name = name;
	this.desktop = desktop;
	this.mainScene = desktop.getMainScene();

	// 2016-10-21 Remove title bar
    //putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);
    getRootPane().setWindowDecorationStyle(JRootPane.NONE);
    BasicInternalFrameUI bi = (BasicInternalFrameUI)super.getUI();
    bi.setNorthPane(null);
    setBorder(null);

    //getRootPane().setOpaque(false);
    //getRootPane().setBackground(new Color(0,0,0,128));
    //setOpaque(false);
    //setBackground(new Color(0,0,0,128));

	if (this instanceof MonitorWindow)
		this.monitorWindow = (MonitorWindow)this;

	opened = false;

	if (mainScene != null) {
		msm = mainScene.getMainSceneMenu();
		//ssm = mainScene.getJFXTabPane().getSelectionModel();
	}

	setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
	//setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);

	// Set internal frame listener
	//ToolFrameListener tool = new ToolFrameListener(this);
	//addInternalFrameListener(tool);

	addInternalFrameListener(new ToolFrameListener());
}
 
開發者ID:mars-sim,項目名稱:mars-sim,代碼行數:53,代碼來源:ToolWindow.java

示例14: testSetGetUI

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
public void testSetGetUI() {
    BasicInternalFrameUI ui = new BasicInternalFrameUI(frame);
    frame.setUI(ui);
    assertTrue(frame.getUI() == ui);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:6,代碼來源:JInternalFrameTest.java

示例15: unwindowFrame

import javax.swing.plaf.basic.BasicInternalFrameUI; //導入依賴的package包/類
protected void unwindowFrame(JInternalFrame frame){
    frame.setBorder(null);
    BasicInternalFrameUI biui = ((javax.swing.plaf.basic.BasicInternalFrameUI) frame.getUI());
    biui.setNorthPane(null);
}
 
開發者ID:datagr4m,項目名稱:org.datagr4m,代碼行數:6,代碼來源:LayeredDisplay.java


注:本文中的javax.swing.plaf.basic.BasicInternalFrameUI類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。