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


Java OverlayLayout類代碼示例

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


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

示例1: InformationPanel

import javax.swing.OverlayLayout; //導入依賴的package包/類
/**
 * Create a new InformationPanel.
 */
InformationPanel() {
	setLayout(new OverlayLayout(this));
	JComponent container = SBoxLayout.createContainer(SBoxLayout.VERTICAL);
	glassPane = new JComponent(){};
	add(glassPane);
	add(container);
	
	// ** Zone name **
	nameField = new JTextPane();
	StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
	nameField.setAlignmentX(CENTER_ALIGNMENT);
	nameField.setOpaque(true);
	nameField.setBackground(getBackground());
	nameField.setForeground(Color.WHITE);
	nameField.setFocusable(false);
	nameField.setEditable(false);
	container.add(nameField, SLayout.EXPAND_X);
	
	// ** Danger display **
	dangerIndicator = new DangerIndicator(MAX_SKULLS);
	dangerIndicator.setAlignmentX(CENTER_ALIGNMENT);
	container.add(dangerIndicator);
	// Default to safe, so that we always have a tooltip
	describeDanger(0);
}
 
開發者ID:arianne,項目名稱:stendhal,代碼行數:29,代碼來源:InformationPanel.java

示例2: MainContainer

import javax.swing.OverlayLayout; //導入依賴的package包/類
/**
 * OliviaWindowから生成.
 * @param mw OliviaWindowのインスタンス
 */
public MainContainer(OliviaWindow mw) {
    this.contentPanel = new ContentView();
    this.statusBar = new StatusBar();
    this.sideBar = new SideBar(Olivia.getProjects().getCurrentProject(), mw);
    this.setLayout(new OverlayLayout(this));
    
    BorderPanel main = new BorderPanel();
    main.add(sideBar, BorderLayout.WEST);
    main.add(contentPanel, BorderLayout.CENTER);
    main.add(statusBar, BorderLayout.SOUTH);
    
    this.add(new OverlayContainer());
    this.add(main);
    
}
 
開發者ID:tohhy,項目名稱:olivia-swing,代碼行數:20,代碼來源:MainContainer.java

示例3: OverlayPanel

import javax.swing.OverlayLayout; //導入依賴的package包/類
public OverlayPanel(JComponent overlay, String text) {
    OverlayLayout layout = new OverlayLayout(this);
    this.setLayout(layout);

    label = new JLabel(text);
    label.setFont(new Font(label.getFont().getName(), Font.ITALIC, 18));
    label.setForeground(new Color(224, 220, 220));
    label.setLocation(0, 0);

    JScrollPane scroller = new JScrollPane(overlay);
    scroller.setLocation(0, 0);
    scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    add(label);
    add(scroller);
}
 
開發者ID:JabRef,項目名稱:jabref,代碼行數:17,代碼來源:OverlayPanel.java

示例4: NerfableInternalFrame

import javax.swing.OverlayLayout; //導入依賴的package包/類
public NerfableInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable) {
  super();
  super.setTitle(title);
  super.setResizable(resizable);
  super.setClosable(closable);
  super.setMaximizable(maximizable);
  super.setIconifiable(iconifiable);

  JPanel realContentPane = new JPanel(new BorderLayout());
    JPanel overlayPanel = new JPanel();
      overlayPanel.setLayout(new OverlayLayout(overlayPanel));
      realContentPane.add(overlayPanel);

    glassPane = new NerfableGlassPane();
      overlayPanel.add(glassPane);

    contentPaneHolder.add(new JPanel());
      overlayPanel.add(contentPaneHolder);

    contentPaneHolder.add(contentPane);

  super.setContentPane(realContentPane);
}
 
開發者ID:Vhati,項目名稱:ArcanistCCG,代碼行數:24,代碼來源:NerfableInternalFrame.java

示例5: getOverlayLayoutConstructor

import javax.swing.OverlayLayout; //導入依賴的package包/類
private static Constructor getOverlayLayoutConstructor() {
    if (overlayLayoutConstructor == null) {
        try {
            overlayLayoutConstructor = OverlayLayout.class.getConstructor(
                                       new Class[] { Container.class });
        } catch (NoSuchMethodException ex) { // should not happen
            Exceptions.printStackTrace(ex);
        }
    }
    return overlayLayoutConstructor;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:OverlayLayoutSupport.java

示例6: makePreviewTable

import javax.swing.OverlayLayout; //導入依賴的package包/類
/**
 * Fills the tablePane with content.
 */
private JComponent makePreviewTable() {
	previewTable = new ExtendedJTable(false, false, false);
	// ensure same background as JPanels in case of only few rows
	previewTable.setBackground(Colors.PANEL_BACKGROUND);
	previewTable.setColoredTableCellRenderer(new ColoredTableCellRenderer() {

		private final Font boldFont = getFont().deriveFont(Font.BOLD);

		@Override
		public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
				int row, int column) {
			JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
			adjustCell(row, label, boldFont);
			return label;
		}

	});

	loadingContentPane = new LoadingContentPane("loading_data", previewTable);

	tablePane = new JScrollPane(loadingContentPane);
	tablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
	tablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	tablePane.setBorder(null);

	// add PREVIEW label in front of scrollpane
	JLayeredPane layeredPane = new JLayeredPane();
	layeredPane.setLayout(new OverlayLayout(layeredPane));
	layeredPane.add(tablePane, JLayeredPane.DEFAULT_LAYER);

	JPanel overlayPanel = new JPanel(new BorderLayout());
	overlayPanel.setOpaque(false);
	overlayLabel = new JLabel("", SwingConstants.CENTER);
	showPreviewLettering();
	overlayPanel.add(overlayLabel, BorderLayout.CENTER);

	layeredPane.add(overlayPanel, JLayeredPane.PALETTE_LAYER);
	return layeredPane;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:43,代碼來源:CSVFormatSpecificationPanel.java

示例7: createFrame

import javax.swing.OverlayLayout; //導入依賴的package包/類
private void createFrame() {
        jframe = new JFrame("Test");
        jframe.setName("MainWindow");
        jframe.setSize(width, height);
        jframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        jframe.setUndecorated(false);
//        jframe.setBackground(new Color(0,0,0,0f));
//        jframe.add(SwingUtils.createCanvas());
//        jfxWindow = createJfxWindow(jframe);

        OverlayLayout layout = new OverlayLayout(jframe);
        
        
        
        JPanel jp1 = new TranslucentPane();
        jp1.setSize(width, (int) (height * 0.5));
        jp1.setBackground(new Color(0,0,0,0));
        jp1.add(new JButton("1111"));
//        jp1.setOpaque(false);
        
        JPanel jp2 = new JPanel();
        jp2.setSize(width, height);
//        jp2.setBackground(new Color(0,0,0,0.1f));
        jp2.add(new JButton("22222222222222"));
        jp2.add(SwingUtils.createCanvas());
        
        
        jframe.add(jp1);
        jframe.add(jp2);

    }
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:32,代碼來源:TestLayered.java

示例8: createTabs

import javax.swing.OverlayLayout; //導入依賴的package包/類
private static void createTabs(){
        rootPanel = new JPanel();
//        canvasPanel.setSize(640, 480);
//        canvasPanel.add(canvas);
//        frame.setSize(640, 480);

        
        frame.getContentPane().add(rootPanel);
        OverlayLayout layout = new OverlayLayout(rootPanel);
//        BorderLayout layout = new BorderLayout(1, 1);
        
        JFXPanel jfxPanel = new JFXPanel();
        jfxPanel.setBounds(0, 0, 100, 100);
        jfxPanel.setSize(100, 100);
        
        rootPanel.setLayout(layout);
//        rootPanel.add(jfxPanel);
        rootPanel.add(new JButton("fsfdsfj;dsj;fjds;jfasf;afja;fd"));
        rootPanel.add(canvas);
        
        Platform.runLater(() -> {
            Button btn = new Button("Hello JFX!");
            StackPane root = new StackPane();
            root.setBackground(Background.EMPTY);
            root.getChildren().add(btn);
//            root.setStyle("-fx-background-color: transparent;");
//            root.setStyle("-fx-background-color:#0000FF;");
            
            Scene scene = new Scene(root);
            scene.setFill(Color.TRANSPARENT);
            
            Stage stage = new Stage();
            stage.initStyle(StageStyle.TRANSPARENT);
            stage.setScene(scene);
            stage.show();
        });
    }
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:38,代碼來源:TestSwing.java

示例9: LabeledProgressBar

import javax.swing.OverlayLayout; //導入依賴的package包/類
public LabeledProgressBar() {

	setLayout(new OverlayLayout(this));

	label = new JLabel();
	label.setAlignmentX(0.5f);
	label.setFont(label.getFont().deriveFont(11f));
	add(label);

	progressBar = new JProgressBar(0, 100);
	progressBar.setBorderPainted(false);
	add(progressBar);

    }
 
開發者ID:mzmine,項目名稱:mzmine2,代碼行數:15,代碼來源:LabeledProgressBar.java

示例10: addLayeredValidator

import javax.swing.OverlayLayout; //導入依賴的package包/類
private void addLayeredValidator() {
    validator = new Validator();
    
    JLayeredPane layeredPane = getRootPane().getLayeredPane();
    layeredPane.setLayout(new OverlayLayout(layeredPane));
    layeredPane.add(validator, (Integer) (JLayeredPane.DEFAULT_LAYER + 50));
    //validator.setBounds(0, 0, getWidth(), getHeight());
}
 
開發者ID:romainguy,項目名稱:filthy-rich-clients,代碼行數:9,代碼來源:ApplicationFrame.java

示例11: createComponents

import javax.swing.OverlayLayout; //導入依賴的package包/類
private void createComponents() {
    this.pannelloPrincipale = new javax.swing.JPanel();
    this.pannelloPrincipale.setLayout(new java.awt.BorderLayout());
    this.glassPane = new GraphSceneGlassPane();
    this.intermediatePanel = new JPanel();
    this.intermediatePanel.setName(Costanti.INTERMEDIE);
    this.intermediatePanel.setLayout(new AbsoluteLayout());
    this.intermediatePanel.setBackground(Costanti.getIntermediateColor());

    this.scrollSource = new JScrollPane();
    this.scrollSource.setMinimumSize(new Dimension(200, getHeight()));
    this.splitChild = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scrollSource, intermediatePanel);
    //this.splitChild.setOneTouchExpandable(true);

    this.scrollTarget = new JScrollPane();
    this.scrollTarget.setMinimumSize(new Dimension(200, getHeight()));
    this.split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.getSplitChild(), scrollTarget);

    this.pannelloPrincipale.setOpaque(false);
    this.glassPane.setOpaque(false);
    this.setOpaque(false);

    OverlayLayout overlaylayout = new OverlayLayout(this);
    this.setLayout(overlaylayout);

    this.add(this.glassPane);
    this.add(this.pannelloPrincipale);
    this.pannelloPrincipale.add(getSplit());

    setSplitPane();
    initMouseListener();
}
 
開發者ID:dbunibas,項目名稱:spicy,代碼行數:33,代碼來源:JLayeredPaneCorrespondences.java

示例12: MapBean

import javax.swing.OverlayLayout; //導入依賴的package包/類
public MapBean(boolean useThreadedNotification) {
   if (logger.isLoggable(Level.FINE)) {
      debugmsg("MapBean()");
   }
   if (!suppressCopyright) {
      Debug.output(copyrightNotice);
   }

   background = DEFAULT_BACKGROUND_COLOR;

   // Don't need one for every MapBean, just the first one.
   suppressCopyright = true;

   super.setLayout(new OverlayLayout(this));
   projectionSupport = new ProjectionSupport(this, useThreadedNotification);
   addComponentListener(this);
   addContainerListener(this);

   // ----------------------------------------
   // In a builder tool it seems that the OverlayLayout
   // makes the MapBean fail to resize. And since it has
   // no children by default, it has no size. So I add
   // a null Layer here to give it a default size.
   // ----------------------------------------
   if (java.beans.Beans.isDesignTime()) {
      add(new Layer() {
         public void projectionChanged(ProjectionEvent e) {
         }

         public Dimension getPreferredSize() {
            return new Dimension(100, 100);
         }
      });
   }

   setPreferredSize(new Dimension(projection.getWidth(), projection.getHeight()));

   DEBUG_TIMESTAMP = logger.isLoggable(Level.FINER);
   DEBUG_THREAD = logger.isLoggable(Level.FINER);
}
 
開發者ID:d2fn,項目名稱:passage,代碼行數:41,代碼來源:MapBean.java

示例13: JSketchCanvas

import javax.swing.OverlayLayout; //導入依賴的package包/類
public JSketchCanvas()
{
	setLayout(new OverlayLayout(this));
	
	background = new BackgroundImagePanel();
	add(background, 0);
	
	drawPanel = new JDrawPanel();
	add(drawPanel, 0);
}
 
開發者ID:jorditost,項目名稱:Scribbling,代碼行數:11,代碼來源:JSketchCanvas.java

示例14: TrackGroup

import javax.swing.OverlayLayout; //導入依賴的package包/類
public TrackGroup(GBrowserView view) {
      this.view = view;
      component.setLayout(new GridBagLayout());    
      component.setInheritsPopupMenu(true);
      //Usually track fills the whole track group and listen for these events. 
      //When the height of the settings panel exceeds the height of the tracks, also the 
      //TrackGroup becomes visible and has to listen for events.
      component.addMouseListener(getView());
      component.addMouseMotionListener(getView());
      component.addMouseWheelListener(getView());
      
      component.setBackground(Color.white);     
      
component.setLayout(new OverlayLayout(component));				

trackLayer = new JPanel();
settingsLayer = new JPanel();

trackLayer.setInheritsPopupMenu(true);
settingsLayer.setInheritsPopupMenu(true);

//First component added is the topmost when drawn
component.add(settingsLayer);
component.add(trackLayer); 		

trackLayer.setLayout(new MigLayout("flowy, fillx, gap 0! 0!, insets 0"));
settingsLayer.setLayout(new MigLayout("gap 0! 0!, insets 0"));

settingsLayer.setOpaque(false);		
trackLayer.setBackground(Color.white);			
  }
 
開發者ID:chipster,項目名稱:chipster,代碼行數:32,代碼來源:TrackGroup.java

示例15: getSupportedClass

import javax.swing.OverlayLayout; //導入依賴的package包/類
/** Gets the supported layout manager class - OverlayLayout.
 * @return the class supported by this delegate
 */
@Override
public Class getSupportedClass() {
    return OverlayLayout.class;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:OverlayLayoutSupport.java


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