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


Java LayoutManager2類代碼示例

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


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

示例1: setLayout

import java.awt.LayoutManager2; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void setLayout(LayoutManager layout) {
    if (layout instanceof XRootLayout) {
        // happens if decoration is uninstalled by ui
        if ((layout != null) && (layout == getLayout())) {
            ((XRootLayout) layout).setLayoutManager(null);
        }
        super.setLayout(layout);
    } else {
        if (layout instanceof LayoutManager2) {
            ((XRootLayout) getLayout()).setLayoutManager((LayoutManager2) layout);
            if (!isValid()) {
                invalidate();
            }
        }
    }
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:21,代碼來源:JXRootPane.java

示例2: setLayout

import java.awt.LayoutManager2; //導入依賴的package包/類
@Override
public void setLayout(LayoutManager layout) {
    if (layout instanceof XRootLayout) {
        // happens if decoration is uninstalled by ui
        if ((layout != null) && (layout == getLayout())) {
            ((XRootLayout) layout).setLayoutManager(null);
        }
        super.setLayout(layout);
    } else {
        if (layout instanceof LayoutManager2) {
            ((XRootLayout) getLayout()).setLayoutManager((LayoutManager2) layout);
            if (!isValid()) {
                invalidate();
            }
        }
    }
}
 
開發者ID:sing-group,項目名稱:aibench-project,代碼行數:18,代碼來源:JXRootPane.java

示例3: getMaximumSize

import java.awt.LayoutManager2; //導入依賴的package包/類
@Override
public Dimension getMaximumSize() {
    if (isMaximumSizeSet()) {
        return super.getMaximumSize();
    }
    if (ui != null) {
        Dimension size = ui.getMaximumSize(this);
        if (size != null) {
            return new Dimension(size);
        }
    }
    LayoutManager layout = getLayout();
    if (layout != null && layout instanceof LayoutManager2) {
        return ((LayoutManager2) layout).maximumLayoutSize(this);
    }
    return new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:18,代碼來源:JComponent.java

示例4: Panel

import java.awt.LayoutManager2; //導入依賴的package包/類
public Panel(LayoutManager2 layout, Locale locale, int subtype)
   {
super(layout);
if(layout instanceof BorderLayout) {
    ((BorderLayout)getLayout()).setHgap(6);
}

createComponents(locale, subtype);
layoutComponents();
setComponentsSize();
   }
 
開發者ID:nomencurator,項目名稱:taxonaut,代碼行數:12,代碼來源:Panel.java

示例5: getMaximumSize

import java.awt.LayoutManager2; //導入依賴的package包/類
/**
 * This method returns the maximum size of the given JComponent.
 *
 * @param x The JComponent to find a maximum size for.
 *
 * @return The maximum size.
 */
public Dimension getMaximumSize(JComponent x)
{
  Dimension max = null;
  LayoutManager layout = frame.getLayout();
  if (frame == x && layout != null && layout instanceof LayoutManager2)
    max = ((LayoutManager2) layout).maximumLayoutSize(frame);
  else
    max = new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
  return max;
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:18,代碼來源:BasicInternalFrameUI.java

示例6: newPanel

import java.awt.LayoutManager2; //導入依賴的package包/類
public static JPanel newPanel(LayoutManager2 layout) {
	JPanel panel = new JPanel(layout);
	panel.setBackground(UIConfig.dialogbackground);
	panel.setOpaque(false);
	panel.applyComponentOrientation(LangConfig.currentComponentOrientation());
	return panel;
}
 
開發者ID:cping,項目名稱:RipplePower,代碼行數:8,代碼來源:Panels.java

示例7: setUp

import java.awt.LayoutManager2; //導入依賴的package包/類
@Override
protected void setUp() throws Exception {
    super.setUp();
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    JFrame.setDefaultLookAndFeelDecorated(true);
    frame = new JFrame();
    rootPane = frame.getRootPane();
    ((JComponent) rootPane).setBorder(BorderFactory.createEmptyBorder(5, 10, 15, 20));
    ui = new MetalRootPaneUI();
    rootPane.setUI(ui);
    layout = (LayoutManager2) rootPane.getLayout();
    titlePane = (JComponent) rootPane.getLayeredPane().getComponent(1);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:14,代碼來源:MetalRootPaneUI$MetalRootLayoutTest.java

示例8: getLayoutManager

import java.awt.LayoutManager2; //導入依賴的package包/類
/**
 * Default layout. Variable sized main panel containing filter
 * values above fixed sized action bar.
 */
protected LayoutManager2 getLayoutManager() {
   return new MigLayout("flowy, gap 0, insets 0",
            "[fill, grow]",         // column layout
            "[fill, grow]3[fill]"   // row layout
    );
}
 
開發者ID:magarena,項目名稱:magarena,代碼行數:11,代碼來源:FilterDialog.java

示例9: Window

import java.awt.LayoutManager2; //導入依賴的package包/類
/**
 * Default constructor
 */
public Window(LayoutManager2 layout) {
	this.setLayout(layout);
}
 
開發者ID:almeidaRodrigo,項目名稱:conciliacao,代碼行數:7,代碼來源:Window.java

示例10: TitlePanel

import java.awt.LayoutManager2; //導入依賴的package包/類
public TitlePanel(LayoutManager2 lm, Window w) {
   super(lm);
   this.parentWindow = w;
   this.registerMouseListener();
}
 
開發者ID:Bolt-Thrower,項目名稱:xdm,代碼行數:6,代碼來源:TitlePanel.java

示例11: init

import java.awt.LayoutManager2; //導入依賴的package包/類
void init() {
   this.setUndecorated(true);
   this.setSize(350, 280);
   this.getContentPane().setLayout((LayoutManager)null);
   this.bgColor = new Color(73, 73, 73);
   this.getContentPane().setBackground(this.bgColor);
   TitlePanel titlePanel = new TitlePanel((LayoutManager2)null, this);
   titlePanel.setOpaque(false);
   titlePanel.setBounds(0, 0, 350, 50);
   JLabel titleLbl = new JLabel("XDM 2016", 0);
   titleLbl.setFont(new Font("Dialog", 1, 20));
   titleLbl.setForeground(StaticResource.selectedColor);
   titleLbl.setBounds(0, 0, 320, 74);
   titlePanel.add(titleLbl);
   this.add(titlePanel);
   JLabel lineLbl = new JLabel();
   lineLbl.setBackground(StaticResource.selectedColor);
   lineLbl.setBounds(0, 75, 350, 1);
   lineLbl.setOpaque(true);
   this.add(lineLbl);
   JLabel iconLbl = new JLabel(XDMMainWindow.getIcon("icon.png"));
   iconLbl.setBounds(32, 95, 70, 70);
   this.add(iconLbl);
   JTextArea txtInfo = new JTextArea("6.0.00\nBuilt on Sunday 6 March 2016\nCopyright (C) 2015\nSubhra Das Gupta\nCopyright (C) 2016\nSeedo Eldho Paul");
   txtInfo.setBounds(114, 100, 201, 90);
   txtInfo.setEditable(false);
   txtInfo.setBackground(this.bgColor);
   txtInfo.setForeground(Color.WHITE);
   this.add(txtInfo);
   ImageIcon icon = XDMIconMap.getIcon("APP_ICON");
   this.setTitle(StringResource.getString("ABT_TTL"));
   this.setIconImage(icon.getImage());
   JPanel p = new JPanel((LayoutManager)null);
   p.setBackground(Color.GRAY);
   p.setBounds(0, 210, 350, 70);
   this.add(p);
   JButton okBtn = new JButton("OK");
   okBtn.setForeground(Color.WHITE);
   okBtn.setFont(StaticResource.plainFontBig2);
   okBtn.setBackground(this.bgColor);
   okBtn.setBounds(0, 1, 350, 70);
   p.add(okBtn);
   okBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
         AboutDialog.this.setVisible(false);
      }
   });
}
 
開發者ID:Bolt-Thrower,項目名稱:xdm,代碼行數:49,代碼來源:AboutDialog.java

示例12: setLayoutManager

import java.awt.LayoutManager2; //導入依賴的package包/類
public void setLayoutManager(LayoutManager2 delegate) {
    this.delegate = delegate;
}
 
開發者ID:sing-group,項目名稱:aibench-project,代碼行數:4,代碼來源:JXRootPane.java

示例13: RoundedPanel

import java.awt.LayoutManager2; //導入依賴的package包/類
public RoundedPanel(LayoutManager2 layout) {
	super(layout);
	setOpaque(false);
	this.cornerRadius = LSystem.COMPONENT_CORNER_RADIUS;
}
 
開發者ID:cping,項目名稱:RipplePower,代碼行數:6,代碼來源:RoundedPanel.java

示例14: newRoundedPanel

import java.awt.LayoutManager2; //導入依賴的package包/類
public static JPanel newRoundedPanel(LayoutManager2 layout) {

		JPanel panel = new RoundedPanel(layout);

		return panel;

	}
 
開發者ID:cping,項目名稱:RipplePower,代碼行數:8,代碼來源:Panels.java

示例15: setLayoutManager

import java.awt.LayoutManager2; //導入依賴的package包/類
/**
 * The layout manager backing this manager. The delegate is used to
 * calculate the size when the UI handles the window decorations.
 * 
 * @param delegate
 *            the backing manager
 */
public void setLayoutManager(LayoutManager2 delegate) {
    this.delegate = delegate;
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:11,代碼來源:JXRootPane.java


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